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-changelog

[Xen-changelog] [xen-unstable] x86 hvm: Clean MSI related data when dest

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86 hvm: Clean MSI related data when destroy domain.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 12 May 2008 09:40:09 -0700
Delivery-date: Mon, 12 May 2008 09:40:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1210583200 -3600
# Node ID 5c00188dd159825e47547da59f691b2a3c59ac44
# Parent  14d362d5fa5913a2e917cdd0ca90cf3b898a45d7
x86 hvm: Clean MSI related data when destroy domain.
Signed-off-by: Shan Haitao <Haitao.shan@xxxxxxxxx>
---
 xen/arch/x86/msi.c                  |   16 ++++++++++++----
 xen/drivers/passthrough/vtd/iommu.c |    1 +
 xen/include/asm-x86/msi.h           |    1 +
 3 files changed, 14 insertions(+), 4 deletions(-)

diff -r 14d362d5fa59 -r 5c00188dd159 xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c        Mon May 12 10:01:01 2008 +0100
+++ b/xen/arch/x86/msi.c        Mon May 12 10:06:40 2008 +0100
@@ -780,8 +780,16 @@ void pci_disable_msi(int vector)
         __pci_disable_msix(vector);
 }
 
-void pci_cleanup_msi(struct pci_dev *dev)
-{
+void pci_cleanup_msi(u8 bus, u8 devfn)
+{
+    struct pci_dev *dev = get_msi_pdev(bus, devfn);
+
+    if ( !dev )
+        return;
     msi_free_vectors(dev);
-}
-
+
+    /* Disable MSI and/or MSI-X */
+    msi_set_enable(dev, 0);
+    msix_set_enable(dev, 0);
+}
+
diff -r 14d362d5fa59 -r 5c00188dd159 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Mon May 12 10:01:01 2008 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c       Mon May 12 10:06:40 2008 +0100
@@ -1434,6 +1434,7 @@ void return_devices_to_dom0(struct domai
     while ( !list_empty(&hd->pdev_list) )
     {
         pdev = list_entry(hd->pdev_list.next, typeof(*pdev), list);
+        pci_cleanup_msi(pdev->bus, pdev->devfn);
         reassign_device_ownership(d, dom0, pdev->bus, pdev->devfn);
     }
 
diff -r 14d362d5fa59 -r 5c00188dd159 xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h Mon May 12 10:01:01 2008 +0100
+++ b/xen/include/asm-x86/msi.h Mon May 12 10:06:40 2008 +0100
@@ -68,6 +68,7 @@ extern void set_msi_irq_affinity(unsigne
 extern void set_msi_irq_affinity(unsigned int irq, cpumask_t mask);
 extern int pci_enable_msi(u8 bus, u8 devfn, int vector, int entry_nr, int msi);
 extern void pci_disable_msi(int vector);
+extern void pci_cleanup_msi(u8 bus, u8 devfn);
 
 struct msi_desc {
        struct {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86 hvm: Clean MSI related data when destroy domain., Xen patchbot-unstable <=