]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
riscv: Remove CONFIG_PAGE_OFFSET
authorSamuel Holland <samuel.holland@sifive.com>
Sat, 26 Oct 2024 17:13:58 +0000 (10:13 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 26 Mar 2025 22:56:46 +0000 (15:56 -0700)
commite1cf2d009b00fd890dbbcb8b79613ff538732559
tree8e1a2a9d38d27ab5fe96ea4cc42d106bfb1b8e5f
parentea2bde36a46d5724c1b44d80cc9fafbd73c2ecf9
riscv: Remove CONFIG_PAGE_OFFSET

The current definition of CONFIG_PAGE_OFFSET is problematic for a couple
of reasons:
 1) The value is misleading for normal 64-bit kernels, where it is
    overridden at runtime if Sv48 or Sv39 is chosen. This is especially
    the case for XIP kernels, which always use Sv39.
 2) The option is not user-visible, but for NOMMU kernels it must be a
    valid RAM address, and for !RELOCATABLE it must additionally be the
    exact address where the kernel is loaded.

Fix both of these by removing the option.
 1) For MMU kernels, drop the indirection through Kconfig. Additionally,
    for XIP, drop the indirection through kernel_map.
 2) For NOMMU kernels, use the user-visible physical RAM base if
    provided. Otherwise, force the kernel to be relocatable.

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