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] vt-d: avoid obtaining iommu->register_loc

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vt-d: avoid obtaining iommu->register_lock too early in
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 07 Sep 2009 06:35:15 -0700
Delivery-date: Mon, 07 Sep 2009 06:35:17 -0700
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 1252327775 -3600
# Node ID b81e375e03922cd72d6e1404bc62a05059a4fe61
# Parent  a2ab11e31f9123b11f83465ffd7622fa49806e4d
vt-d: avoid obtaining iommu->register_lock too early in
dma_msi_set_affinity()

If set_desc_affinity() fails, the current code doesn't release the
spinlock. We should obtain the lock at a later place.

Signed-off-by: Dexuan Cui <dexuan.cui@xxxxxxxxx>
---
 xen/drivers/passthrough/vtd/iommu.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r a2ab11e31f91 -r b81e375e0392 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Mon Sep 07 09:00:21 2009 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c       Mon Sep 07 13:49:35 2009 +0100
@@ -826,7 +826,6 @@ static void dma_msi_set_affinity(unsigne
     struct irq_desc *desc = irq_to_desc(irq);
     struct irq_cfg *cfg = desc->chip_data;
 
-    spin_lock_irqsave(&iommu->register_lock, flags);
 #ifdef CONFIG_X86
     dest = set_desc_affinity(desc, mask);
     if (dest == BAD_APICID){
@@ -862,6 +861,7 @@ static void dma_msi_set_affinity(unsigne
     msg.address_lo |= dest << MSI_TARGET_CPU_SHIFT;
 #endif
 
+    spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FEDATA_REG, msg.data);
     dmar_writel(iommu->reg, DMAR_FEADDR_REG, msg.address_lo);
     dmar_writel(iommu->reg, DMAR_FEUADDR_REG, msg.address_hi);

_______________________________________________
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] vt-d: avoid obtaining iommu->register_lock too early in, Xen patchbot-unstable <=