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] AMD IOMMU: Fix a dead lock in device assi

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] AMD IOMMU: Fix a dead lock in device assignment.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 Jan 2009 02:50:48 -0800
Delivery-date: Fri, 16 Jan 2009 02:53:33 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 1231859767 0
# Node ID 1c6642adaeb204495c95ab86c8aee41587a22928
# Parent  27e9687c5b3d7499a629b14571df917af32dbd86
AMD IOMMU: Fix a dead lock in device assignment.

Do not obtain pcidevs_lock in reassign_device().

Signed-off-by: Wei Wang <wei.wang2@xxxxxxx>
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff -r 27e9687c5b3d -r 1c6642adaeb2 xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c       Tue Jan 13 08:59:49 
2009 +0000
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c       Tue Jan 13 15:16:07 
2009 +0000
@@ -271,26 +271,22 @@ static int reassign_device( struct domai
     struct amd_iommu *iommu;
     int bdf;
 
-    spin_lock(&pcidevs_lock);
+    ASSERT(spin_is_locked(&pcidevs_lock));
     pdev = pci_get_pdev_by_domain(source, bus, devfn);
     if ( !pdev )
-    {
-        spin_unlock(&pcidevs_lock);
-        return -ENODEV;
-    }
+        return -ENODEV;
 
     bdf = (bus << 8) | devfn;
     /* supported device? */
     iommu = (bdf < ivrs_bdf_entries) ?
-       find_iommu_for_device(bus, pdev->devfn) : NULL;
+    find_iommu_for_device(bus, pdev->devfn) : NULL;
 
     if ( !iommu )
     {
-        spin_unlock(&pcidevs_lock);
         amd_iov_error("Fail to find iommu."
-                     " %x:%x.%x cannot be assigned to domain %d\n", 
-                     bus, PCI_SLOT(devfn), PCI_FUNC(devfn), target->domain_id);
-       return -ENODEV;
+            " %x:%x.%x cannot be assigned to domain %d\n", 
+            bus, PCI_SLOT(devfn), PCI_FUNC(devfn), target->domain_id);
+        return -ENODEV;
     }
 
     amd_iommu_disable_domain_device(source, iommu, bdf);

_______________________________________________
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] AMD IOMMU: Fix a dead lock in device assignment., Xen patchbot-unstable <=