Skip to content

Commit 9dbaf38

Browse files
mdchitaleavpatel
authored andcommitted
RISC-V: Detect Smstateen extension
Extend the ISA string parsing to detect the Smstateen extension. If the extension is enabled then access to certain 'state' such as AIA CSRs in VS mode is controlled by *stateen0 registers. Signed-off-by: Mayuresh Chitale <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Signed-off-by: Anup Patel <[email protected]>
1 parent 94f6f05 commit 9dbaf38

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

arch/riscv/include/asm/hwcap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#define RISCV_ISA_EXT_ZICSR 40
5959
#define RISCV_ISA_EXT_ZIFENCEI 41
6060
#define RISCV_ISA_EXT_ZIHPM 42
61+
#define RISCV_ISA_EXT_SMSTATEEN 43
6162

6263
#define RISCV_ISA_EXT_MAX 64
6364

arch/riscv/kernel/cpufeature.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = {
175175
__RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB),
176176
__RISCV_ISA_EXT_DATA(zbs, RISCV_ISA_EXT_ZBS),
177177
__RISCV_ISA_EXT_DATA(smaia, RISCV_ISA_EXT_SMAIA),
178+
__RISCV_ISA_EXT_DATA(smstateen, RISCV_ISA_EXT_SMSTATEEN),
178179
__RISCV_ISA_EXT_DATA(ssaia, RISCV_ISA_EXT_SSAIA),
179180
__RISCV_ISA_EXT_DATA(sscofpmf, RISCV_ISA_EXT_SSCOFPMF),
180181
__RISCV_ISA_EXT_DATA(sstc, RISCV_ISA_EXT_SSTC),

0 commit comments

Comments
 (0)