]> Git Repo - J-linux.git/commitdiff
KVM: x86: WARN if a vCPU gets a valid wakeup that KVM can't yet inject
authorSean Christopherson <[email protected]>
Fri, 7 Jun 2024 17:26:09 +0000 (10:26 -0700)
committerSean Christopherson <[email protected]>
Fri, 28 Jun 2024 15:59:07 +0000 (08:59 -0700)
WARN if a blocking vCPU is awakened by a valid wake event that KVM can't
inject, e.g. because KVM needs to complete a nested VM-enter, or needs to
re-inject an exception.  For the nested VM-Enter case, KVM is supposed to
clear "nested_run_pending" if L1 puts L2 into HLT, i.e. entering HLT
"completes" the nested VM-Enter.  And for already-injected exceptions, it
should be impossible for the vCPU to be in a blocking state if a VM-Exit
occurred while an exception was being vectored.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sean Christopherson <[email protected]>
arch/x86/kvm/x86.c

index cacca83b06aace92f15889891f3033493637f680..aab69647c3b605a84ffce6fbd10717b8af48a548 100644 (file)
@@ -11208,7 +11208,10 @@ static inline int vcpu_block(struct kvm_vcpu *vcpu)
         * causes a spurious wakeup from HLT).
         */
        if (is_guest_mode(vcpu)) {
-               if (kvm_check_nested_events(vcpu) < 0)
+               int r = kvm_check_nested_events(vcpu);
+
+               WARN_ON_ONCE(r == -EBUSY);
+               if (r < 0)
                        return 0;
        }
 
This page took 0.062205 seconds and 4 git commands to generate.