Thread (49 messages) read the whole thread 49 messages, 7 authors, 2023-11-07

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

From: Mike Rapoport <rppt@kernel.org>
Date: 2023-09-23 15:39:07
Also in: bpf, linux-arm-kernel, linux-mips, linux-mm, linux-modules, linux-riscv, linux-s390, linuxppc-dev, lkml, loongarch, netdev, sparclinux

On Thu, Sep 21, 2023 at 03:34:18PM -0700, Song Liu wrote:
On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport [off-list ref] wrote:
quoted
[...]
quoted
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?
This is an ftrace trampoline, so I think it should be FTRACE type of
allocation.
 
Thanks,
Song
quoted
        if (!start)
                return -ENOMEM;
        set_memory_rox((unsigned long)start, numpages);
[...]
-- 
Sincerely yours,
Mike.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help