Commit Graph

33 Commits

Author SHA1 Message Date
Donald Dutile efc5790fc4 kbuild: generate KSYMTAB entries by modpost
JIRA: https://issues.redhat.com/browse/RHEL-28063

Conflicts:
 (1) Dropped patches for check-local-export; that script was temporarily
     replacing modpost, but abanadoned and modpost resumed with simpler
     addition and-or bug fixes, so skip it here.
 (2) Drop ia64 patches since RHEL doesn't support ia64, and didn't apply cleanly.
 (3) Made cmd_gensymversions genksyms exec same as cmd_gensymtypes;
     cmd_gensymversions appears to be a rhel-ism, and it has no callers/users
     under script hierarchy.

commit ddb5cdbafaaad6b99d7007ae1740403124502d03
Author: Masahiro Yamada <masahiroy@kernel.org>
Date:   Mon Jun 12 00:50:52 2023 +0900

    kbuild: generate KSYMTAB entries by modpost

    Commit 7b4537199a4a ("kbuild: link symbol CRCs at final link, removing
    CONFIG_MODULE_REL_CRCS") made modpost output CRCs in the same way
    whether the EXPORT_SYMBOL() is placed in *.c or *.S.

    For further cleanups, this commit applies a similar approach to the
    entire data structure of EXPORT_SYMBOL().

    The EXPORT_SYMBOL() compilation is split into two stages.

    When a source file is compiled, EXPORT_SYMBOL() will be converted into
    a dummy symbol in the .export_symbol section.

    For example,

        EXPORT_SYMBOL(foo);
        EXPORT_SYMBOL_NS_GPL(bar, BAR_NAMESPACE);

    will be encoded into the following assembly code:

        .section ".export_symbol","a"
        __export_symbol_foo:
                .asciz ""                      /* license */
                .asciz ""                      /* name space */
                .balign 8
                .quad foo                      /* symbol reference */
        .previous

        .section ".export_symbol","a"
        __export_symbol_bar:
                .asciz "GPL"                   /* license */
                .asciz "BAR_NAMESPACE"         /* name space */
                .balign 8
                .quad bar                      /* symbol reference */
        .previous

    They are mere markers to tell modpost the name, license, and namespace
    of the symbols. They will be dropped from the final vmlinux and modules
    because the *(.export_symbol) will go into /DISCARD/ in the linker script.

    Then, modpost extracts all the information about EXPORT_SYMBOL() from the
    .export_symbol section, and generates the final C code:

        KSYMTAB_FUNC(foo, "", "");
        KSYMTAB_FUNC(bar, "_gpl", "BAR_NAMESPACE");

    KSYMTAB_FUNC() (or KSYMTAB_DATA() if it is data) is expanded to struct
    kernel_symbol that will be linked to the vmlinux or a module.

    With this change, EXPORT_SYMBOL() works in the same way for *.c and *.S
    files, providing the following benefits.

    [1] Deprecate EXPORT_DATA_SYMBOL()

    In the old days, EXPORT_SYMBOL() was only available in C files. To export
    a symbol in *.S, EXPORT_SYMBOL() was placed in a separate *.c file.
    arch/arm/kernel/armksyms.c is one example written in the classic manner.

    Commit 22823ab419 ("EXPORT_SYMBOL() for asm") removed this limitation.
    Since then, EXPORT_SYMBOL() can be placed close to the symbol definition
    in *.S files. It was a nice improvement.

    However, as that commit mentioned, you need to use EXPORT_DATA_SYMBOL()
    for data objects on some architectures.

    In the new approach, modpost checks symbol's type (STT_FUNC or not),
    and outputs KSYMTAB_FUNC() or KSYMTAB_DATA() accordingly.

    There are only two users of EXPORT_DATA_SYMBOL:

      EXPORT_DATA_SYMBOL_GPL(empty_zero_page)    (arch/ia64/kernel/head.S)
      EXPORT_DATA_SYMBOL(ia64_ivt)               (arch/ia64/kernel/ivt.S)

    They are transformed as follows and output into .vmlinux.export.c

      KSYMTAB_DATA(empty_zero_page, "_gpl", "");
      KSYMTAB_DATA(ia64_ivt, "", "");

    The other EXPORT_SYMBOL users in ia64 assembly are output as
    KSYMTAB_FUNC().

    EXPORT_DATA_SYMBOL() is now deprecated.

    [2] merge <linux/export.h> and <asm-generic/export.h>

    There are two similar header implementations:

      include/linux/export.h        for .c files
      include/asm-generic/export.h  for .S files

    Ideally, the functionality should be consistent between them, but they
    tend to diverge.

    Commit 8651ec01da ("module: add support for symbol namespaces.") did
    not support the namespace for *.S files.

    This commit shifts the essential implementation part to C, which supports
    EXPORT_SYMBOL_NS() for *.S files.

    <asm/export.h> and <asm-generic/export.h> will remain as a wrapper of
    <linux/export.h> for a while.

    They will be removed after #include <asm/export.h> directives are all
    replaced with #include <linux/export.h>.

    [3] Implement CONFIG_TRIM_UNUSED_KSYMS in one-pass algorithm (by a later commit)

    When CONFIG_TRIM_UNUSED_KSYMS is enabled, Kbuild recursively traverses
    the directory tree to determine which EXPORT_SYMBOL to trim. If an
    EXPORT_SYMBOL turns out to be unused by anyone, Kbuild begins the
    second traverse, where some source files are recompiled with their
    EXPORT_SYMBOL() tuned into a no-op.

    We can do this better now; modpost can selectively emit KSYMTAB entries
    that are really used by modules.

    Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
    Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:28 -04:00
Donald Dutile a27f75beb4 module: add debugging auto-load duplicate module support
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 8660484ed1cf3261e89e0bad94c6395597e87599
Author: Luis Chamberlain <mcgrof@kernel.org>
Date:   Thu Apr 13 22:28:39 2023 -0700

    module: add debugging auto-load duplicate module support

    The finit_module() system call can in the worst case use up to more than
    twice of a module's size in virtual memory. Duplicate finit_module()
    system calls are non fatal, however they unnecessarily strain virtual
    memory during bootup and in the worst case can cause a system to fail
    to boot. This is only known to currently be an issue on systems with
    larger number of CPUs.

    To help debug this situation we need to consider the different sources for
    finit_module(). Requests from the kernel that rely on module auto-loading,
    ie, the kernel's *request_module() API, are one source of calls. Although
    modprobe checks to see if a module is already loaded prior to calling
    finit_module() there is a small race possible allowing userspace to
    trigger multiple modprobe calls racing against modprobe and this not
    seeing the module yet loaded.

    This adds debugging support to the kernel module auto-loader (*request_module()
    calls) to easily detect duplicate module requests. To aid with possible bootup
    failure issues incurred by this, it will converge duplicates requests to a
    single request. This avoids any possible strain on virtual memory during
    bootup which could be incurred by duplicate module autoloading requests.

    Folks debugging virtual memory abuse on bootup can and should enable
    this to see what pr_warn()s come on, to see if module auto-loading is to
    blame for their wores. If they see duplicates they can further debug this
    by enabling the module.enable_dups_trace kernel parameter or by enabling
    CONFIG_MODULE_DEBUG_AUTOLOAD_DUPS_TRACE.

    Current evidence seems to point to only a few duplicates for module
    auto-loading. And so the source for other duplicates creating heavy
    virtual memory pressure due to larger number of CPUs should becoming
    from another place (likely udev).

    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:26 -04:00
Donald Dutile e41f7154cf module: add debug stats to help identify memory pressure
JIRA: https://issues.redhat.com/browse/RHEL-28063

Conflicts:
   Adding RHEL-only MODULE_STATS set to n for now. Possibly
   add in future -debug kernels, to be determined.
   Add rest of commit(s) to enable clean backport for further commits.

commit df3e764d8e5cd416efee29e0de3c93917dff5d33
Author: Luis Chamberlain <mcgrof@kernel.org>
Date:   Tue Mar 28 20:03:19 2023 -0700

    module: add debug stats to help identify memory pressure

    Loading modules with finit_module() can end up using vmalloc(), vmap()
    and vmalloc() again, for a total of up to 3 separate allocations in the
    worst case for a single module. We always kernel_read*() the module,
    that's a vmalloc(). Then vmap() is used for the module decompression,
    and if so the last read buffer is freed as we use the now decompressed
    module buffer to stuff data into our copy module. The last allocation is
    specific to each architectures but pretty much that's generally a series
    of vmalloc() calls or a variation of vmalloc to handle ELF sections with
    special permissions.

    Evaluation with new stress-ng module support [1] with just 100 ops
    is proving that you can end up using GiBs of data easily even with all
    care we have in the kernel and userspace today in trying to not load modules
    which are already loaded. 100 ops seems to resemble the sort of pressure a
    system with about 400 CPUs can create on module loading. Although issues
    relating to duplicate module requests due to each CPU inucurring a new
    module reuest is silly and some of these are being fixed, we currently lack
    proper tooling to help diagnose easily what happened, when it happened
    and who likely is to blame -- userspace or kernel module autoloading.

    Provide an initial set of stats which use debugfs to let us easily scrape
    post-boot information about failed loads. This sort of information can
    be used on production worklaods to try to optimize *avoiding* redundant
    memory pressure using finit_module().

    There's a few examples that can be provided:

    A 255 vCPU system without the next patch in this series applied:

    Startup finished in 19.143s (kernel) + 7.078s (userspace) = 26.221s
    graphical.target reached after 6.988s in userspace

    And 13.58 GiB of virtual memory space lost due to failed module loading:

    root@big ~ # cat /sys/kernel/debug/modules/stats
             Mods ever loaded       67
         Mods failed on kread       0
    Mods failed on decompress       0
      Mods failed on becoming       0
          Mods failed on load       1411
            Total module size       11464704
          Total mod text size       4194304
           Failed kread bytes       0
      Failed decompress bytes       0
        Failed becoming bytes       0
            Failed kmod bytes       14588526272
     Virtual mem wasted bytes       14588526272
             Average mod size       171115
        Average mod text size       62602
      Average fail load bytes       10339140
    Duplicate failed modules:
                  module-name        How-many-times                    Reason
                    kvm_intel                   249                      Load
                          kvm                   249                      Load
                    irqbypass                     8                      Load
             crct10dif_pclmul                   128                      Load
          ghash_clmulni_intel                    27                      Load
                 sha512_ssse3                    50                      Load
               sha512_generic                   200                      Load
                  aesni_intel                   249                      Load
                  crypto_simd                    41                      Load
                       cryptd                   131                      Load
                        evdev                     2                      Load
                    serio_raw                     1                      Load
                   virtio_pci                     3                      Load
                         nvme                     3                      Load
                    nvme_core                     3                      Load
        virtio_pci_legacy_dev                     3                      Load
        virtio_pci_modern_dev                     3                      Load
                       t10_pi                     3                      Load
                       virtio                     3                      Load
                 crc32_pclmul                     6                      Load
               crc64_rocksoft                     3                      Load
                 crc32c_intel                    40                      Load
                  virtio_ring                     3                      Load
                        crc64                     3                      Load

    The following screen shot, of a simple 8vcpu 8 GiB KVM guest with the
    next patch in this series applied, shows 226.53 MiB are wasted in virtual
    memory allocations which due to duplicate module requests during boot.
    It also shows an average module memory size of 167.10 KiB and an an
    average module .text + .init.text size of 61.13 KiB. The end shows all
    modules which were detected as duplicate requests and whether or not
    they failed early after just the first kernel_read*() call or late after
    we've already allocated the private space for the module in
    layout_and_allocate(). A system with module decompression would reveal
    more wasted virtual memory space.

    We should put effort now into identifying the source of these duplicate
    module requests and trimming these down as much possible. Larger systems
    will obviously show much more wasted virtual memory allocations.

    root@kmod ~ # cat /sys/kernel/debug/modules/stats
             Mods ever loaded       67
         Mods failed on kread       0
    Mods failed on decompress       0
      Mods failed on becoming       83
          Mods failed on load       16
            Total module size       11464704
          Total mod text size       4194304
           Failed kread bytes       0
      Failed decompress bytes       0
        Failed becoming bytes       228959096
            Failed kmod bytes       8578080
     Virtual mem wasted bytes       237537176
             Average mod size       171115
        Average mod text size       62602
      Avg fail becoming bytes       2758544
      Average fail load bytes       536130
    Duplicate failed modules:
                  module-name        How-many-times                    Reason
                    kvm_intel                     7                  Becoming
                          kvm                     7                  Becoming
                    irqbypass                     6           Becoming & Load
             crct10dif_pclmul                     7           Becoming & Load
          ghash_clmulni_intel                     7           Becoming & Load
                 sha512_ssse3                     6           Becoming & Load
               sha512_generic                     7           Becoming & Load
                  aesni_intel                     7                  Becoming
                  crypto_simd                     7           Becoming & Load
                       cryptd                     3           Becoming & Load
                        evdev                     1                  Becoming
                    serio_raw                     1                  Becoming
                         nvme                     3                  Becoming
                    nvme_core                     3                  Becoming
                       t10_pi                     3                  Becoming
                   virtio_pci                     3                  Becoming
                 crc32_pclmul                     6           Becoming & Load
               crc64_rocksoft                     3                  Becoming
                 crc32c_intel                     3                  Becoming
        virtio_pci_modern_dev                     2                  Becoming
        virtio_pci_legacy_dev                     1                  Becoming
                        crc64                     2                  Becoming
                       virtio                     2                  Becoming
                  virtio_ring                     2                  Becoming

    [0] https://github.com/ColinIanKing/stress-ng.git
    [1] echo 0 > /proc/sys/vm/oom_dump_tasks
        ./stress-ng --module 100 --module-name xfs

    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:25 -04:00
Donald Dutile b7f1a70598 module: add a for_each_modinfo_entry()
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 1e684172358453df1cb783d7c101a09ff08ceee1
Author: Luis Chamberlain <mcgrof@kernel.org>
Date:   Sun Mar 19 14:27:37 2023 -0700

    module: add a for_each_modinfo_entry()

    Add a for_each_modinfo_entry() to make it easier to read and use.
    This produces no functional changes but makes this code easiert
    to read as we are used to with loops in the kernel and trims more
    lines of code.

    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:23 -04:00
Donald Dutile 0932ad05e1 module: rename next_string() to module_next_tag_pair()
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit feb5b784a26363b690f618213450faf244c1c58e
Author: Luis Chamberlain <mcgrof@kernel.org>
Date:   Sun Mar 19 14:27:36 2023 -0700

    module: rename next_string() to module_next_tag_pair()

    This makes it clearer what it is doing. While at it,
    make it available to other code other than main.c.
    This will be used in the subsequent patch and make
    the changes easier to read.

    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:23 -04:00
Donald Dutile d92b090692 dyndbg: use the module notifier callbacks
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 7deabd67498869640c937c9bd83472574b7dea0b
Author: Jason Baron <jbaron@akamai.com>
Date:   Fri Mar 3 11:50:56 2023 -0500

    dyndbg: use the module notifier callbacks

    Bring dynamic debug in line with other subsystems by using the module
    notifier callbacks. This results in a net decrease in core module
    code.

    Additionally, Jim Cromie has a new dynamic debug classmap feature,
    which requires that jump labels be initialized prior to dynamic debug.
    Specifically, the new feature toggles a jump label from the existing
    dynamic_debug_setup() function. However, this does not currently work
    properly, because jump labels are initialized via the
    'module_notify_list' notifier chain, which is invoked after the
    current call to dynamic_debug_setup(). Thus, this patch ensures that
    jump labels are initialized prior to dynamic debug by setting the
    dynamic debug notifier priority to 0, while jump labels have the
    higher priority of 1.

    Tested by Jim using his new test case, and I've verfied the correct
    printing via: # modprobe test_dynamic_debug dyndbg.

    Link: https://lore.kernel.org/lkml/20230113193016.749791-21-jim.cromie@gmail.com/
    Reported-by: kernel test robot <lkp@intel.com>
    Link: https://lore.kernel.org/oe-kbuild-all/202302190427.9iIK2NfJ-lkp@intel.com/
    Tested-by: Jim Cromie <jim.cromie@gmail.com>
    Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    CC: Jim Cromie <jim.cromie@gmail.com>
    Cc: Luis Chamberlain <mcgrof@kernel.org>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Jason Baron <jbaron@akamai.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:23 -04:00
Donald Dutile 985fe82319 module: replace module_layout with module_memory
JIRA: https://issues.redhat.com/browse/RHEL-28063

Conflict: Remove PPC's module_32.c hunk since not supported in RHEL.

commit ac3b43283923440900b4f36ca5f9f0b1ca43b70e
Author: Song Liu <song@kernel.org>
Date:   Mon Feb 6 16:28:02 2023 -0800

    module: replace module_layout with module_memory

    module_layout manages different types of memory (text, data, rodata, etc.)
    in one allocation, which is problematic for some reasons:

    1. It is hard to enable CONFIG_STRICT_MODULE_RWX.
    2. It is hard to use huge pages in modules (and not break strict rwx).
    3. Many archs uses module_layout for arch-specific data, but it is not
       obvious how these data are used (are they RO, RX, or RW?)

    Improve the scenario by replacing 2 (or 3) module_layout per module with
    up to 7 module_memory per module:

            MOD_TEXT,
            MOD_DATA,
            MOD_RODATA,
            MOD_RO_AFTER_INIT,
            MOD_INIT_TEXT,
            MOD_INIT_DATA,
            MOD_INIT_RODATA,

    and allocating them separately. This adds slightly more entries to
    mod_tree (from up to 3 entries per module, to up to 7 entries per
    module). However, this at most adds a small constant overhead to
    __module_address(), which is expected to be fast.

    Various archs use module_layout for different data. These data are put
    into different module_memory based on their location in module_layout.
    IOW, data that used to go with text is allocated with MOD_MEM_TYPE_TEXT;
    data that used to go with data is allocated with MOD_MEM_TYPE_DATA, etc.

    module_memory simplifies quite some of the module code. For example,
    ARCH_WANTS_MODULES_DATA_IN_VMALLOC is a lot cleaner, as it just uses a
    different allocator for the data. kernel/module/strict_rwx.c is also
    much cleaner with module_memory.

    Signed-off-by: Song Liu <song@kernel.org>
    Cc: Luis Chamberlain <mcgrof@kernel.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Guenter Roeck <linux@roeck-us.net>
    Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
    Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:22 -04:00
Donald Dutile c91fd16d3d dyndbg: gather __dyndbg[] state into struct _ddebug_info
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit b7b4eebdba7b6aea6b34dc29691b71c39d1dbd6a
Author: Jim Cromie <jim.cromie@gmail.com>
Date:   Sun Sep 4 15:40:48 2022 -0600

    dyndbg: gather __dyndbg[] state into struct _ddebug_info

    This new struct composes the linker provided (vector,len) section,
    and provides a place to add other __dyndbg[] state-data later:

      descs - the vector of descriptors in __dyndbg section.
      num_descs - length of the data/section.

    Use it, in several different ways, as follows:

    In lib/dynamic_debug.c:

    ddebug_add_module(): Alter params-list, replacing 2 args (array,index)
    with a struct _ddebug_info * containing them both, with room for
    expansion.  This helps future-proof the function prototype against the
    looming addition of class-map info into the dyndbg-state, by providing
    a place to add more member fields later.

    NB: later add static struct _ddebug_info builtins_state declaration,
    not needed yet.

    ddebug_add_module() is called in 2 contexts:

    In dynamic_debug_init(), declare, init a struct _ddebug_info di
    auto-var to use as a cursor.  Then iterate over the prdbg blocks of
    the builtin modules, and update the di cursor before calling
    _add_module for each.

    Its called from kernel/module/main.c:load_info() for each loaded
    module:

    In internal.h, alter struct load_info, replacing the dyndbg array,len
    fields with an embedded _ddebug_info containing them both; and
    populate its members in find_module_sections().

    The 2 calling contexts differ in that _init deals with contiguous
    subranges of __dyndbgs[] section, packed together, while loadable
    modules are added one at a time.

    So rename ddebug_add_module() into outer/__inner fns, call __inner
    from _init, and provide the offset into the builtin __dyndbgs[] where
    the module's prdbgs reside.  The cursor provides start, len of the
    subrange for each.  The offset will be used later to pack the results
    of builtin __dyndbg_sites[] de-duplication, and is 0 and unneeded for
    loadable modules,

    Note:

    kernel/module/main.c includes <dynamic_debug.h> for struct
    _ddeubg_info.  This might be prone to include loops, since its also
    included by printk.h.  Nothing has broken in robot-land on this.

    cc: Luis Chamberlain <mcgrof@kernel.org>
    Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
    Link: https://lore.kernel.org/r/20220904214134.408619-12-jim.cromie@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:20 -04:00
Donald Dutile 76837e4c34 module: Modify module_flags() to accept show_state argument
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 17dd25c29cda98c370f8d5a4ae3daee33fac1669
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Thu Jul 14 16:39:31 2022 +0100

    module: Modify module_flags() to accept show_state argument

    No functional change.

    With this patch a given module's state information (i.e. 'mod->state')
    can be omitted from the specified buffer. Please note that this is in
    preparation to include the last unloaded module's taint flag(s),
    if available.

    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:18 -04:00
Donald Dutile 154bd8c65e module: Fix selfAssignment cppcheck warning
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit cfa94c538be621a0ba645adfa9ead005b5fa02f6
Author: Christophe Leroy <christophe.leroy@csgroup.eu>
Date:   Sun Jun 12 17:21:56 2022 +0200

    module: Fix selfAssignment cppcheck warning

    cppcheck reports the following warnings:

    kernel/module/main.c:1455:26: warning: Redundant assignment of 'mod->core_layout.size' to itself. [selfAssignment]
       mod->core_layout.size = strict_align(mod->core_layout.size);
                             ^
    kernel/module/main.c:1489:26: warning: Redundant assignment of 'mod->init_layout.size' to itself. [selfAssignment]
       mod->init_layout.size = strict_align(mod->init_layout.size);
                             ^
    kernel/module/main.c:1493:26: warning: Redundant assignment of 'mod->init_layout.size' to itself. [selfAssignment]
       mod->init_layout.size = strict_align(mod->init_layout.size);
                             ^
    kernel/module/main.c:1504:26: warning: Redundant assignment of 'mod->init_layout.size' to itself. [selfAssignment]
       mod->init_layout.size = strict_align(mod->init_layout.size);
                             ^
    kernel/module/main.c:1459:26: warning: Redundant assignment of 'mod->data_layout.size' to itself. [selfAssignment]
       mod->data_layout.size = strict_align(mod->data_layout.size);
                             ^
    kernel/module/main.c:1463:26: warning: Redundant assignment of 'mod->data_layout.size' to itself. [selfAssignment]
       mod->data_layout.size = strict_align(mod->data_layout.size);
                             ^
    kernel/module/main.c:1467:26: warning: Redundant assignment of 'mod->data_layout.size' to itself. [selfAssignment]
       mod->data_layout.size = strict_align(mod->data_layout.size);
                             ^

    This is due to strict_align() being a no-op when
    CONFIG_STRICT_MODULE_RWX is not selected.

    Transform strict_align() macro into an inline function. It will
    allow type checking and avoid the selfAssignment warning.

    Reported-by: kernel test robot <lkp@intel.com>
    Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:17 -04:00
Donald Dutile 4fcd9ef6e5 module: Introduce module unload taint tracking
JIRA: https://issues.redhat.com/browse/RHEL-28063

Conflicts:
  Added redhat/configs/common/generic/CONFIG_MODULE_UNLOAD_TAINT_TRACKING
  to not build this new tracking.  Need to determine if it should be in -debug
  kernel only, base kernel (because it shows tainted modules on bad-page failure),
  or not at all, but developers can turn it on in a custom/scratch kernel.

commit 99bd9956551b27cb6f5b445abaced7e13b9976cd
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Mon May 2 21:52:52 2022 +0100

    module: Introduce module unload taint tracking

    Currently, only the initial module that tainted the kernel is
    recorded e.g. when an out-of-tree module is loaded.

    The purpose of this patch is to allow the kernel to maintain a record of
    each unloaded module that taints the kernel. So, in addition to
    displaying a list of linked modules (see print_modules()) e.g. in the
    event of a detected bad page, unloaded modules that carried a taint/or
    taints are displayed too. A tainted module unload count is maintained.

    The number of tracked modules is not fixed. This feature is disabled by
    default.

    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:16 -04:00
Donald Dutile e9b3b40c84 module: Move module_assert_mutex_or_preempt() to internal.h
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 6fb0538d0121ffab770a505b183968d93466ad59
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Mon May 2 21:51:04 2022 +0100

    module: Move module_assert_mutex_or_preempt() to internal.h

    No functional change.

    This patch migrates module_assert_mutex_or_preempt() to internal.h.
    So, the aforementiond function can be used outside of main/or core
    module code yet will remain restricted for internal use only.

    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:16 -04:00
Donald Dutile f19d107a94 module: Make module_flags_taint() accept a module's taints bitmap and usable outside core code
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit c14e522bc76efed6e947cd0ab83a1fac7a7a3ec9
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Mon May 2 21:51:03 2022 +0100

    module: Make module_flags_taint() accept a module's taints bitmap and usable outside core code

    No functional change.

    The purpose of this patch is to modify module_flags_taint() to accept
    a module's taints bitmap as a parameter and modifies all users
    accordingly. Furthermore, it is now possible to access a given
    module's taint flags data outside of non-essential code yet does
    remain for internal use only.

    This is in preparation for module unload taint tracking support.

    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:16 -04:00
Donald Dutile eebea0a15e module: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 01dc0386efb769056257410ba5754558384006a7
Author: Christophe Leroy <christophe.leroy@csgroup.eu>
Date:   Wed Feb 23 13:02:14 2022 +0100

    module: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC

    Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC to allow architectures
    to request having modules data in vmalloc area instead of module area.

    This is required on powerpc book3s/32 in order to set data non
    executable, because it is not possible to set executability on page
    basis, this is done per 256 Mbytes segments. The module area has exec
    right, vmalloc area has noexec.

    This can also be useful on other powerpc/32 in order to maximize the
    chance of code being close enough to kernel core to avoid branch
    trampolines.

    Cc: Jason Wessel <jason.wessel@windriver.com>
    Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
    Cc: Douglas Anderson <dianders@chromium.org>
    Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    [mcgrof: rebased in light of kernel/module/kdb.c move]
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:14 -04:00
Donald Dutile 5cc7ec8730 module: Introduce data_layout
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 6ab9942c44b2d213a16b2620e4baf0223122222f
Author: Christophe Leroy <christophe.leroy@csgroup.eu>
Date:   Wed Feb 23 13:02:13 2022 +0100

    module: Introduce data_layout

    In order to allow separation of data from text, add another layout,
    called data_layout. For architectures requesting separation of text
    and data, only text will go in core_layout and data will go in
    data_layout.

    For architectures which keep text and data together, make data_layout
    an alias of core_layout, that way data_layout can be used for all
    data manipulations, regardless of whether data is in core_layout or
    data_layout.

    Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:14 -04:00
Donald Dutile aad339f361 module: Prepare for handling several RB trees
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 446d55666d5599ca58c1ceac25ce4b5191e70835
Author: Christophe Leroy <christophe.leroy@csgroup.eu>
Date:   Wed Feb 23 13:02:12 2022 +0100

    module: Prepare for handling several RB trees

    In order to separate text and data, we need to setup
    two rb trees.

    Modify functions to give the tree as a parameter.

    Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:14 -04:00
Donald Dutile 25bea5139f module: Always have struct mod_tree_root
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 80b8bf4369906aefbcb63a03012aed7a1abcbd18
Author: Christophe Leroy <christophe.leroy@csgroup.eu>
Date:   Wed Feb 23 13:02:11 2022 +0100

    module: Always have struct mod_tree_root

    In order to separate text and data, we need to setup
    two rb trees.

    This means that struct mod_tree_root is required even without
    MODULES_TREE_LOOKUP.

    Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Reviewed-by: Aaron Tomlin <atomlin@atomlin.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:13 -04:00
Donald Dutile d87a0d1397 module: Rename debug_align() as strict_align()
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 7337f929d5672e37a80c8582d357f084320f475f
Author: Christophe Leroy <christophe.leroy@csgroup.eu>
Date:   Wed Feb 23 10:01:01 2022 +0100

    module: Rename debug_align() as strict_align()

    debug_align() was added by commit 84e1c6bb38 ("x86: Add RO/NX
    protection for loadable kernel modules")

    At that time the config item was CONFIG_DEBUG_SET_MODULE_RONX.

    But nowadays it has changed to CONFIG_STRICT_MODULE_RWX and
    debug_align() is confusing because it has nothing to do with
    DEBUG.

    Rename it strict_align()

    Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:13 -04:00
Donald Dutile 0081634546 module: Rework layout alignment to avoid BUG_ON()s
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit ef505058dc5524488a84423b4d5e8a7598a23a2e
Author: Christophe Leroy <christophe.leroy@csgroup.eu>
Date:   Wed Feb 23 10:01:00 2022 +0100

    module: Rework layout alignment to avoid BUG_ON()s

    Perform layout alignment verification up front and WARN_ON()
    and fail module loading instead of crashing the machine.

    Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:13 -04:00
Donald Dutile 6c8096373e module: Move module_enable_x() and frob_text() in strict_rwx.c
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 32a08c17d8096f0fd2c6600bc5fe8464aaf68ea7
Author: Christophe Leroy <christophe.leroy@csgroup.eu>
Date:   Wed Feb 23 10:00:59 2022 +0100

    module: Move module_enable_x() and frob_text() in strict_rwx.c

    Move module_enable_x() together with module_enable_nx() and
    module_enable_ro().

    Those three functions are going together, they are all used
    to set up the correct page flags on the different sections.

    As module_enable_x() is used independently of
    CONFIG_STRICT_MODULE_RWX, build strict_rwx.c all the time and
    use IS_ENABLED(CONFIG_STRICT_MODULE_RWX) when relevant.

    Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:13 -04:00
Donald Dutile d9a4fbb785 module: Make module_enable_x() independent of CONFIG_ARCH_HAS_STRICT_MODULE_RWX
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 0597579356fe5b6c0b99196e4743d4c2978f654a
Author: Christophe Leroy <christophe.leroy@csgroup.eu>
Date:   Wed Feb 23 10:00:58 2022 +0100

    module: Make module_enable_x() independent of CONFIG_ARCH_HAS_STRICT_MODULE_RWX

    module_enable_x() has nothing to do with CONFIG_ARCH_HAS_STRICT_MODULE_RWX
    allthough by coincidence architectures who need module_enable_x() are
    selection CONFIG_ARCH_HAS_STRICT_MODULE_RWX.

    Enable module_enable_x() for everyone everytime. If an architecture
    already has module text set executable, it's a no-op.

    Don't check text_size alignment. When CONFIG_STRICT_MODULE_RWX is set
    the verification is already done in frob_rodata(). When
    CONFIG_STRICT_MODULE_RWX is not set it is not a big deal to have the
    start of data as executable. Just make sure we entirely get the last
    page when the boundary is not aligned.

    And don't BUG on misaligned base as some architectures like nios2
    use kmalloc() for allocating modules. So just bail out in that case.
    If that's a problem, a page fault will occur later anyway.

    Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:13 -04:00
Donald Dutile 19011718f7 module: Move version support into a separate file
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 47889798da4307ed78346f04c5d95c87abbf696b
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Tue Mar 22 14:03:44 2022 +0000

    module: Move version support into a separate file

    No functional change.

    This patch migrates module version support out of core code into
    kernel/module/version.c. In addition simple code refactoring to
    make this possible.

    Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:13 -04:00
Donald Dutile b0398c9791 module: Move sysfs support into a separate file
JIRA: https://issues.redhat.com/browse/RHEL-28063

Conflicts:
  Modified sysfs.c patch to change spaces before tabs
  that git am was complaining about.  No functional change.

commit 44c09535de4784f31d151aa1047efcf4797ca3cd
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Tue Mar 22 14:03:42 2022 +0000

    module: Move sysfs support into a separate file

    No functional change.

    This patch migrates module sysfs support out of core code into
    kernel/module/sysfs.c. In addition simple code refactoring to
    make this possible.

    Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:13 -04:00
Donald Dutile 87cd922cd5 module: Move procfs support into a separate file
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 0ffc40f6c8ab684e694774ebc835b198398129a8
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Tue Mar 22 14:03:41 2022 +0000

    module: Move procfs support into a separate file

    No functional change.

    This patch migrates code that allows one to generate a
    list of loaded/or linked modules via /proc when procfs
    support is enabled into kernel/module/procfs.c.

    Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:13 -04:00
Donald Dutile 0b2ef88663 module: Move kallsyms support into a separate file
JIRA: https://issues.redhat.com/browse/RHEL-28063

Conflicts:
  RHEL9 source diff due to out-of-order backport of
  upstream d099f594ad in RHEL9 commit 3bade5d33b.
  Make sure new file has RHEL9 modifications to
  find_kallsyms_symbol_value.

commit 91fb02f31505dc22262b13a129550f470ab90a79
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Tue Mar 22 14:03:39 2022 +0000

    module: Move kallsyms support into a separate file

    No functional change.

    This patch migrates kallsyms code out of core module
    code kernel/module/kallsyms.c

    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:13 -04:00
Donald Dutile 44af027a2d module: Move kmemleak support to a separate file
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 473c84d1856e83faebf059a52a8e49bdb89026d3
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Tue Mar 22 14:03:38 2022 +0000

    module: Move kmemleak support to a separate file

    No functional change.

    This patch migrates kmemleak code out of core module
    code into kernel/module/debug_kmemleak.c

    Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:13 -04:00
Donald Dutile 0e91fd91e1 module: Move extra signature support out of core code
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 0c1e42805c25c87eb7a6f3b18bdbf3b3b7840aff
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Tue Mar 22 14:03:37 2022 +0000

    module: Move extra signature support out of core code

    No functional change.

    This patch migrates additional module signature check
    code from core module code into kernel/module/signing.c.

    Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:13 -04:00
Donald Dutile 8be63c7f48 module: Move strict rwx support to a separate file
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit b33465fe9c52a3719f013deeca261bd82af235ee
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Tue Mar 22 14:03:36 2022 +0000

    module: Move strict rwx support to a separate file

    No functional change.

    This patch migrates code that makes module text
    and rodata memory read-only and non-text memory
    non-executable from core module code into
    kernel/module/strict_rwx.c.

    Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:13 -04:00
Donald Dutile eb9c24ef2b module: Move latched RB-tree support to a separate file
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 58d208de3e8d87dbe196caf0b57cc58c7a3836ca
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Tue Mar 22 14:03:35 2022 +0000

    module: Move latched RB-tree support to a separate file

    No functional change.

    This patch migrates module latched RB-tree support
    (e.g. see __module_address()) from core module code
    into kernel/module/tree_lookup.c.

    Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:13 -04:00
Donald Dutile 15862b318b module: Move livepatch support to a separate file
JIRA: https://issues.redhat.com/browse/RHEL-28063

Conflicts:
   Source and patch diff due to RHEL9 commit 6e0e3815
   applied out of order with respect to upstream.
   Carried the modification main.c to livepatch.c;
   just comments, no functional changes.

commit 1be9473e31ab87ad1b6ecf9fd11df461930ede85
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Tue Mar 22 14:03:34 2022 +0000

    module: Move livepatch support to a separate file

    No functional change.

    This patch migrates livepatch support (i.e. used during module
    add/or load and remove/or deletion) from core module code into
    kernel/module/livepatch.c. At the moment it contains code to
    persist Elf information about a given livepatch module, only.
    The new file was added to MAINTAINERS.

    Reviewed-by: Petr Mladek <pmladek@suse.com>
    Tested-by: Petr Mladek <pmladek@suse.com>
    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:12 -04:00
Donald Dutile 4469abdac2 module: Make internal.h and decompress.c more compliant
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 5aff4dfdb4ae2741cfff759d917f597f2c7f70aa
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Tue Mar 22 14:03:33 2022 +0000

    module: Make internal.h and decompress.c more compliant

    This patch will address the following warning and style violations
    generated by ./scripts/checkpatch.pl in strict mode:

      WARNING: Use #include <linux/module.h> instead of <asm/module.h>
      #10: FILE: kernel/module/internal.h:10:
      +#include <asm/module.h>

      CHECK: spaces preferred around that '-' (ctx:VxV)
      #18: FILE: kernel/module/internal.h:18:
      +#define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1))

      CHECK: Please use a blank line after function/struct/union/enum declarations
      #69: FILE: kernel/module/internal.h:69:
      +}
      +static inline void module_decompress_cleanup(struct load_info *info)
                                                       ^
      CHECK: extern prototypes should be avoided in .h files
      #84: FILE: kernel/module/internal.h:84:
      +extern int mod_verify_sig(const void *mod, struct load_info *info);

      WARNING: Missing a blank line after declarations
      #116: FILE: kernel/module/decompress.c:116:
      +               struct page *page = module_get_next_page(info);
      +               if (!page) {

      WARNING: Missing a blank line after declarations
      #174: FILE: kernel/module/decompress.c:174:
      +               struct page *page = module_get_next_page(info);
      +               if (!page) {

      CHECK: Please use a blank line after function/struct/union/enum declarations
      #258: FILE: kernel/module/decompress.c:258:
      +}
      +static struct kobj_attribute module_compression_attr = __ATTR_RO(compression);

    Note: Fortunately, the multiple-include optimisation found in
    include/linux/module.h will prevent duplication/or inclusion more than
    once.

    Fixes: f314dfea16 ("modsign: log module name in the event of an error")
    Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:12 -04:00
Donald Dutile 1f57de1780 module: Simple refactor in preparation for split
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 8ab4ed08a24f88359f22439e37cac65c95cf6ac2
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Tue Mar 22 14:03:32 2022 +0000

    module: Simple refactor in preparation for split

    No functional change.

    This patch makes it possible to move non-essential code
    out of core module code.

    Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:12 -04:00
Donald Dutile 9aee9de53d module: Move all into module/
JIRA: https://issues.redhat.com/browse/RHEL-28063

Conflicts:
  RHEL9 applied 12 patches to kernel/modules, several that
  had origins after this upstream commit, and modified to
  use existing kernel/module*.c files.  Thus, the source
  removes differ with those commits, and the additions/move
  to kernel/module/*.c mirrors those removals, preserving the
  same functionality.
  The RHEL9 applied patches show up in further backport
  conflicts that are listed on a per-commit-backport basis
  because of this out-of-order patch application.

commit cfc1d277891eb499b3b5354df33b30f598683e90
Author: Aaron Tomlin <atomlin@redhat.com>
Date:   Tue Mar 22 14:03:31 2022 +0000

    module: Move all into module/

    No functional changes.

    This patch moves all module related code into a separate directory,
    modifies each file name and creates a new Makefile. Note: this effort
    is in preparation to refactor core module code.

    Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

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