[PATCH 0/2] KVM: x86: Fix and clarify PIR->IRR transfer

From: Paolo Bonzini

Date: Sun May 03 2026 - 16:17:22 EST


The first patch fixes a WARN in vmx_check_nested_events() due to
a specific interleaving of vmx_sync_pir_to_irr() on the target
vCPU and __vmx_deliver_posted_interrupt() on a sender vCPU.
In this case vmx_sync_pir_to_irr() sees an interrupt even before
__vmx_deliver_posted_interrupt() sets PID.ON; while this is harmless and in
fact intended, the problem is that a later call to kvm_apic_has_interrupt()
is incorrectly told that no interrupt is pending, just because PID.ON=1
but no bit set in PIR.

See original discussion at https://lore.kernel.org/kvm/20260428070349.1633238-1-chenyi.qiang@xxxxxxxxx/T/.

Paolo Bonzini (1):
KVM: x86: Do IRR scan in __kvm_apic_update_irr even if PIR is empty

Sean Christopherson (1):
KVM: x86: Fix misleading variable names and add more comments for
PIR=>IRR flow

arch/x86/kvm/lapic.c | 24 +++++++++++++-----------
arch/x86/kvm/vmx/vmx.c | 40 ++++++++++++++++++++++++++++++++--------
2 files changed, 45 insertions(+), 19 deletions(-)

--
2.54.0