KVM: x86: Add a framework for supporting MSR-based features
[GitHub/LineageOS/android_kernel_motorola_exynos9610.git] / arch / x86 / include / asm / kvm_host.h
index 4f8b801996722df5d1ebdcbe0e849a9bfbbc955f..017dbbde399e0b7c6664fea0ad250f45e6e59fed 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/tracepoint.h>
 #include <linux/cpumask.h>
 #include <linux/irq_work.h>
+#include <linux/irq.h>
 
 #include <linux/kvm.h>
 #include <linux/kvm_para.h>
@@ -693,6 +694,9 @@ struct kvm_vcpu_arch {
 
        /* be preempted when it's in kernel-mode(cpl=0) */
        bool preempted_in_kernel;
+
+       /* Flush the L1 Data cache for L1TF mitigation on VMENTER */
+       bool l1tf_flush_l1d;
 };
 
 struct kvm_lpage_info {
@@ -862,6 +866,7 @@ struct kvm_vcpu_stat {
        u64 signal_exits;
        u64 irq_window_exits;
        u64 nmi_window_exits;
+       u64 l1d_flush;
        u64 halt_exits;
        u64 halt_successful_poll;
        u64 halt_attempted_poll;
@@ -908,7 +913,7 @@ struct kvm_x86_ops {
        int (*hardware_setup)(void);               /* __init */
        void (*hardware_unsetup)(void);            /* __exit */
        bool (*cpu_has_accelerated_tpr)(void);
-       bool (*cpu_has_high_real_mode_segbase)(void);
+       bool (*has_emulated_msr)(int index);
        void (*cpuid_update)(struct kvm_vcpu *vcpu);
 
        int (*vm_init)(struct kvm *kvm);
@@ -1061,6 +1066,8 @@ struct kvm_x86_ops {
        void (*cancel_hv_timer)(struct kvm_vcpu *vcpu);
 
        void (*setup_mce)(struct kvm_vcpu *vcpu);
+
+       int (*get_msr_feature)(struct kvm_msr_entry *entry);
 };
 
 struct kvm_arch_async_pf {