diff options
| author | Samuel Holland <samuel.holland@sifive.com> | 2024-10-26 10:13:55 -0700 |
|---|---|---|
| committer | Palmer Dabbelt <palmer@rivosinc.com> | 2025-03-26 15:56:41 -0700 |
| commit | 51b766c79a3d741fb97419c3da1c58fce5e66f0e (patch) | |
| tree | 33fb224b9a2669987f69ffd893d89431372c0947 /arch/riscv/include/asm/pgtable.h | |
| parent | 2c0391b29b27f315c1b4c29ffde66f50b29fab99 (diff) | |
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>
Diffstat (limited to 'arch/riscv/include/asm/pgtable.h')
| -rw-r--r-- | arch/riscv/include/asm/pgtable.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index eb7b25ef556e..babd951222db 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -12,7 +12,11 @@ #include <asm/pgtable-bits.h> #ifndef CONFIG_MMU +#ifdef CONFIG_RELOCATABLE +#define KERNEL_LINK_ADDR UL(0) +#else #define KERNEL_LINK_ADDR _AC(CONFIG_PAGE_OFFSET, UL) +#endif #define KERN_VIRT_SIZE (UL(-1)) #else |
