riscv: extend execmem_params for generated code allocations
authorMike Rapoport (IBM) <rppt@kernel.org>
Sun, 5 May 2024 16:06:21 +0000 (19:06 +0300)
committerLuis Chamberlain <mcgrof@kernel.org>
Tue, 14 May 2024 07:31:43 +0000 (00:31 -0700)
commit4d7b321a9ce0782a953874ec69acc2b12b9cb2cd
treee8abfa527afe7d24a55eb9d6c3bee1d4e46fd511
parent223b5e57d0d50b0c07b933350dbcde92018d3080
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>
arch/riscv/include/asm/pgtable.h
arch/riscv/kernel/module.c
arch/riscv/kernel/probes/kprobes.c
arch/riscv/net/bpf_jit_core.c