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: move the snoop control detection out

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vtd: move the snoop control detection out of acpi_dmar_init()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 12 Feb 2009 12:45:14 -0800
Delivery-date: Thu, 12 Feb 2009 12:44:58 -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 1234436057 0
# Node ID 32b15413749255e0cd518f25d9202759586dcb27
# Parent  94e12fa57816c26f8b76061f17c33928be202c85
vtd: move the snoop control detection out of acpi_dmar_init()
where the capability value is not initialized thus we may
get random value.

Signed-off-by: Xin, Xiaohui<xiaohui.xin@xxxxxxxxx>
---
 xen/drivers/passthrough/vtd/dmar.c  |   19 +------------------
 xen/drivers/passthrough/vtd/iommu.c |   18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 18 deletions(-)

diff -r 94e12fa57816 -r 32b154137492 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c        Thu Feb 12 10:53:10 2009 +0000
+++ b/xen/drivers/passthrough/vtd/dmar.c        Thu Feb 12 10:54:17 2009 +0000
@@ -519,8 +519,6 @@ int acpi_dmar_init(void)
 int acpi_dmar_init(void)
 {
     int rc;
-    struct acpi_drhd_unit *drhd;
-    struct iommu *iommu;
 
     rc = -ENODEV;
     if ( force_iommu )
@@ -537,22 +535,7 @@ int acpi_dmar_init(void)
     if ( list_empty(&acpi_drhd_units) )
         goto fail;
 
-    /* Giving that all devices within guest use same io page table,
-     * enable snoop control only if all VT-d engines support it.
-     */
-    if ( iommu_snoop )
-    {
-        for_each_drhd_unit ( drhd )
-        {
-            iommu = drhd->iommu;
-            if ( !ecap_snp_ctl(iommu->ecap) ) {
-                iommu_snoop = 0;
-                break;
-            }
-        }
-    }
-
-    printk("Intel VT-d has been enabled, snoop_control=%d.\n", iommu_snoop);
+    printk("Intel VT-d has been enabled\n");
 
     return 0;
 
diff -r 94e12fa57816 -r 32b154137492 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Thu Feb 12 10:53:10 2009 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c       Thu Feb 12 10:54:17 2009 +0000
@@ -1765,6 +1765,23 @@ int intel_vtd_setup(void)
     if ( init_vtd_hw() )
         goto error;
 
+    /* Giving that all devices within guest use same io page table,
+     * enable snoop control only if all VT-d engines support it.
+     */
+
+    if ( iommu_snoop )
+    {
+        for_each_drhd_unit ( drhd )
+        {
+            iommu = drhd->iommu;
+            if ( !ecap_snp_ctl(iommu->ecap) ) {
+                iommu_snoop = 0;
+                break;
+            }
+        }
+    }
+    
+    printk("Intel VT-d snoop control %sabled\n", iommu_snoop ? "en" : "dis");
     register_keyhandler('V', dump_iommu_info, "dump iommu info");
 
     return 0;
@@ -1773,6 +1790,7 @@ int intel_vtd_setup(void)
     for_each_drhd_unit ( drhd )
         iommu_free(drhd);
     vtd_enabled = 0;
+    iommu_snoop = 0;
     return -ENOMEM;
 }
 

_______________________________________________
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: move the snoop control detection out of acpi_dmar_init(), Xen patchbot-unstable <=