RISC-V: Detect Zicond from ISA string
authorAnup Patel <apatel@ventanamicro.com>
Fri, 15 Sep 2023 08:39:44 +0000 (14:09 +0530)
committerAnup Patel <anup@brainfault.org>
Thu, 12 Oct 2023 13:13:43 +0000 (18:43 +0530)
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>
arch/riscv/include/asm/hwcap.h
arch/riscv/kernel/cpufeature.c

index 0f520f7d058a57f16e1b3c69bd185806aa174883..6fc51c1b34cf7097b449c1893968ab473eed9e90 100644 (file)
@@ -59,6 +59,7 @@
 #define RISCV_ISA_EXT_ZIFENCEI         41
 #define RISCV_ISA_EXT_ZIHPM            42
 #define RISCV_ISA_EXT_SMSTATEEN                43
+#define RISCV_ISA_EXT_ZICOND           44
 
 #define RISCV_ISA_EXT_MAX              64
 
index 3755a8c2a9ded84748f06d12f2ed74576d45eee5..e3803822ab5a3a0ee36852cd9b08f9db8ee76fdc 100644 (file)
@@ -167,6 +167,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = {
        __RISCV_ISA_EXT_DATA(zicbom, RISCV_ISA_EXT_ZICBOM),
        __RISCV_ISA_EXT_DATA(zicboz, RISCV_ISA_EXT_ZICBOZ),
        __RISCV_ISA_EXT_DATA(zicntr, RISCV_ISA_EXT_ZICNTR),
+       __RISCV_ISA_EXT_DATA(zicond, RISCV_ISA_EXT_ZICOND),
        __RISCV_ISA_EXT_DATA(zicsr, RISCV_ISA_EXT_ZICSR),
        __RISCV_ISA_EXT_DATA(zifencei, RISCV_ISA_EXT_ZIFENCEI),
        __RISCV_ISA_EXT_DATA(zihintpause, RISCV_ISA_EXT_ZIHINTPAUSE),