diff mbox series

[kvmtool,05/10] riscv: Add Zicntr and Zihpm extension support

Message ID 20231128145628.413414-6-apatel@ventanamicro.com (mailing list archive)
State New, archived
Headers show
Series SBI debug console and few ISA extensions | expand

Commit Message

Anup Patel Nov. 28, 2023, 2:56 p.m. UTC
When the Zicntr and Zihpm 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>
---
 riscv/fdt.c                         | 2 ++
 riscv/include/kvm/kvm-config-arch.h | 6 ++++++
 2 files changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/riscv/fdt.c b/riscv/fdt.c
index cfe4678..19786af 100644
--- a/riscv/fdt.c
+++ b/riscv/fdt.c
@@ -26,7 +26,9 @@  struct isa_ext_info isa_info_arr[] = {
 	{"zbs", KVM_RISCV_ISA_EXT_ZBS},
 	{"zicbom", KVM_RISCV_ISA_EXT_ZICBOM},
 	{"zicboz", KVM_RISCV_ISA_EXT_ZICBOZ},
+	{"zicntr", KVM_RISCV_ISA_EXT_ZICNTR},
 	{"zihintpause", KVM_RISCV_ISA_EXT_ZIHINTPAUSE},
+	{"zihpm", KVM_RISCV_ISA_EXT_ZIHPM},
 };
 
 static void dump_fdt(const char *dtb_file, void *fdt)
diff --git a/riscv/include/kvm/kvm-config-arch.h b/riscv/include/kvm/kvm-config-arch.h
index 978037a..af5c4b8 100644
--- a/riscv/include/kvm/kvm-config-arch.h
+++ b/riscv/include/kvm/kvm-config-arch.h
@@ -55,9 +55,15 @@  struct kvm_config_arch {
 	OPT_BOOLEAN('\0', "disable-zicboz",				\
 		    &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZICBOZ],	\
 		    "Disable Zicboz Extension"),			\
+	OPT_BOOLEAN('\0', "disable-zicntr",				\
+		    &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZICNTR],	\
+		    "Disable Zicntr Extension"),			\
 	OPT_BOOLEAN('\0', "disable-zihintpause",			\
 		    &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZIHINTPAUSE],\
 		    "Disable Zihintpause Extension"),			\
+	OPT_BOOLEAN('\0', "disable-zihpm",				\
+		    &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZIHPM],	\
+		    "Disable Zihpm Extension"),				\
 	OPT_BOOLEAN('\0', "disable-sbi-legacy",				\
 		    &(cfg)->sbi_ext_disabled[KVM_RISCV_SBI_EXT_V01],	\
 		    "Disable SBI Legacy Extensions"),			\