diff mbox series

[RFC,V1,11/11] riscv: Introduce 64K page size

Message ID 20231123065708.91345-12-luxu.kernel@bytedance.com (mailing list archive)
State RFC
Headers show
Series riscv: Introduce 64K base page | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR fail PR summary
conchuod/patch-11-test-1 fail .github/scripts/patches/build_rv32_defconfig.sh
conchuod/patch-11-test-2 success .github/scripts/patches/build_rv64_clang_allmodconfig.sh
conchuod/patch-11-test-3 success .github/scripts/patches/build_rv64_gcc_allmodconfig.sh
conchuod/patch-11-test-4 success .github/scripts/patches/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-11-test-5 success .github/scripts/patches/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-11-test-6 warning .github/scripts/patches/checkpatch.sh
conchuod/patch-11-test-7 success .github/scripts/patches/dtb_warn_rv64.sh
conchuod/patch-11-test-8 success .github/scripts/patches/header_inline.sh
conchuod/patch-11-test-9 success .github/scripts/patches/kdoc.sh
conchuod/patch-11-test-10 success .github/scripts/patches/module_param.sh
conchuod/patch-11-test-11 success .github/scripts/patches/verify_fixes.sh
conchuod/patch-11-test-12 success .github/scripts/patches/verify_signedoff.sh

Commit Message

Xu Lu Nov. 23, 2023, 6:57 a.m. UTC
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(+)
diff mbox series

Patch

diff --git a/arch/Kconfig b/arch/Kconfig
index f4b210ab0612..66f64450d409 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -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
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 105cbb3ca797..d561f9f7f9b4 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -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