Thread (49 messages) 49 messages, 7 authors, 2023-11-07

Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free()

From: Song Liu <song@kernel.org>
Date: 2023-09-21 22:34:50
Also in: bpf, linux-arm-kernel, linux-mips, linux-mm, linux-modules, linux-riscv, linux-s390, linux-trace-kernel, linuxppc-dev, lkml, loongarch, sparclinux

On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport [off-list ref] wrote:
[...]
quoted hunk ↗ jump to hunk
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c
index 42215f9404af..db5561d0c233 100644
--- a/arch/s390/kernel/module.c
+++ b/arch/s390/kernel/module.c
@@ -21,6 +21,7 @@
 #include <linux/moduleloader.h>
 #include <linux/bug.h>
 #include <linux/memory.h>
+#include <linux/execmem.h>
 #include <asm/alternative.h>
 #include <asm/nospec-branch.h>
 #include <asm/facility.h>
@@ -76,7 +77,7 @@ void *module_alloc(unsigned long size)
 #ifdef CONFIG_FUNCTION_TRACER
 void module_arch_cleanup(struct module *mod)
 {
-       module_memfree(mod->arch.trampolines_start);
+       execmem_free(mod->arch.trampolines_start);
 }
 #endif
@@ -510,7 +511,7 @@ static int module_alloc_ftrace_hotpatch_trampolines(struct module *me,

        size = FTRACE_HOTPATCH_TRAMPOLINES_SIZE(s->sh_size);
        numpages = DIV_ROUND_UP(size, PAGE_SIZE);
-       start = module_alloc(numpages * PAGE_SIZE);
+       start = execmem_text_alloc(EXECMEM_FTRACE, numpages * PAGE_SIZE);
This should be EXECMEM_MODULE_TEXT?

Thanks,
Song
        if (!start)
                return -ENOMEM;
        set_memory_rox((unsigned long)start, numpages);
[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help