aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/kernel
diff options
context:
space:
mode:
authorGravatar Mike Rapoport (IBM) <rppt@kernel.org> 2024-05-05 19:06:24 +0300
committerGravatar Luis Chamberlain <mcgrof@kernel.org> 2024-05-14 00:31:44 -0700
commit0cc2dc4902f425e346d46deeea2352d9fba75375 (patch)
tree8e3b6c6800e6144849984089fa01267f647f1014 /arch/riscv/kernel
parentpowerpc: extend execmem_params for kprobes allocations (diff)
downloadlinux-0cc2dc4902f425e346d46deeea2352d9fba75375.tar.gz
linux-0cc2dc4902f425e346d46deeea2352d9fba75375.tar.bz2
linux-0cc2dc4902f425e346d46deeea2352d9fba75375.zip
arch: make execmem setup available regardless of CONFIG_MODULES
execmem does not depend on modules, on the contrary modules use execmem. To make execmem available when CONFIG_MODULES=n, for instance for kprobes, split execmem_params initialization out from arch/*/kernel/module.c and compile it when CONFIG_EXECMEM=y Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'arch/riscv/kernel')
-rw-r--r--arch/riscv/kernel/module.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c
index 0e6415f00fca..906f9a3a5d65 100644
--- a/arch/riscv/kernel/module.c
+++ b/arch/riscv/kernel/module.c
@@ -11,10 +11,8 @@
#include <linux/kernel.h>
#include <linux/log2.h>
#include <linux/moduleloader.h>
-#include <linux/vmalloc.h>
#include <linux/sizes.h>
#include <linux/pgtable.h>
-#include <linux/execmem.h>
#include <asm/alternative.h>
#include <asm/sections.h>
@@ -906,38 +904,6 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
return 0;
}
-#ifdef CONFIG_MMU
-static struct execmem_info execmem_info __ro_after_init;
-
-struct execmem_info __init *execmem_arch_setup(void)
-{
- execmem_info = (struct execmem_info){
- .ranges = {
- [EXECMEM_DEFAULT] = {
- .start = MODULES_VADDR,
- .end = MODULES_END,
- .pgprot = PAGE_KERNEL,
- .alignment = 1,
- },
- [EXECMEM_KPROBES] = {
- .start = VMALLOC_START,
- .end = VMALLOC_END,
- .pgprot = PAGE_KERNEL_READ_EXEC,
- .alignment = 1,
- },
- [EXECMEM_BPF] = {
- .start = BPF_JIT_REGION_START,
- .end = BPF_JIT_REGION_END,
- .pgprot = PAGE_KERNEL,
- .alignment = PAGE_SIZE,
- },
- },
- };
-
- return &execmem_info;
-}
-#endif
-
int module_finalize(const Elf_Ehdr *hdr,
const Elf_Shdr *sechdrs,
struct module *me)