diff mbox series

[kvmtool,5/6] riscv: Add Smnpm extension support

Message ID 20250127132424.339957-6-apatel@ventanamicro.com (mailing list archive)
State New
Headers show
Series Add RISC-V ISA extensions based on Linux-6.13 | expand

Commit Message

Anup Patel Jan. 27, 2025, 1:24 p.m. UTC
When the Smnpm 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                         | 1 +
 riscv/include/kvm/kvm-config-arch.h | 3 +++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/riscv/fdt.c b/riscv/fdt.c
index 7f774f8..4c9dbc1 100644
--- a/riscv/fdt.c
+++ b/riscv/fdt.c
@@ -16,6 +16,7 @@  struct isa_ext_info {
 
 struct isa_ext_info isa_info_arr[] = {
 	/* sorted alphabetically */
+	{"smnpm", KVM_RISCV_ISA_EXT_SMNPM},
 	{"smstateen", KVM_RISCV_ISA_EXT_SMSTATEEN},
 	{"ssaia", KVM_RISCV_ISA_EXT_SSAIA},
 	{"sscofpmf", KVM_RISCV_ISA_EXT_SSCOFPMF},
diff --git a/riscv/include/kvm/kvm-config-arch.h b/riscv/include/kvm/kvm-config-arch.h
index e3eeb84..5eccdd0 100644
--- a/riscv/include/kvm/kvm-config-arch.h
+++ b/riscv/include/kvm/kvm-config-arch.h
@@ -25,6 +25,9 @@  struct kvm_config_arch {
 	OPT_U64('\0', "custom-mimpid",					\
 		&(cfg)->custom_mimpid,					\
 		"Show custom mimpid to Guest VCPU"),			\
+	OPT_BOOLEAN('\0', "disable-smnpm",				\
+		    &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_SMNPM],	\
+		    "Disable Smnpm Extension"),				\
 	OPT_BOOLEAN('\0', "disable-smstateen",				\
 		    &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_SMSTATEEN],	\
 		    "Disable Smstateen Extension"),			\