]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - arch/x86/include/asm/kvm_host.h
KVM: MMU: Rename PT64_ROOT_LEVEL to PT64_ROOT_4LEVEL.
[mirror_ubuntu-jammy-kernel.git] / arch / x86 / include / asm / kvm_host.h
index 1588e9e3dc01f9b807afafc35136974e5870977e..5907d46d306d91fcc798dd8333b2527fc223b313 100644 (file)
@@ -79,7 +79,6 @@
                          | X86_CR0_ET | X86_CR0_NE | X86_CR0_WP | X86_CR0_AM \
                          | X86_CR0_NW | X86_CR0_CD | X86_CR0_PG))
 
-#define CR3_L_MODE_RESERVED_BITS 0xFFFFFF0000000000ULL
 #define CR3_PCID_INVD           BIT_64(63)
 #define CR4_RESERVED_BITS                                               \
        (~(unsigned long)(X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD | X86_CR4_DE\
@@ -204,7 +203,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)
 
@@ -317,8 +315,10 @@ struct kvm_pio_request {
        int size;
 };
 
+#define PT64_ROOT_MAX_LEVEL 4
+
 struct rsvd_bits_validate {
-       u64 rsvd_bits_mask[2][4];
+       u64 rsvd_bits_mask[2][PT64_ROOT_MAX_LEVEL];
        u64 bad_mt_xwr;
 };
 
@@ -462,10 +462,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 +551,7 @@ struct kvm_vcpu_arch {
                bool reinject;
                u8 nr;
                u32 error_code;
+               u8 nested_apf;
        } exception;
 
        struct kvm_queued_interrupt {
@@ -649,6 +652,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) */
@@ -680,8 +686,12 @@ struct kvm_vcpu_arch {
        int pending_ioapic_eoi;
        int pending_external_vector;
 
-       /* GPA available (AMD only) */
+       /* GPA available */
        bool gpa_available;
+       gpa_t gpa_val;
+
+       /* be preempted when it's in kernel-mode(cpl=0) */
+       bool preempted_in_kernel;
 };
 
 struct kvm_lpage_info {
@@ -803,6 +813,7 @@ struct kvm_arch {
        int audit_point;
        #endif
 
+       bool backwards_tsc_observed;
        bool boot_vcpu_runs_old_kvmclock;
        u32 bsp_vcpu_id;
 
@@ -952,9 +963,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);