linux-next/arch
Mike Rapoport (IBM) 12af2b83d0 mm: introduce execmem_alloc() and execmem_free()
module_alloc() is used everywhere as a mean to allocate memory for code.

Beside being semantically wrong, this unnecessarily ties all subsystems
that need to allocate code, such as ftrace, kprobes and BPF to modules and
puts the burden of code allocation to the modules code.

Several architectures override module_alloc() because of various
constraints where the executable memory can be located and this causes
additional obstacles for improvements of code allocation.

Start splitting code allocation from modules by introducing execmem_alloc()
and execmem_free() APIs.

Initially, execmem_alloc() is a wrapper for module_alloc() and
execmem_free() is a replacement of module_memfree() to allow updating all
call sites to use the new APIs.

Since architectures define different restrictions on placement,
permissions, alignment and other parameters for memory that can be used by
different subsystems that allocate executable memory, execmem_alloc() takes
a type argument, that will be used to identify the calling subsystem and to
allow architectures define parameters for ranges suitable for that
subsystem.

No functional changes.

Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
2024-05-14 00:31:43 -07:00
..
alpha alpha: drop pre-EV56 support 2024-05-06 12:05:00 +02:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-04-16 10:45:57 -07:00
arm Scheduler changes for v6.10: 2024-05-13 17:18:51 -07:00
arm64 arm64: module: remove unneeded call to kasan_alloc_module_shadow() 2024-05-14 00:31:43 -07:00
csky csky: Emulate one-byte cmpxchg 2024-05-11 07:07:07 -07:00
hexagon hexagon: vmlinux.lds.S: handle attributes section 2024-03-26 11:07:23 -07:00
loongarch for-6.10/block-20240511 2024-05-13 13:03:54 -07:00
m68k TTY/Serial driver update for 6.9-rc1 2024-03-21 12:44:10 -07:00
microblaze arch: define CONFIG_PAGE_SIZE_*KB on all architectures 2024-03-06 19:29:09 +01:00
mips mips: module: rename MODULE_START to MODULES_VADDR 2024-05-14 00:31:43 -07:00
nios2 nios2: define virtual address space for modules 2024-05-14 00:31:43 -07:00
openrisc OpenRISC updates for 6.9 2024-03-14 15:53:10 -07:00
parisc parisc: add u16 support to cmpxchg() 2024-04-09 22:06:00 -07:00
powerpc mm: introduce execmem_alloc() and execmem_free() 2024-05-14 00:31:43 -07:00
riscv soc: drivers for 6.10 2024-05-13 08:48:42 -07:00
s390 mm: introduce execmem_alloc() and execmem_free() 2024-05-14 00:31:43 -07:00
sh sh updates for v6.9 2024-03-21 10:13:47 -07:00
sparc mm: introduce execmem_alloc() and execmem_free() 2024-05-14 00:31:43 -07:00
um x86/percpu: Rewrite x86_this_cpu_test_bit() and friends as macros 2024-04-06 12:42:17 +02:00
x86 mm: introduce execmem_alloc() and execmem_free() 2024-05-14 00:31:43 -07:00
xtensa Xtensa fixes for v6.9: 2024-05-02 10:41:28 -07:00
.gitignore
Kconfig execve updates for 6.10-rc1 2024-05-13 14:01:33 -07:00