[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [VTD][QUIRK] add spin lock across snb pre/postamble functions



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.