Skip to content

Commit 6433fc0

Browse files
committed
KVM: VMX: Ensure vIRR isn't reloaded at odd times when sync'ing PIR
Read each vIRR exactly once when shuffling IRQs from the PIR to the vAPIC to ensure getting the highest priority IRQ from the chunk doesn't reload from the vIRR. In practice, a reload is functionally benign as vcpu->mutex is held and so IRQs can be consumed, i.e. new IRQs can appear, but existing IRQs can't disappear. Link: https://lore.kernel.org/r/20250401163447.846608-4-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 3cdb826 commit 6433fc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/lapic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ bool __kvm_apic_update_irr(u32 *pir, void *regs, int *max_irr)
667667
for (i = vec = 0; i <= 7; i++, vec += 32) {
668668
u32 *p_irr = (u32 *)(regs + APIC_IRR + i * 0x10);
669669

670-
irr_val = *p_irr;
670+
irr_val = READ_ONCE(*p_irr);
671671
pir_val = READ_ONCE(pir[i]);
672672

673673
if (pir_val) {

0 commit comments

Comments
 (0)