Merge tag 'kvm-x86-svm-6.7' of https://github.com/kvm-x86/linux into HEAD
[linux-2.6-microblaze.git] / arch / x86 / include / asm / kvm_host.h
index 17715cb..d703698 100644 (file)
 
 #define __KVM_HAVE_ARCH_VCPU_DEBUGFS
 
+/*
+ * CONFIG_KVM_MAX_NR_VCPUS is defined iff CONFIG_KVM!=n, provide a dummy max if
+ * KVM is disabled (arbitrarily use the default from CONFIG_KVM_MAX_NR_VCPUS).
+ */
+#ifdef CONFIG_KVM_MAX_NR_VCPUS
+#define KVM_MAX_VCPUS CONFIG_KVM_MAX_NR_VCPUS
+#else
 #define KVM_MAX_VCPUS 1024
+#endif
 
 /*
  * In x86, the VCPU ID corresponds to the APIC ID, and APIC IDs
@@ -528,7 +536,6 @@ struct kvm_pmu {
        u64 raw_event_mask;
        struct kvm_pmc gp_counters[KVM_INTEL_PMC_MAX_GENERIC];
        struct kvm_pmc fixed_counters[KVM_PMC_MAX_FIXED];
-       struct irq_work irq_work;
 
        /*
         * Overlay the bitmap with a 64-bit atomic so that all bits can be
@@ -680,6 +687,7 @@ struct kvm_hypervisor_cpuid {
        u32 limit;
 };
 
+#ifdef CONFIG_KVM_XEN
 /* Xen HVM per vcpu emulation context */
 struct kvm_vcpu_xen {
        u64 hypercall_rip;
@@ -702,6 +710,7 @@ struct kvm_vcpu_xen {
        struct timer_list poll_timer;
        struct kvm_hypervisor_cpuid cpuid;
 };
+#endif
 
 struct kvm_queued_exception {
        bool pending;
@@ -930,8 +939,9 @@ struct kvm_vcpu_arch {
 
        bool hyperv_enabled;
        struct kvm_vcpu_hv *hyperv;
+#ifdef CONFIG_KVM_XEN
        struct kvm_vcpu_xen xen;
-
+#endif
        cpumask_var_t wbinvd_dirty_mask;
 
        unsigned long last_retry_eip;
@@ -1276,7 +1286,6 @@ struct kvm_arch {
         */
        spinlock_t mmu_unsync_pages_lock;
 
-       struct list_head assigned_dev_head;
        struct iommu_domain *iommu_domain;
        bool iommu_noncoherent;
 #define __KVM_HAVE_ARCH_NONCOHERENT_DMA
@@ -1324,6 +1333,7 @@ struct kvm_arch {
        int nr_vcpus_matched_tsc;
 
        u32 default_tsc_khz;
+       bool user_set_tsc;
 
        seqcount_raw_spinlock_t pvclock_sc;
        bool use_master_clock;
@@ -1692,7 +1702,7 @@ struct kvm_x86_ops {
 
        void (*request_immediate_exit)(struct kvm_vcpu *vcpu);
 
-       void (*sched_in)(struct kvm_vcpu *kvm, int cpu);
+       void (*sched_in)(struct kvm_vcpu *vcpu, int cpu);
 
        /*
         * Size of the CPU's dirty log buffer, i.e. VMX's PML buffer.  A zero
@@ -1709,6 +1719,7 @@ struct kvm_x86_ops {
        int (*pi_update_irte)(struct kvm *kvm, unsigned int host_irq,
                              uint32_t guest_irq, bool set);
        void (*pi_start_assignment)(struct kvm *kvm);
+       void (*apicv_pre_state_restore)(struct kvm_vcpu *vcpu);
        void (*apicv_post_state_restore)(struct kvm_vcpu *vcpu);
        bool (*dy_apicv_has_pending_interrupt)(struct kvm_vcpu *vcpu);
 
@@ -1734,8 +1745,8 @@ struct kvm_x86_ops {
 
        int (*get_msr_feature)(struct kvm_msr_entry *entry);
 
-       bool (*can_emulate_instruction)(struct kvm_vcpu *vcpu, int emul_type,
-                                       void *insn, int insn_len);
+       int (*check_emulate_instruction)(struct kvm_vcpu *vcpu, int emul_type,
+                                        void *insn, int insn_len);
 
        bool (*apic_init_signal_blocked)(struct kvm_vcpu *vcpu);
        int (*enable_l2_tlb_flush)(struct kvm_vcpu *vcpu);