[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen stable-4.13] x86/vioapic: fix usage of index in place of GSI in vioapic_write_redirent

commit b5302273e2c51940172400486644636f2f4fc64a
Author:     Roger Pau Monné <roge.rpau@xxxxxxxxxx>
AuthorDate: Tue Dec 1 15:41:07 2020 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Dec 1 15:41:07 2020 +0100

    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 
    Reported-by: Manuel Bouyer <bouyer@xxxxxxxxxxxxxxx>
    Signed-off-by: Roger Pau Monné <roge.rpau@xxxxxxxxxx>
    Tested-by: Manuel Bouyer <bouyer@xxxxxxxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: 3ae469af8e680df31eecd0a2ac6a83b58ad7ce53
    master date: 2020-11-30 14:06:38 +0100
 xen/arch/x86/hvm/vioapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 9aeef32a14..d899dd9707 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);
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.