[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251210-profiles-v1-9-315a6ff2ca5a@gmail.com>
Date: Wed, 10 Dec 2025 08:13:46 -0800
From: Charlie Jenkins <charlie@...osinc.com>
To: Paul Walmsley <pjw@...nel.org>, Palmer Dabbelt <palmer@...belt.com>,
Alexandre Ghiti <alex@...ti.fr>, Anup Patel <anup@...infault.org>,
Atish Patra <atish.patra@...ux.dev>,
Samuel Holland <samuel.holland@...ive.com>,
Björn Töpel <bjorn@...nel.org>,
Luke Nelson <luke.r.nels@...il.com>, Xi Wang <xi.wang@...il.com>,
Eric Biggers <ebiggers@...nel.org>, Conor Dooley <conor@...nel.org>
Cc: linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
Charlie Jenkins <thecharlesjenkins@...il.com>
Subject: [PATCH RFC 09/10] riscv: kconfig: Add rva23 config
Add CONFIG_RISCV_ISA_RVA23 to select all rva23 mandatory extensions.
This also introduces a new class of kernel binaries, portable rva23
compatible binaries. This option does not require NONPORTABLE because
profiles are expected to be portable between systems.
Signed-off-by: Charlie Jenkins <thecharlesjenkins@...il.com>
---
arch/riscv/Kconfig.extensions | 99 ++++++++++++++++++++++++++++++-------------
1 file changed, 70 insertions(+), 29 deletions(-)
diff --git a/arch/riscv/Kconfig.extensions b/arch/riscv/Kconfig.extensions
index e400fd5574f7..38b655e480a8 100644
--- a/arch/riscv/Kconfig.extensions
+++ b/arch/riscv/Kconfig.extensions
@@ -4,6 +4,33 @@
# see Documentation/kbuild/kconfig-language.rst.
#
+# Profiles
+
+config RISCV_ISA_RVA23
+ bool "Enable rva23 extensions"
+ default n
+ select RISCV_ISA_SUPM
+ select RISCV_ISA_SVNAPOT
+ select RISCV_ISA_SVPBMT
+ select RISCV_ISA_ZAWRS
+ select RISCV_ISA_ZBA
+ select RISCV_ISA_ZBB
+ select RISCV_ISA_ZBC
+ select RISCV_ISA_ZBKB
+ select RISCV_ISA_ZICBOM
+ select RISCV_ISA_ZICBOZ
+ select RISCV_ISA_ZICBOP
+ select RISCV_ISA_V
+ help
+ The RVA23 profile is a grouping of extensions that are expected to be
+ available on server and application CPUs.
+
+ Enabling this config will cause the kernel to fail to boot on platforms
+ that are not rva23 compliant.
+
+ Say "y" here to optimize the kernel for rva23 compliant platforms.
+
+ If you don't know what to do here, say "n".
# Base extensions
@@ -64,7 +91,7 @@ config RISCV_ISA_D
config RISCV_ISA_SUPM
tristate "Supm extension for userspace pointer masking"
depends on 64BIT
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
help
Add support for pointer masking in userspace (Supm) when the
@@ -75,14 +102,15 @@ config RISCV_ISA_SUPM
Select "m" for boot-time detection for portability.
- Select "y" for compile-time optimization. Only available with NONPORTABLE.
+ Select "y" for compile-time optimization. Only available with NONPORTABLE
+ or CONFIG_RISCV_ISA_RVA23.
If you don't know what to do here, say m.
config RISCV_ISA_SVNAPOT
tristate "Svnapot extension support for supervisor mode NAPOT pages"
depends on 64BIT && MMU
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
help
The Svnapot extension is used to mark contiguous PTEs as a range
@@ -95,14 +123,15 @@ config RISCV_ISA_SVNAPOT
Select "m" for boot-time detection for portability.
- Select "y" for compile-time optimization. Only available with NONPORTABLE.
+ Select "y" for compile-time optimization. Only available with NONPORTABLE
+ or CONFIG_RISCV_ISA_RVA23.
If you don't know what to do here, say m.
config RISCV_ISA_SVPBMT
tristate "Svpbmt extension support for supervisor mode page-based memory types"
depends on 64BIT && MMU
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
help
The memory type for a page contains a combination of attributes
@@ -113,14 +142,15 @@ config RISCV_ISA_SVPBMT
Select "m" for boot-time detection for portability.
- Select "y" for compile-time optimization. Only available with NONPORTABLE.
+ Select "y" for compile-time optimization. Only available with NONPORTABLE
+ or CONFIG_RISCV_ISA_RVA23.
If you don't know what to do here, say m.
config RISCV_ISA_ZAWRS
tristate "Zawrs extension support for more efficient busy waiting"
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
help
The Zawrs extension defines instructions to be used in polling loops
@@ -139,7 +169,7 @@ config TOOLCHAIN_HAS_ZABHA
config RISCV_ISA_ZABHA
tristate "Zabha extension support for atomic byte/halfword operations"
depends on TOOLCHAIN_HAS_ZABHA
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
help
Enable the use of the Zabha ISA-extension to implement kernel
@@ -147,7 +177,8 @@ config RISCV_ISA_ZABHA
Select "m" for boot-time detection for portability.
- Select "y" for compile-time optimization. Only available with NONPORTABLE.
+ Select "y" for compile-time optimization. Only available with NONPORTABLE
+ or CONFIG_RISCV_ISA_RVA23.
If you don't know what to do here, say m.
@@ -161,7 +192,7 @@ config TOOLCHAIN_HAS_ZACAS
config RISCV_ISA_ZACAS
tristate "Zacas extension support for atomic CAS"
depends on TOOLCHAIN_HAS_ZACAS
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
help
Enable the use of the Zacas ISA-extension to implement kernel atomic
@@ -169,7 +200,8 @@ config RISCV_ISA_ZACAS
Select "m" for boot-time detection for portability.
- Select "y" for compile-time optimization. Only available with NONPORTABLE.
+ Select "y" for compile-time optimization. Only available with NONPORTABLE
+ or CONFIG_RISCV_ISA_RVA23.
If you don't know what to do here, say m.
@@ -183,7 +215,7 @@ config TOOLCHAIN_HAS_ZBA
config RISCV_ISA_ZBA
tristate "Zba extension support for bit manipulation instructions"
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
help
The Zba extension provides instructions to accelerate the generation
@@ -191,7 +223,8 @@ config RISCV_ISA_ZBA
Select "m" for boot-time detection for portability.
- Select "y" for compile-time detection for optimization. Only available with NONPORTABLE.
+ Select "y" for compile-time detection for optimization. Only available with NONPORTABLE
+ or CONFIG_RISCV_ISA_RVA23.
If you don't know what to do here, say m.
@@ -205,7 +238,7 @@ config TOOLCHAIN_HAS_ZBB
config RISCV_ISA_ZBB
tristate "Zbb extension support for bit manipulation instructions"
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
help
The Zbb extension provides instructions to accelerate a number
@@ -214,7 +247,8 @@ config RISCV_ISA_ZBB
Select "m" for boot-time detection for portability.
- Select "y" for compile-time optimization. Only available with NONPORTABLE.
+ Select "y" for compile-time optimization. Only available with NONPORTABLE
+ or CONFIG_RISCV_ISA_RVA23.
If you don't know what to do here, say m.
@@ -228,7 +262,7 @@ config TOOLCHAIN_HAS_ZBC
config RISCV_ISA_ZBC
tristate "Zbc extension support for carry-less multiplication instructions"
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
help
The Zbc extension could accelerate CRC (cyclic redundancy check)
@@ -236,7 +270,8 @@ config RISCV_ISA_ZBC
Select "m" for boot-time detection for portability.
- Select "y" for compile-time detection for optimization. Only available with NONPORTABLE.
+ Select "y" for compile-time detection for optimization. Only available with NONPORTABLE
+ or CONFIG_RISCV_ISA_RVA23.
If you don't know what to do here, say m.
@@ -250,7 +285,7 @@ config TOOLCHAIN_HAS_ZBKB
config RISCV_ISA_ZBKB
tristate "Zbkb extension support for bit manipulation instructions"
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
help
The Zbkb extension provides instructions to accelerate a number
@@ -258,14 +293,15 @@ config RISCV_ISA_ZBKB
Select "m" for boot-time detection for portability.
- Select "y" for compile-time detection for optimization. Only available with NONPORTABLE.
+ Select "y" for compile-time detection for optimization. Only available with NONPORTABLE
+ or CONFIG_RISCV_ISA_RVA23.
If you don't know what to do here, say m.
config RISCV_ISA_ZICBOM
bool "Zicbom extension support for non-coherent DMA operation"
depends on MMU
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
select RISCV_DMA_NONCOHERENT
select DMA_DIRECT_REMAP
@@ -275,13 +311,14 @@ config RISCV_ISA_ZICBOM
Select "m" for boot-time detection for portability.
- Select "y" for compile-time optimization. Only available with NONPORTABLE.
+ Select "y" for compile-time optimization. Only available with NONPORTABLE
+ or CONFIG_RISCV_ISA_RVA23.
If you don't know what to do here, say m.
config RISCV_ISA_ZICBOZ
bool "Zicboz extension support for faster zeroing of memory"
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
help
Enable the use of the Zicboz extension (cbo.zero instruction)
@@ -291,14 +328,15 @@ config RISCV_ISA_ZICBOZ
Select "m" for boot-time detection for portability.
- Select "y" for compile-time detection for optimization. Only available with NONPORTABLE.
+ Select "y" for compile-time detection for optimization. Only available with NONPORTABLE
+ or CONFIG_RISCV_ISA_RVA23.
If you don't know what to do here, say m.
config RISCV_ISA_ZICBOP
bool "Zicbop extension support for cache block prefetch"
depends on MMU
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
help
The Zicbop extension can be used to prefetch cache blocks for
@@ -306,7 +344,8 @@ config RISCV_ISA_ZICBOP
Select "m" for boot-time detection for portability.
- Select "y" for compile-time detection for optimization. Only available with NONPORTABLE.
+ Select "y" for compile-time detection for optimization. Only available with NONPORTABLE
+ or CONFIG_RISCV_ISA_RVA23.
If you don't know what to do here, say m.
@@ -348,7 +387,7 @@ config RISCV_ISA_V
depends on FPU
select DYNAMIC_SIGFRAME
select RISCV_ISA_ZVE32X
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
help
Say N here if you want to disable all vector related procedure
@@ -356,20 +395,22 @@ config RISCV_ISA_V
Select "m" for boot-time detection for portability.
- Select "y" for compile-time detection for optimization. Only available with NONPORTABLE.
+ Select "y" for compile-time detection for optimization. Only available with NONPORTABLE
+ or CONFIG_RISCV_ISA_RVA23.
If you don't know what to do here, say m.
config RISCV_ISA_ZVE32X
tristate "zve32x extension support"
- depends on NONPORTABLE || m
+ depends on NONPORTABLE || RISCV_ISA_RVA23 || m
default m
help
zve23x is a subset of the vector extension. Can be enabled for minimal vector support.
Select "m" for boot-time detection for portability.
- Select "y" for compile-time detection for optimization. Only available with NONPORTABLE.
+ Select "y" for compile-time detection for optimization. Only available with NONPORTABLE
+ or CONFIG_RISCV_ISA_RVA23.
If you don't know what to do here, say m.
--
2.43.0
Powered by blists - more mailing lists