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: msi/msix clean up on hotplug remove

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] ioemu: msi/msix clean up on hotplug remove
From: Qing He <qing.he@xxxxxxxxx>
Date: Wed, 11 Mar 2009 22:28:11 +0800
Delivery-date: Wed, 11 Mar 2009 07:26:45 -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
The passthrough MSI/MSI-X should be unbound and unmapped when
unregister_real_device is called, this patch fix this.

Signed-off-by: Qing He <qing.he@xxxxxxxxx>

diff --git a/hw/pass-through.c b/hw/pass-through.c
index 4a86309..308bcc3 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -3753,20 +3753,14 @@ int unregister_real_device(int php_slot)
                                        e_device, e_intx, 0);
         if ( rc < 0 )
         {
-            /* TBD: unregister device in case of an error */
             PT_LOG("Error: Unbinding of interrupt failed! rc=%d\n", rc);
         }
     }
-    else if (assigned_device->msi_trans_en)
-    {
-        rc = xc_domain_unbind_pt_irq(xc_handle, domid, 
assigned_device->msi->pirq,
-                                     PT_IRQ_TYPE_MSI_TRANSLATE, 0,
-                                     e_device, e_intx, 0);
-        if (rc < 0)
-            PT_LOG("Error: Unbinding pt irq for MSI-INTx failed! rc=%d\n", rc);
-    }
 
-    /* TODO: unmap passthrough MSI and MSI-X irqs */
+    if (assigned_device->msi)
+        pt_msi_disable(assigned_device);
+    if (assigned_device->msix)
+        pt_msix_disable(assigned_device);
 
     /* delete all emulated config registers */
     pt_config_delete(assigned_device);

_______________________________________________
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: msi/msix clean up on hotplug remove, Qing He <=