kvm: Iterate over only vcpus that are preempted
[platform/adaptation/renesas_rcar/renesas_kernel.git] / virt / kvm / kvm_main.c
index 470f2bc..ff71541 100644 (file)
@@ -1768,6 +1768,8 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me)
                                continue;
                        } else if (pass && i > last_boosted_vcpu)
                                break;
+                       if (!ACCESS_ONCE(vcpu->preempted))
+                               continue;
                        if (vcpu == me)
                                continue;
                        if (waitqueue_active(&vcpu->wq))