WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] ioemu: Fix double unbinding of INTx interrupt when P

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] ioemu: Fix double unbinding of INTx interrupt when PCI device is hot-removed
From: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>
Date: Thu, 26 Mar 2009 17:11:10 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 26 Mar 2009 01:12:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This patch fixes double unbinding of INTx interrupt when PCI device is
hot-removed.

Thanks,
--
Yuji Shimada


Signed-off-by: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>

diff --git a/hw/pass-through.c b/hw/pass-through.c
index a498f62..faa701c 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -1858,6 +1858,20 @@ static void pt_reset_interrupt_and_io_mapping(struct 
pt_dev *ptdev)
     PCIDevice *d = &ptdev->dev;
     PCIIORegion *r;
     int i = 0;
+    uint8_t e_device = 0;
+    uint8_t e_intx = 0;
+
+    /* unbind INTx */
+    e_device = (ptdev->dev.devfn >> 3) & 0x1f;
+    /* fix virtual interrupt pin to INTA# */
+    e_intx = 0;
+
+    if (ptdev->msi_trans_en == 0 && ptdev->machine_irq)
+    {
+        if (xc_domain_unbind_pt_irq(xc_handle, domid, ptdev->machine_irq,
+                        PT_IRQ_TYPE_PCI, 0, e_device, e_intx, 0))
+            PT_LOG("Error: Unbinding of interrupt failed!\n");
+    }
 
     /* disable MSI/MSI-X and MSI-INTx translation */
     if (ptdev->msi)
diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 887f0a2..d28038a 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -187,13 +187,6 @@ void pt_msi_disable(struct pt_dev *dev)
             goto out;
         }
     }
-    /* unbind INTx */
-    if (dev->msi_trans_cap && !dev->msi_trans_en)
-    {
-        if (xc_domain_unbind_pt_irq(xc_handle, domid, dev->machine_irq,
-                        PT_IRQ_TYPE_PCI, 0, e_device, e_intx, 0))
-            PT_LOG("Error: Unbinding of interrupt failed!\n");
-    }
 
 out:
     /* clear msi info */


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] ioemu: Fix double unbinding of INTx interrupt when PCI device is hot-removed, Yuji Shimada <=