iommu: Fix hvm_dpci_eoi for smp guest in ioapic interrupt mode
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 2 Jul 2008 16:28:27 +0000 (17:28 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 2 Jul 2008 16:28:27 +0000 (17:28 +0100)
My testing shows, for some smp guests, ent->fields.mask will not be
unmasked when hvm_dpci_eoi() is invoked at the first time. In that
case, we should rely on timeout call back to do pirq_guest_eoi() and
should not stop the per-irq timer too early.

From: Wei Wang <wei.wang2@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/drivers/passthrough/io.c

index 7e3823790776128c40bfb467f131328f4669a526..422ae18a0e4d655182822bde079aeac0b969b16b 100644 (file)
@@ -258,10 +258,12 @@ void hvm_dpci_eoi(struct domain *d, unsigned int guest_gsi,
     {
         spin_unlock(&hvm_irq_dpci->dirq_lock);
 
-        stop_timer(&hvm_irq_dpci->hvm_timer[
-            domain_irq_to_vector(d, machine_gsi)]);
         if ( (ent == NULL) || !ent->fields.mask )
+        {
+            stop_timer(&hvm_irq_dpci->hvm_timer[
+                domain_irq_to_vector(d, machine_gsi)]);
             pirq_guest_eoi(d, machine_gsi);
+        }
     }
     else
         spin_unlock(&hvm_irq_dpci->dirq_lock);