linux/arch/powerpc
Song Liu ac3b432839 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>
2023-03-09 12:55:15 -08:00
..
boot powerpc updates for 6.3 2023-02-25 11:00:06 -08:00
configs powerpc/ps3: Refresh ps3_defconfig 2023-02-12 22:11:38 +11:00
crypto crypto: powerpc - Use address generation helper for asm 2023-02-10 22:17:36 +11:00
include ARM: 2023-02-25 11:30:21 -08:00
kernel module: replace module_layout with module_memory 2023-03-09 12:55:15 -08:00
kexec powerpc/kexec_file: print error string on usable memory property update failure 2023-02-15 23:14:06 +11:00
kvm ARM: 2023-02-25 11:30:21 -08:00
lib powerpc/kcsan: Add exclusions from instrumentation 2023-02-10 22:19:56 +11:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc updates for 6.3 2023-02-25 11:00:06 -08:00
net powerpc/bpf/32: perform three operands ALU operations 2023-02-10 22:17:35 +11:00
perf powerpc updates for 6.3 2023-02-25 11:00:06 -08:00
platforms powerpc updates for 6.3 2023-02-25 11:00:06 -08:00
purgatory powerpc/kcsan: Add exclusions from instrumentation 2023-02-10 22:19:56 +11:00
sysdev powerpc/rtas: arch-wide function token lookup conversions 2023-02-13 22:35:03 +11:00
tools powerpc/64: Add UADDR64 relocation support 2022-03-09 21:47:53 +11:00
xmon powerpc/rtas: arch-wide function token lookup conversions 2023-02-13 22:35:03 +11:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig powerpc: Avoid dead code/data elimination when using recordmcount 2023-02-28 14:32:34 +11:00
Kconfig.debug powerpc: Add support for early debugging via Serial 16550 console 2022-09-28 19:22:09 +10:00
Makefile Kbuild updates for v6.3 2023-02-26 11:53:25 -08:00
Makefile.postlink kbuild: remove --include-dir MAKEFLAG from top Makefile 2023-02-05 18:51:22 +09:00