riscv: Add Zcd extension support
When the Zcd extension is available expose it to the guest
via device tree so that guest can use it.
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Link: https://lore.kernel.org/r/20241005080024.11927-6-apatel@ventanamicro.com
Signed-off-by: Will Deacon <will@kernel.org>
diff --git a/riscv/fdt.c b/riscv/fdt.c
index c62d4a3..5587343 100644
--- a/riscv/fdt.c
+++ b/riscv/fdt.c
@@ -34,6 +34,7 @@
{"zbs", KVM_RISCV_ISA_EXT_ZBS},
{"zca", KVM_RISCV_ISA_EXT_ZCA},
{"zcb", KVM_RISCV_ISA_EXT_ZCB},
+ {"zcd", KVM_RISCV_ISA_EXT_ZCD},
{"zfa", KVM_RISCV_ISA_EXT_ZFA},
{"zfh", KVM_RISCV_ISA_EXT_ZFH},
{"zfhmin", KVM_RISCV_ISA_EXT_ZFHMIN},
diff --git a/riscv/include/kvm/kvm-config-arch.h b/riscv/include/kvm/kvm-config-arch.h
index 68fc47c..155faa6 100644
--- a/riscv/include/kvm/kvm-config-arch.h
+++ b/riscv/include/kvm/kvm-config-arch.h
@@ -79,6 +79,9 @@
OPT_BOOLEAN('\0', "disable-zcb", \
&(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZCB], \
"Disable Zcb Extension"), \
+ OPT_BOOLEAN('\0', "disable-zcd", \
+ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZCD], \
+ "Disable Zcd Extension"), \
OPT_BOOLEAN('\0', "disable-zfa", \
&(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZFA], \
"Disable Zfa Extension"), \