]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - arch/x86/include/asm/kvm_host.h
kvm: nVMX: Add support for fast unprotection of nested guest page tables
[mirror_ubuntu-bionic-kernel.git] / arch / x86 / include / asm / kvm_host.h
index 1588e9e3dc01f9b807afafc35136974e5870977e..9e4862e0e978859d3cb9038594161aeb70e550e4 100644 (file)
@@ -204,7 +204,6 @@ enum {
 #define PFERR_GUEST_PAGE_MASK (1ULL << PFERR_GUEST_PAGE_BIT)
 
 #define PFERR_NESTED_GUEST_PAGE (PFERR_GUEST_PAGE_MASK |       \
-                                PFERR_USER_MASK |              \
                                 PFERR_WRITE_MASK |             \
                                 PFERR_PRESENT_MASK)
 
@@ -462,10 +461,12 @@ struct kvm_vcpu_hv_synic {
        DECLARE_BITMAP(auto_eoi_bitmap, 256);
        DECLARE_BITMAP(vec_bitmap, 256);
        bool active;
+       bool dont_zero_synic_pages;
 };
 
 /* Hyper-V per vcpu emulation context */
 struct kvm_vcpu_hv {
+       u32 vp_index;
        u64 hv_vapic;
        s64 runtime_offset;
        struct kvm_vcpu_hv_synic synic;
@@ -549,6 +550,7 @@ struct kvm_vcpu_arch {
                bool reinject;
                u8 nr;
                u32 error_code;
+               u8 nested_apf;
        } exception;
 
        struct kvm_queued_interrupt {
@@ -649,6 +651,9 @@ struct kvm_vcpu_arch {
                u64 msr_val;
                u32 id;
                bool send_user_only;
+               u32 host_apf_reason;
+               unsigned long nested_apf_token;
+               bool delivery_as_pf_vmexit;
        } apf;
 
        /* OSVW MSRs (AMD only) */
@@ -682,6 +687,9 @@ struct kvm_vcpu_arch {
 
        /* GPA available (AMD only) */
        bool gpa_available;
+
+       /* be preempted when it's in kernel-mode(cpl=0) */
+       bool preempted_in_kernel;
 };
 
 struct kvm_lpage_info {
@@ -803,6 +811,7 @@ struct kvm_arch {
        int audit_point;
        #endif
 
+       bool backwards_tsc_observed;
        bool boot_vcpu_runs_old_kvmclock;
        u32 bsp_vcpu_id;
 
@@ -952,9 +961,7 @@ struct kvm_x86_ops {
                                unsigned char *hypercall_addr);
        void (*set_irq)(struct kvm_vcpu *vcpu);
        void (*set_nmi)(struct kvm_vcpu *vcpu);
-       void (*queue_exception)(struct kvm_vcpu *vcpu, unsigned nr,
-                               bool has_error_code, u32 error_code,
-                               bool reinject);
+       void (*queue_exception)(struct kvm_vcpu *vcpu);
        void (*cancel_injection)(struct kvm_vcpu *vcpu);
        int (*interrupt_allowed)(struct kvm_vcpu *vcpu);
        int (*nmi_allowed)(struct kvm_vcpu *vcpu);