public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: x86: Fix and clarify PIR->IRR transfer
@ 2026-05-03 20:17 Paolo Bonzini
  2026-05-03 20:17 ` [PATCH 1/2] KVM: x86: Do IRR scan in __kvm_apic_update_irr even if PIR is empty Paolo Bonzini
  2026-05-03 20:17 ` [PATCH 2/2] KVM: x86: Fix misleading variable names and add more comments for PIR=>IRR flow Paolo Bonzini
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2026-05-03 20:17 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: chenyi.qiang

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@intel.com/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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-03 20:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-03 20:17 [PATCH 0/2] KVM: x86: Fix and clarify PIR->IRR transfer Paolo Bonzini
2026-05-03 20:17 ` [PATCH 1/2] KVM: x86: Do IRR scan in __kvm_apic_update_irr even if PIR is empty Paolo Bonzini
2026-05-03 20:17 ` [PATCH 2/2] KVM: x86: Fix misleading variable names and add more comments for PIR=>IRR flow Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox