diff options
author | Anup Patel <apatel@ventanamicro.com> | 2023-11-28 20:26:25 +0530 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2024-02-09 15:45:22 +0000 |
commit | 8d02d5a895c30d679d2ec0f235a98ee324972cef (patch) | |
tree | 2bd2de10d78e9cbb3328bb2668056d0d70ce90f7 | |
parent | 3436684940bc4359d5aed6c28992f5af91448929 (diff) | |
download | kvmtool-8d02d5a895c30d679d2ec0f235a98ee324972cef.tar.gz |
riscv: Add Smstateen extension support
When the Smstateen 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/20231128145628.413414-8-apatel@ventanamicro.com
Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r-- | riscv/fdt.c | 1 | ||||
-rw-r--r-- | riscv/include/kvm/kvm-config-arch.h | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/riscv/fdt.c b/riscv/fdt.c index a4d54eb0..0fe0f0ba 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 */ + {"smstateen", KVM_RISCV_ISA_EXT_SMSTATEEN}, {"ssaia", KVM_RISCV_ISA_EXT_SSAIA}, {"sstc", KVM_RISCV_ISA_EXT_SSTC}, {"svinval", KVM_RISCV_ISA_EXT_SVINVAL}, diff --git a/riscv/include/kvm/kvm-config-arch.h b/riscv/include/kvm/kvm-config-arch.h index c5247710..49eb3e68 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-smstateen", \ + &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_SMSTATEEN], \ + "Disable Smstateen Extension"), \ OPT_BOOLEAN('\0', "disable-ssaia", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_SSAIA], \ "Disable Ssaia Extension"), \ |