From: Roger Pau Monné Date: Tue, 1 Dec 2020 14:34:55 +0000 (+0100) Subject: x86/vioapic: fix usage of index in place of GSI in vioapic_write_redirent X-Git-Tag: archive/raspbian/4.14.0+88-g1d1d1f5391-2+rpi1^2~86^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=88-g1d1d1f5391;p=xen.git x86/vioapic: fix usage of index in place of GSI in vioapic_write_redirent The usage of idx instead of the GSI in vioapic_write_redirent when accessing gsi_assert_count can cause a PVH dom0 with multiple vIO-APICs to lose interrupts in case a pin of a IO-APIC different than the first one is unmasked with pending interrupts. Switch to use gsi instead to fix the issue. Fixes: 9f44b08f7d0e4 ('x86/vioapic: introduce support for multiple vIO APICS') Reported-by: Manuel Bouyer Signed-off-by: Roger Pau Monné Tested-by: Manuel Bouyer Reviewed-by: Jan Beulich master commit: 3ae469af8e680df31eecd0a2ac6a83b58ad7ce53 master date: 2020-11-30 14:06:38 +0100 --- diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c index b87facb0e0..52c5c636e3 100644 --- a/xen/arch/x86/hvm/vioapic.c +++ b/xen/arch/x86/hvm/vioapic.c @@ -260,7 +260,7 @@ static void vioapic_write_redirent( pent->fields.remote_irr = 0; else if ( !ent.fields.mask && !ent.fields.remote_irr && - hvm_irq->gsi_assert_count[idx] ) + hvm_irq->gsi_assert_count[gsi] ) { pent->fields.remote_irr = 1; vioapic_deliver(vioapic, idx);