linux-stable/kernel
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
..
bpf mm: introduce execmem_alloc() and execmem_free() 2024-05-14 00:31:43 -07:00
cgroup
configs hardening updates for 6.10-rc1 2024-05-13 14:14:05 -07:00
debug
dma swiotlb: initialise restricted pool list_head when SWIOTLB_DYNAMIC=y 2024-05-02 14:57:04 +02:00
entry
events perf/bpf: Mark perf_event_set_bpf_handler() and perf_event_free_bpf_handler() as inline too 2024-04-14 22:35:26 +02:00
futex
gcov
irq genirq: Introduce IRQF_COND_ONESHOT and use it in pinctrl-amd 2024-03-25 23:45:21 +01:00
kcsan kcsan, compiler_types: Introduce __data_racy type qualifier 2024-05-07 11:39:50 -07:00
livepatch
locking locking/pvqspinlock: Use try_cmpxchg() in qspinlock_paravirt.h 2024-04-12 11:42:39 +02:00
module mm: introduce execmem_alloc() and execmem_free() 2024-05-14 00:31:43 -07:00
power PM: s2idle: Make sure CPUs will wakeup directly on resume 2024-04-08 15:36:54 +02:00
printk printk changes for 6.9-rc2 2024-03-26 09:25:57 -07:00
rcu Merge branches 'fixes.2024.04.15a', 'misc.2024.04.12a', 'rcu-sync-normal-improve.2024.04.15a', 'rcu-tasks.2024.04.15a' and 'rcutorture.2024.04.15a' into rcu-merge.2024.04.15a 2024-05-01 13:04:02 +02:00
sched Scheduler changes for v6.10: 2024-05-13 17:18:51 -07:00
time Scheduler changes for v6.10: 2024-05-13 17:18:51 -07:00
trace RCU pull request for v6.10 2024-05-13 09:49:06 -07:00
.gitignore
acct.c
async.c
audit.c
audit.h
audit_fsnotify.c
audit_tree.c
audit_watch.c
auditfilter.c
auditsc.c
backtracetest.c
bounds.c bounds: Use the right number of bits for power-of-two CONFIG_NR_CPUS 2024-04-29 08:29:29 -07:00
capability.c
cfi.c
compat.c
configs.c
context_tracking.c context_tracking: Make context_tracking_key __ro_after_init 2024-03-22 11:18:18 +01:00
cpu.c cpu: Ignore "mitigations" kernel parameter if CPU_MITIGATIONS=n 2024-04-25 15:47:39 +02:00
cpu_pm.c
crash_core.c
crash_reserve.c crash: use macro to add crashk_res into iomem early for specific arch 2024-03-26 11:14:12 -07:00
cred.c
delayacct.c
dma.c
elfcorehdr.c
exec_domain.c
exit.c
exit.h
extable.c
fail_function.c
fork.c fork: defer linking file vma until vma is fully initialized 2024-04-16 15:39:51 -07:00
freezer.c
gen_kheaders.sh
groups.c
hung_task.c
iomem.c
irq_work.c
jump_label.c jump_label,module: Don't alloc static_key_mod for __ro_after_init keys 2024-03-22 11:18:16 +01:00
kallsyms.c
kallsyms_internal.h
kallsyms_selftest.c
kallsyms_selftest.h
kcmp.c
Kconfig.freezer
Kconfig.hz
Kconfig.kexec
Kconfig.locks
Kconfig.preempt
kcov.c
kexec.c
kexec_core.c
kexec_elf.c
kexec_file.c
kexec_internal.h
kheaders.c
kprobes.c mm: introduce execmem_alloc() and execmem_free() 2024-05-14 00:31:43 -07:00
ksyms_common.c
ksysfs.c Driver core changes for 6.9-rc1 2024-03-21 13:34:15 -07:00
kthread.c
latencytop.c
Makefile
module_signature.c
notifier.c
nsproxy.c
numa.c
padata.c padata: Disable BH when taking works lock on MT path 2024-04-12 15:07:51 +08:00
panic.c
params.c
pid.c
pid_namespace.c
pid_sysctl.h
profile.c profiling: Remove create_prof_cpu_mask(). 2024-04-27 11:17:48 -07:00
ptrace.c
range.c
reboot.c
regset.c
relay.c
resource.c
resource_kunit.c
rseq.c
scftorture.c
scs.c
seccomp.c seccomp: Constify sysctl subhelpers 2024-05-08 12:50:40 -07:00
signal.c
smp.c
smpboot.c
smpboot.h
softirq.c softirq: Fix suspicious RCU usage in __do_softirq() 2024-04-29 05:03:51 +02:00
stackleak.c stackleak: Use a copy of the ctl_table argument 2024-05-03 12:35:12 -07:00
stacktrace.c
static_call.c
static_call_inline.c
stop_machine.c
sys.c prctl: generalize PR_SET_MDWE support check to be per-arch 2024-03-26 11:07:22 -07:00
sys_ni.c
sysctl-test.c
sysctl.c
task_work.c
taskstats.c
torture.c
tracepoint.c
tsacct.c
ucount.c
uid16.c
uid16.h
umh.c
up.c
user-return-notifier.c
user.c
user_namespace.c
usermode_driver.c
utsname.c
utsname_sysctl.c
vhost_task.c
vmcore_info.c mm: turn folio_test_hugetlb into a PageType 2024-04-24 19:34:26 -07:00
watch_queue.c
watchdog.c
watchdog_buddy.c
watchdog_perf.c
workqueue.c Scheduler changes for v6.10: 2024-05-13 17:18:51 -07:00
workqueue_internal.h