summaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/kvm_host.h
diff options
context:
space:
mode:
authorMayuresh Chitale <mchitale@ventanamicro.com>2023-09-13 19:39:01 +0300
committerAnup Patel <anup@brainfault.org>2023-10-12 16:14:02 +0300
commitfe0bab701e3b71a1d2db123c05b4f5c33098cc96 (patch)
tree6396e3494465372450ac446d640705594e225252 /arch/riscv/include/asm/kvm_host.h
parent00c6f39c8247b0a5ddca4586d43aec1af7cbccb6 (diff)
downloadlinux-fe0bab701e3b71a1d2db123c05b4f5c33098cc96.tar.xz
RISC-V: KVM: Add kvm_vcpu_config
Add a placeholder for all registers such as henvcfg, hstateen etc which have 'static' configurations depending on extensions supported by the guest. The values are derived once and are then subsequently written to the corresponding CSRs while switching to the vcpu. Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'arch/riscv/include/asm/kvm_host.h')
-rw-r--r--arch/riscv/include/asm/kvm_host.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/kvm_host.h b/arch/riscv/include/asm/kvm_host.h
index 1ebf20dfbaa6..4f787dce4da1 100644
--- a/arch/riscv/include/asm/kvm_host.h
+++ b/arch/riscv/include/asm/kvm_host.h
@@ -164,6 +164,10 @@ struct kvm_vcpu_csr {
unsigned long scounteren;
};
+struct kvm_vcpu_config {
+ u64 henvcfg;
+};
+
struct kvm_vcpu_arch {
/* VCPU ran at least once */
bool ran_atleast_once;
@@ -244,6 +248,9 @@ struct kvm_vcpu_arch {
/* Performance monitoring context */
struct kvm_pmu pmu_context;
+
+ /* 'static' configurations which are set only once */
+ struct kvm_vcpu_config cfg;
};
static inline void kvm_arch_sync_events(struct kvm *kvm) {}