summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/module.c
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@csgroup.eu>2020-06-29 13:15:21 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2020-07-26 16:01:30 +0200
commit7fbc22ce29931630da200cfc90fe5a454f54a794 (patch)
tree3949593c0bffa5ec555c467fe0d73068610e37bc /arch/powerpc/kernel/module.c
parentpowerpc/lib: Prepare code-patching for modules allocated outside vmalloc space (diff)
downloadlinux-7fbc22ce29931630da200cfc90fe5a454f54a794.tar.xz
linux-7fbc22ce29931630da200cfc90fe5a454f54a794.zip
powerpc: Use MODULES_VADDR if defined
In order to allow allocation of modules outside of vmalloc space, use MODULES_VADDR and MODULES_END when MODULES_VADDR is defined. Redefine module_alloc() when MODULES_VADDR defined. Unmap corresponding KASAN shadow memory. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/7ecf5fff1eef67d450e73fc412b6ec3818483d75.1593428200.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/kernel/module.c')
-rw-r--r--arch/powerpc/kernel/module.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c
index df649acb5631..a211b0253cdb 100644
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel/module.c
@@ -86,3 +86,14 @@ int module_finalize(const Elf_Ehdr *hdr,
return 0;
}
+
+#ifdef MODULES_VADDR
+void *module_alloc(unsigned long size)
+{
+ BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR);
+
+ return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, GFP_KERNEL,
+ PAGE_KERNEL_EXEC, VM_FLUSH_RESET_PERMS, NUMA_NO_NODE,
+ __builtin_return_address(0));
+}
+#endif