]> xenbits.xensource.com Git - xen.git/commitdiff
x86/vioapic: check IRR before attempting to inject interrupt after EOI
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 22 Jan 2021 11:13:05 +0000 (12:13 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 22 Jan 2021 11:13:05 +0000 (12:13 +0100)
In vioapic_update_EOI the irq_lock will be dropped in order to forward
the EOI to the dpci handler, so there's a window between clearing IRR
and checking if the line is asserted where IRR can change behind our
back.

Fix this by checking whether IRR is set before attempting to inject a
new interrupt.

Fixes: 06e3f8f2766 ('vt-d: Do dpci eoi outside of irq_lock.')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/vioapic.c

index eb6c143f743ac888c4846dd68c3947bc3ff09727..804bc77279387ca713c76a738f935255ed957811 100644 (file)
@@ -526,7 +526,7 @@ void vioapic_update_EOI(struct domain *d, u8 vector)
             }
 
             if ( (ent->fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-                 !ent->fields.mask &&
+                 !ent->fields.mask && !ent->fields.remote_irr &&
                  hvm_irq->gsi_assert_count[vioapic->base_gsi + pin] )
             {
                 ent->fields.remote_irr = 1;