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: Fix a bug in pmr register disabling

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vt-d: Fix a bug in pmr register disabling code.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 31 Oct 2007 15:03:40 -0700
Delivery-date: Wed, 31 Oct 2007 15:03:54 -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@xxxxxxxxxxxxx>
# Date 1193128263 -3600
# Node ID 5a213170b06e0739b4c8914eedee5530d55a6bb7
# Parent  b28ae5f00553ea053bd4e4576634d8ea49e77bc3
vt-d: Fix a bug in pmr register disabling code.
Signed-off-by: Allen Kay <allen.m.kay@xxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vtd/utils.c          |   20 ++++++++++++--------
 xen/include/asm-x86/hvm/vmx/intel-iommu.h |    2 +-
 2 files changed, 13 insertions(+), 9 deletions(-)

diff -r b28ae5f00553 -r 5a213170b06e xen/arch/x86/hvm/vmx/vtd/utils.c
--- a/xen/arch/x86/hvm/vmx/vtd/utils.c  Tue Oct 23 09:26:43 2007 +0100
+++ b/xen/arch/x86/hvm/vmx/vtd/utils.c  Tue Oct 23 09:31:03 2007 +0100
@@ -64,24 +64,28 @@ int vtd_hw_check(void)
     return 0;
 }
 
-/* disable vt-d protected memory registers */
+/* Disable vt-d protected memory registers. */
 void disable_pmr(struct iommu *iommu)
 {
     unsigned long start_time, status;
-
-    gdprintk(XENLOG_INFO VTDPREFIX,
-        "disabling protected memory registers\n");
-
-    dmar_writel(iommu->reg, DMAR_PMEN_REG, 0);
+    unsigned int val;
+
+    val = dmar_readl(iommu->reg, DMAR_PMEN_REG);
+    dmar_writel(iommu->reg, DMAR_PMEN_REG, val & ~DMA_PMEN_EPM);
     start_time = jiffies;
-    while (1) {
+
+    for ( ; ; )
+    {
         status = dmar_readl(iommu->reg, DMAR_PMEN_REG);
         if ( (status & DMA_PMEN_PRS) == 0 )
             break;
-        if (time_after(jiffies, start_time + DMAR_OPERATION_TIMEOUT))
+        if ( time_after(jiffies, start_time + DMAR_OPERATION_TIMEOUT) )
             panic("Cannot set QIE field for queue invalidation\n");
         cpu_relax();
     }
+
+    dprintk(XENLOG_INFO VTDPREFIX,
+            "disabled protected memory registers\n");
 }
 
 #if defined(__x86_64__)
diff -r b28ae5f00553 -r 5a213170b06e xen/include/asm-x86/hvm/vmx/intel-iommu.h
--- a/xen/include/asm-x86/hvm/vmx/intel-iommu.h Tue Oct 23 09:26:43 2007 +0100
+++ b/xen/include/asm-x86/hvm/vmx/intel-iommu.h Tue Oct 23 09:31:03 2007 +0100
@@ -147,7 +147,7 @@
 
 /* PMEN_REG */
 #define DMA_PMEN_EPM   (((u32)1) << 31)
-#define DMA_PMEN_PRS   (((u32)1) << 1)
+#define DMA_PMEN_PRS   (((u32)1) << 0)
 
 /* CCMD_REG */
 #define DMA_CCMD_INVL_GRANU_OFFSET  61

_______________________________________________
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: Fix a bug in pmr register disabling code., Xen patchbot-unstable <=