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] [VTD][QUIRK] add spin lock across snb pre

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [VTD][QUIRK] add spin lock across snb pre/postamble functions
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Thu, 10 Feb 2011 06:10:14 -0800
Delivery-date: Thu, 10 Feb 2011 06:10:23 -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@xxxxxxx>
# Date 1297240805 0
# Node ID c23b711f92646a7e441ee80dbb15b9e1e87c83f8
# Parent  aeda4adecaf85618918dc674855721e3fc9eb33d
[VTD][QUIRK] add spin lock across snb pre/postamble functions

Added a spinlock across snb_vtd_ops_preamble() and
snb_vtd_ops_postamble() to make modifications to IGD registers atomic.
Continue keeping snb_igd_quirk default off.

Signed-off-by: Allen Kay <allen.m.kay@xxxxxxxxx>
---
 xen/drivers/passthrough/vtd/quirks.c |   12 ++++++++++++
 1 files changed, 12 insertions(+)

diff -r aeda4adecaf8 -r c23b711f9264 xen/drivers/passthrough/vtd/quirks.c
--- a/xen/drivers/passthrough/vtd/quirks.c      Tue Feb 08 16:35:35 2011 +0000
+++ b/xen/drivers/passthrough/vtd/quirks.c      Wed Feb 09 08:40:05 2011 +0000
@@ -55,6 +55,7 @@ static int is_cantiga_b3;
 static int is_cantiga_b3;
 static int is_snb_gfx;
 static u8 *igd_reg_va;
+static spinlock_t igd_lock;
 
 /*
  * QUIRK to workaround Xen boot issue on Calpella/Ironlake OEM BIOS
@@ -98,6 +99,7 @@ static void snb_errata_init(void)
 static void snb_errata_init(void)
 {
     is_snb_gfx = IS_SNB_GFX(igd_id);
+    spin_lock_init(&igd_lock);
 }
 
 /*
@@ -225,7 +227,12 @@ void vtd_ops_preamble_quirk(struct iommu
 {
     cantiga_vtd_ops_preamble(iommu);
     if ( snb_igd_quirk )
+    {
+        spin_lock(&igd_lock);
+
+        /* match unlock in postamble */
         snb_vtd_ops_preamble(iommu);
+    }
 }
 
 /*
@@ -234,7 +241,12 @@ void vtd_ops_postamble_quirk(struct iomm
 void vtd_ops_postamble_quirk(struct iommu* iommu)
 {
     if ( snb_igd_quirk )
+    {
         snb_vtd_ops_postamble(iommu);
+
+        /* match the lock in preamble */
+        spin_unlock(&igd_lock);
+    }
 }
 
 /* initialize platform identification flags */

_______________________________________________
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] [VTD][QUIRK] add spin lock across snb pre/postamble functions, Xen patchbot-unstable <=