lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231123065708.91345-12-luxu.kernel@bytedance.com>
Date:   Thu, 23 Nov 2023 14:57:08 +0800
From:   Xu Lu <luxu.kernel@...edance.com>
To:     paul.walmsley@...ive.com, palmer@...belt.com,
        aou@...s.berkeley.edu, ardb@...nel.org, anup@...infault.org,
        atishp@...shpatra.org
Cc:     dengliang.1214@...edance.com, xieyongji@...edance.com,
        lihangjing@...edance.com, songmuchun@...edance.com,
        punit.agrawal@...edance.com, linux-kernel@...r.kernel.org,
        linux-riscv@...ts.infradead.org, Xu Lu <luxu.kernel@...edance.com>
Subject: [RFC PATCH V1 11/11] riscv: Introduce 64K page size

This patch introduces new config to control whether enabling the 64K
base page feature on RISC-V.

Signed-off-by: Xu Lu <luxu.kernel@...edance.com>
---
 arch/Kconfig       |  1 +
 arch/riscv/Kconfig | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

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
 
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ