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 174b9c41efce00d67d034616afcc974a7e51fe2f..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;
@@ -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 {