riscv: Support CONFIG_RELOCATABLE on NOMMU
authorSamuel Holland <samuel.holland@sifive.com>
Sat, 26 Oct 2024 17:13:55 +0000 (10:13 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 26 Mar 2025 22:56:41 +0000 (15:56 -0700)
commit51b766c79a3d741fb97419c3da1c58fce5e66f0e
tree33fb224b9a2669987f69ffd893d89431372c0947
parent2c0391b29b27f315c1b4c29ffde66f50b29fab99
riscv: Support CONFIG_RELOCATABLE on NOMMU

Move relocate_kernel() out of the CONFIG_MMU block so it can be called
from the NOMMU version of setup_vm(). Set some offsets in kernel_map so
relocate_kernel() does not need to be modified. Relocatable NOMMU
kernels can be loaded to any physical memory address; they no longer
depend on CONFIG_PAGE_OFFSET.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Link: https://lore.kernel.org/r/20241026171441.3047904-4-samuel.holland@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/Kconfig
arch/riscv/include/asm/pgtable.h
arch/riscv/mm/init.c