[RFC,V1,11/11] riscv: Introduce 64K page size
Commit Message
This patch introduces new config to control whether enabling the 64K
base page feature on RISC-V.
Signed-off-by: Xu Lu <luxu.kernel@bytedance.com>
---
arch/Kconfig | 1 +
arch/riscv/Kconfig | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
@@ -1087,6 +1087,7 @@ config HAVE_ARCH_COMPAT_MMAP_BASES
config PAGE_SIZE_LESS_THAN_64KB
def_bool y
+ depends on !RISCV_64K_PAGES
depends on !ARM64_64K_PAGES
depends on !PAGE_SIZE_64KB
depends on !PARISC_PAGE_SIZE_64KB
@@ -227,6 +227,7 @@ config RISCV_HW_PAGE_SHIFT
config RISCV_PAGE_SHIFT
int
+ default 16 if RISCV_64K_PAGES
default 12
config KASAN_SHADOW_OFFSET
@@ -692,6 +693,25 @@ config RISCV_BOOT_SPINWAIT
If unsure what to do here, say N.
+choice
+ prompt "Page size"
+ default RISCV_4K_PAGES
+ help
+ Page size (translation granule) configuration.
+
+config RISCV_4K_PAGES
+ bool "4KB"
+ help
+ This feature enables 4KB pages support.
+
+config RISCV_64K_PAGES
+ bool "64KB"
+ depends on ARCH_HAS_STRICT_KERNEL_RWX && 64BIT
+ help
+ This feature enables 64KB pages support (4KB by default)
+
+endchoice
+
config ARCH_SUPPORTS_KEXEC
def_bool MMU