Skip to content

Commit 662a601

Browse files
committed
RISC-V: Detect Zicond from ISA string
The RISC-V integer conditional (Zicond) operation extension defines standard conditional arithmetic and conditional-select/move operations which are inspired from the XVentanaCondOps extension. In fact, QEMU RISC-V also has support for emulating Zicond extension. Let us detect Zicond extension from ISA string available through DT or ACPI. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Acked-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Anup Patel <anup@brainfault.org>
1 parent a4f5f39 commit 662a601

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

arch/riscv/include/asm/hwcap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#define RISCV_ISA_EXT_ZIFENCEI 41
6060
#define RISCV_ISA_EXT_ZIHPM 42
6161
#define RISCV_ISA_EXT_SMSTATEEN 43
62+
#define RISCV_ISA_EXT_ZICOND 44
6263

6364
#define RISCV_ISA_EXT_MAX 64
6465

arch/riscv/kernel/cpufeature.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = {
167167
__RISCV_ISA_EXT_DATA(zicbom, RISCV_ISA_EXT_ZICBOM),
168168
__RISCV_ISA_EXT_DATA(zicboz, RISCV_ISA_EXT_ZICBOZ),
169169
__RISCV_ISA_EXT_DATA(zicntr, RISCV_ISA_EXT_ZICNTR),
170+
__RISCV_ISA_EXT_DATA(zicond, RISCV_ISA_EXT_ZICOND),
170171
__RISCV_ISA_EXT_DATA(zicsr, RISCV_ISA_EXT_ZICSR),
171172
__RISCV_ISA_EXT_DATA(zifencei, RISCV_ISA_EXT_ZIFENCEI),
172173
__RISCV_ISA_EXT_DATA(zihintpause, RISCV_ISA_EXT_ZIHINTPAUSE),

0 commit comments

Comments
 (0)