]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: x86: Fix misleading variable names and add more comments for PIR=>IRR flow
authorSean Christopherson <seanjc@google.com>
Tue, 28 Apr 2026 15:50:43 +0000 (08:50 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 3 May 2026 20:32:41 +0000 (22:32 +0200)
commit0aec99f9bf0213f7910688472e1ccf517c0e8b5a
tree347966a1490775563fa2b3442ec73a5d81194e0d
parent33fd0ccd2590b470b65adcca288615ad3b5e3e06
KVM: x86: Fix misleading variable names and add more comments for PIR=>IRR flow

Rename kvm_apic_update_irr()'s "irr_updated" and vmx_sync_pir_to_irr()'s
"got_posted_interrupt" to a more accurate "max_irr_is_from_pir", as neither
"irr_updated" nor "got_posted_interrupt" is accurate.
__kvm_apic_update_irr() and thus kvm_apic_update_irr() specifically return
true if and only if the highest priority IRQ, i.e. max_irr, is a "new"
pending IRQ from the PIR.  I.e. it's possible for the IRR to be updated,
i.e. for a posted IRQ to be "got", *without* the APIs returning true.

Expand vmx_sync_pir_to_irr()'s comment to explain why it's necessary to
set KVM_REQ_EVENT only if a "new" IRQ was found, and to explain why it's
safe to do so only if a new IRQ is also the highest priority pending IRQ.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://patch.msgid.link/20260503201703.108231-3-pbonzini@redhat.com/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c
arch/x86/kvm/vmx/vmx.c