Merge tag 'kvm-s390-next-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / arch / s390 / kvm / kvm-s390.c
index dd099d3..9c6d45d 100644 (file)
@@ -4599,10 +4599,15 @@ int kvm_s390_vcpu_stop(struct kvm_vcpu *vcpu)
                }
        }
 
-       /* SIGP STOP and SIGP STOP AND STORE STATUS has been fully processed */
+       /*
+        * Set the VCPU to STOPPED and THEN clear the interrupt flag,
+        * now that the SIGP STOP and SIGP STOP AND STORE STATUS orders
+        * have been fully processed. This will ensure that the VCPU
+        * is kept BUSY if another VCPU is inquiring with SIGP SENSE.
+        */
+       kvm_s390_set_cpuflags(vcpu, CPUSTAT_STOPPED);
        kvm_s390_clear_stop_irq(vcpu);
 
-       kvm_s390_set_cpuflags(vcpu, CPUSTAT_STOPPED);
        __disable_ibs_on_vcpu(vcpu);
 
        for (i = 0; i < online_vcpus; i++) {