Commit Graph

2 Commits

Author SHA1 Message Date
Donald Dutile f03ebb3059 kallsyms: make kallsyms_show_value() as generic function
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 0eeaf1eb40a34fddd1d568a9b32c3d6669238743
Author: Maninder Singh <maninder1.s@samsung.com>
Date:   Thu Jun 8 09:01:19 2023 +0530

    kallsyms: make kallsyms_show_value() as generic function

    This change makes function kallsyms_show_value() as
    generic function without dependency on CONFIG_KALLSYMS.

    Now module address will be displayed with lsmod and /proc/modules.

    Earlier:
    =======
    / # insmod  test.ko
    / # lsmod
    test 12288 0 - Live 0x0000000000000000 (O)  // No Module Load address
    / #

    With change:
    ==========
    / # insmod test.ko
    / # lsmod
    test 12288 0 - Live 0xffff800000fc0000 (O)  // Module address
    / # cat /proc/modules
    test 12288 0 - Live 0xffff800000fc0000 (O)

    Co-developed-by: Onkarnath <onkarnath.1@samsung.com>
    Signed-off-by: Onkarnath <onkarnath.1@samsung.com>
    Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
    Reviewed-by: Zhen Lei <thunder.leizhen@huawei.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:28 -04:00
Donald Dutile 538a6ce9ff kallsyms: move kallsyms_show_value() out of kallsyms.c
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit b06e9318bfd03f531b918bd27b63f1eb88c21729
Author: Maninder Singh <maninder1.s@samsung.com>
Date:   Thu Jun 8 09:01:18 2023 +0530

    kallsyms: move kallsyms_show_value() out of kallsyms.c

    function kallsyms_show_value() is used by other parts
    like modules_open(), kprobes_read() etc. which can work in case of
    !KALLSYMS also.

    e.g. as of now lsmod do not show module address if KALLSYMS is disabled.
    since kallsyms_show_value() defination is not present, it returns false
    in !KALLSYMS.

    / # lsmod
    test 12288 0 - Live 0x0000000000000000 (O)

    So kallsyms_show_value() can be made generic
    without dependency on KALLSYMS.

    Thus moving out function to a new file ksyms_common.c.

    With this patch code is just moved to new file
    and no functional change.

    Co-developed-by: Onkarnath <onkarnath.1@samsung.com>
    Signed-off-by: Onkarnath <onkarnath.1@samsung.com>
    Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
    Reviewed-by: Zhen Lei <thunder.leizhen@huawei.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:27 -04:00