Skip to content

Commit 8fe6f7e

Browse files
committed
RISC-V: Detect AIA CSRs from ISA string
We have two extension names for AIA ISA support: Smaia (M-mode AIA CSRs) and Ssaia (S-mode AIA CSRs). We extend the ISA string parsing to detect Smaia and Ssaia extensions. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Anup Patel <anup@brainfault.org> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent d6f5f6e commit 8fe6f7e

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

arch/riscv/include/asm/hwcap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#define RISCV_ISA_EXT_ZBB 30
4343
#define RISCV_ISA_EXT_ZICBOM 31
4444
#define RISCV_ISA_EXT_ZIHINTPAUSE 32
45+
#define RISCV_ISA_EXT_SMAIA 33
46+
#define RISCV_ISA_EXT_SSAIA 34
4547

4648
#define RISCV_ISA_EXT_MAX 64
4749
#define RISCV_ISA_EXT_NAME_LEN_MAX 32

arch/riscv/kernel/cpu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ static struct riscv_isa_ext_data isa_ext_arr[] = {
188188
__RISCV_ISA_EXT_DATA(zicbom, RISCV_ISA_EXT_ZICBOM),
189189
__RISCV_ISA_EXT_DATA(zihintpause, RISCV_ISA_EXT_ZIHINTPAUSE),
190190
__RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB),
191+
__RISCV_ISA_EXT_DATA(smaia, RISCV_ISA_EXT_SMAIA),
192+
__RISCV_ISA_EXT_DATA(ssaia, RISCV_ISA_EXT_SSAIA),
191193
__RISCV_ISA_EXT_DATA(sscofpmf, RISCV_ISA_EXT_SSCOFPMF),
192194
__RISCV_ISA_EXT_DATA(sstc, RISCV_ISA_EXT_SSTC),
193195
__RISCV_ISA_EXT_DATA(svinval, RISCV_ISA_EXT_SVINVAL),

arch/riscv/kernel/cpufeature.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ void __init riscv_fill_hwcap(void)
221221
}
222222
} else {
223223
/* sorted alphabetically */
224+
SET_ISA_EXT_MAP("smaia", RISCV_ISA_EXT_SMAIA);
225+
SET_ISA_EXT_MAP("ssaia", RISCV_ISA_EXT_SSAIA);
224226
SET_ISA_EXT_MAP("sscofpmf", RISCV_ISA_EXT_SSCOFPMF);
225227
SET_ISA_EXT_MAP("sstc", RISCV_ISA_EXT_SSTC);
226228
SET_ISA_EXT_MAP("svinval", RISCV_ISA_EXT_SVINVAL);

0 commit comments

Comments
 (0)