Merge 5.17-rc6 into char-misc-next
[linux-2.6-microblaze.git] / arch / x86 / kvm / lapic.c
index d7e6fde..9322e63 100644 (file)
@@ -2306,7 +2306,12 @@ void kvm_apic_update_apicv(struct kvm_vcpu *vcpu)
                apic->irr_pending = true;
                apic->isr_count = 1;
        } else {
-               apic->irr_pending = (apic_search_irr(apic) != -1);
+               /*
+                * Don't clear irr_pending, searching the IRR can race with
+                * updates from the CPU as APICv is still active from hardware's
+                * perspective.  The flag will be cleared as appropriate when
+                * KVM injects the interrupt.
+                */
                apic->isr_count = count_vectors(apic->regs + APIC_ISR);
        }
 }