aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/net
diff options
context:
space:
mode:
authorGravatar Mike Rapoport (IBM) <rppt@kernel.org> 2024-05-05 19:06:21 +0300
committerGravatar Luis Chamberlain <mcgrof@kernel.org> 2024-05-14 00:31:43 -0700
commit4d7b321a9ce0782a953874ec69acc2b12b9cb2cd (patch)
treee8abfa527afe7d24a55eb9d6c3bee1d4e46fd511 /arch/riscv/net
parentmm/execmem, arch: convert remaining overrides of module_alloc to execmem (diff)
downloadlinux-4d7b321a9ce0782a953874ec69acc2b12b9cb2cd.tar.gz
linux-4d7b321a9ce0782a953874ec69acc2b12b9cb2cd.tar.bz2
linux-4d7b321a9ce0782a953874ec69acc2b12b9cb2cd.zip
riscv: extend execmem_params for generated code allocations
The memory allocations for kprobes and BPF on RISC-V are not placed in the modules area and these custom allocations are implemented with overrides of alloc_insn_page() and bpf_jit_alloc_exec(). Define MODULES_VADDR and MODULES_END as VMALLOC_START and VMALLOC_END for 32 bit and slightly reorder execmem_params initialization to support both 32 and 64 bit variants, define EXECMEM_KPROBES and EXECMEM_BPF ranges in riscv::execmem_params and drop overrides of alloc_insn_page() and bpf_jit_alloc_exec(). Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'arch/riscv/net')
-rw-r--r--arch/riscv/net/bpf_jit_core.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/arch/riscv/net/bpf_jit_core.c b/arch/riscv/net/bpf_jit_core.c
index 6b3acac30c06..e238fdbd5dbc 100644
--- a/arch/riscv/net/bpf_jit_core.c
+++ b/arch/riscv/net/bpf_jit_core.c
@@ -219,19 +219,6 @@ u64 bpf_jit_alloc_exec_limit(void)
return BPF_JIT_REGION_SIZE;
}
-void *bpf_jit_alloc_exec(unsigned long size)
-{
- return __vmalloc_node_range(size, PAGE_SIZE, BPF_JIT_REGION_START,
- BPF_JIT_REGION_END, GFP_KERNEL,
- PAGE_KERNEL, 0, NUMA_NO_NODE,
- __builtin_return_address(0));
-}
-
-void bpf_jit_free_exec(void *addr)
-{
- return vfree(addr);
-}
-
void *bpf_arch_text_copy(void *dst, void *src, size_t len)
{
int ret;