Skip to content

KVM: x86: Fix and clarify PIR->IRR transfer

Paolo Bonzini kvm lkml stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: x86: Do IRR scan in __kvm_apic_update_irr even if PIR is emptyarch/x86/kvm/lapic.c+5 -30 replies
2/2KVM: x86: Fix misleading variable names and add more comments for PIR=>IRR flowarch/x86/kvm/lapic.c arch/x86/kvm/vmx/vmx.c+40 -160 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchChenyi QiangSean Christopherson
1/2Analyzed-by R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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

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/[email protected]/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(-)
Signature · 1 line
2.54.0