Skip to content

Commit c6699ba

Browse files
evangreenpalmer-dabbelt
authored andcommitted
RISC-V: Add Zba, Zbs extension probing
Add the Zba address bit manipulation extension and Zbs single bit instructions extension into those the kernel is aware of and maintains in its riscv_isa bitmap. Signed-off-by: Evan Green <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Palmer Dabbelt <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent ac9a786 commit c6699ba

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

arch/riscv/include/asm/hwcap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
#define RISCV_ISA_EXT_ZICBOZ 34
4747
#define RISCV_ISA_EXT_SMAIA 35
4848
#define RISCV_ISA_EXT_SSAIA 36
49+
#define RISCV_ISA_EXT_ZBA 37
50+
#define RISCV_ISA_EXT_ZBS 38
4951

5052
#define RISCV_ISA_EXT_MAX 64
5153
#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
@@ -184,7 +184,9 @@ static struct riscv_isa_ext_data isa_ext_arr[] = {
184184
__RISCV_ISA_EXT_DATA(zicbom, RISCV_ISA_EXT_ZICBOM),
185185
__RISCV_ISA_EXT_DATA(zicboz, RISCV_ISA_EXT_ZICBOZ),
186186
__RISCV_ISA_EXT_DATA(zihintpause, RISCV_ISA_EXT_ZIHINTPAUSE),
187+
__RISCV_ISA_EXT_DATA(zba, RISCV_ISA_EXT_ZBA),
187188
__RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB),
189+
__RISCV_ISA_EXT_DATA(zbs, RISCV_ISA_EXT_ZBS),
188190
__RISCV_ISA_EXT_DATA(smaia, RISCV_ISA_EXT_SMAIA),
189191
__RISCV_ISA_EXT_DATA(ssaia, RISCV_ISA_EXT_SSAIA),
190192
__RISCV_ISA_EXT_DATA(sscofpmf, RISCV_ISA_EXT_SSCOFPMF),

arch/riscv/kernel/cpufeature.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ void __init riscv_fill_hwcap(void)
236236
SET_ISA_EXT_MAP("svinval", RISCV_ISA_EXT_SVINVAL);
237237
SET_ISA_EXT_MAP("svnapot", RISCV_ISA_EXT_SVNAPOT);
238238
SET_ISA_EXT_MAP("svpbmt", RISCV_ISA_EXT_SVPBMT);
239+
SET_ISA_EXT_MAP("zba", RISCV_ISA_EXT_ZBA);
239240
SET_ISA_EXT_MAP("zbb", RISCV_ISA_EXT_ZBB);
241+
SET_ISA_EXT_MAP("zbs", RISCV_ISA_EXT_ZBS);
240242
SET_ISA_EXT_MAP("zicbom", RISCV_ISA_EXT_ZICBOM);
241243
SET_ISA_EXT_MAP("zicboz", RISCV_ISA_EXT_ZICBOZ);
242244
SET_ISA_EXT_MAP("zihintpause", RISCV_ISA_EXT_ZIHINTPAUSE);

0 commit comments

Comments
 (0)