Centos-kernel-stream-9/arch/arc/kernel
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
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Makefile arc: ptrace: hard-code "arc" instead of UTS_MACHINE 2020-04-12 22:27:09 -07:00
arc_hostlink.c
arcksyms.c
asm-offsets.c ARC: add support for DSP-enabled userspace applications 2020-03-16 10:30:49 -07:00
ctx_sw.c ARC: [plat-eznps]: Drop support for EZChip NPS platform 2020-10-05 21:02:29 -07:00
ctx_sw_asm.S
devtree.c ARC: [plat-eznps]: Drop support for EZChip NPS platform 2020-10-05 21:02:29 -07:00
disasm.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
entry-arcv2.S
entry-compact.S
entry.S ARC: entry: fix off-by-one error in syscall number validation 2021-05-10 12:38:59 -07:00
fpu.c ARC: fp: set FPU_STATUS.FWE to enable FPU_STATUS update on context switch 2021-08-03 18:58:33 -07:00
head.S ARC: [plat-hsdk] Remap CCMs super early in asm boot trampoline 2020-11-02 11:45:09 -08:00
intc-arcv2.c
intc-compact.c
irq.c
jump_label.c jump_label: make initial NOP patching the special case 2024-03-20 09:43:04 -04:00
kgdb.c ARC: kgdb: add 'fallthrough' to prevent a warning 2021-05-10 12:38:59 -07:00
kprobes.c kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2022-04-06 21:50:14 -04:00
mcip.c
module.c
perf_event.c ARC: perf: redo the pct irq missing in device-tree handling 2020-10-22 10:57:58 -07:00
process.c fork: Generalize PF_IO_WORKER handling 2024-03-20 09:43:04 -04:00
ptrace.c arc: switch to ->regset_get() 2020-07-27 14:31:09 -04:00
reset.c
setup.c ARCv2: boot log: detect newer/upconing HS3x/HS4x releases 2020-06-16 12:56:37 -07:00
signal.c resume_user_mode: Move to resume_user_mode.h 2022-10-12 07:27:47 -04:00
smp.c profile: setup_profiling_timer() is moslty not implemented 2024-03-20 09:42:39 -04:00
stacktrace.c sched: Add wrapper for get_wchan() to keep task blocked 2021-11-23 07:21:25 -05:00
sys.c ARC: wireup clone3 syscall 2020-01-15 16:08:12 -08:00
traps.c
troubleshoot.c arch/arc/kernel/troubleshoot: use vma_lookup() instead of find_vma() 2021-06-29 10:53:51 -07:00
unaligned.c
unwind.c module: replace module_layout with module_memory 2024-06-17 14:17:22 -04:00
vmlinux.lds.S objtool/idle: Validate __cpuidle code as noinstr 2023-06-09 15:48:40 -04:00