@@ -686,6 +686,15 @@ static inline wait_queue_head_t *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu)
#endif
}
+#ifndef CONFIG_HAVE_KVM_ARCH_VCPU_DONT_YIELD
+static inline bool kvm_arch_vcpu_dont_yield(struct kvm_vcpu *vcpu)
+{
+ return waitqueue_active(kvm_arch_vcpu_wq(vcpu));
+}
+#else
+bool kvm_arch_vcpu_dont_yield(struct kvm_vcpu *vcpu);
+#endif
+
int kvm_arch_init_vm(struct kvm *kvm, unsigned long type);
void kvm_arch_destroy_vm(struct kvm *kvm);
void kvm_arch_sync_events(struct kvm *kvm);
@@ -34,3 +34,6 @@ config HAVE_KVM_CPU_RELAX_INTERCEPT
config KVM_VFIO
bool
+
+config HAVE_KVM_ARCH_VCPU_DONT_YIELD
+ bool
@@ -1804,7 +1804,7 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me)
continue;
if (vcpu == me)
continue;
- if (waitqueue_active(&vcpu->wq))
+ if (kvm_arch_vcpu_dont_yield(vcpu))
continue;
if (!kvm_vcpu_eligible_for_directed_yield(vcpu))
continue;