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: Disable VT-d if no DRHD units are pr

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vtd: Disable VT-d if no DRHD units are probed.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 19 Oct 2009 08:55:12 -0700
Delivery-date: Mon, 19 Oct 2009 08:56:04 -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 1255967414 -3600
# Node ID 1c928c3566e0f41ba582edd21ae02f0787bf1362
# Parent  ea34183c5c11a5c0525da7871be79309d3fdda64
vtd: Disable VT-d if no DRHD units are probed.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/drivers/passthrough/iommu.c     |    8 +++++---
 xen/drivers/passthrough/vtd/iommu.c |   21 +++++++++------------
 2 files changed, 14 insertions(+), 15 deletions(-)

diff -r ea34183c5c11 -r 1c928c3566e0 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c   Mon Oct 19 13:31:21 2009 +0100
+++ b/xen/drivers/passthrough/iommu.c   Mon Oct 19 16:50:14 2009 +0100
@@ -266,9 +266,11 @@ int iommu_setup(void)
 {
     int rc = -ENODEV;
 
-    rc = iommu_hardware_setup();
-
-    iommu_enabled = (rc == 0);
+    if ( iommu_enabled )
+    {
+        rc = iommu_hardware_setup();
+        iommu_enabled = (rc == 0);
+    }
 
     if ( force_iommu && !iommu_enabled )
         panic("IOMMU setup failed, crash Xen for security purpose!\n");
diff -r ea34183c5c11 -r 1c928c3566e0 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Mon Oct 19 13:31:21 2009 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c       Mon Oct 19 16:50:14 2009 +0100
@@ -1707,7 +1707,7 @@ int intel_vtd_setup(void)
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
 
-    if ( !iommu_enabled )
+    if ( list_empty(&acpi_drhd_units) )
         return -ENODEV;
 
     platform_quirks();
@@ -1760,18 +1760,15 @@ int intel_vtd_setup(void)
     P(iommu_intremap, "Interrupt Remapping");
 #undef P
 
+    /* Allocate domain id bitmap, and set bit 0 as reserved. */
     drhd = list_entry(acpi_drhd_units.next, typeof(*drhd), list);
-    if ( drhd != NULL )
-    {
-        /* Allocate domain id bitmap, and set bit 0 as reserved. */
-        domid_bitmap_size = cap_ndoms(drhd->iommu->cap);
-        domid_bitmap = xmalloc_array(unsigned long,
-                                     BITS_TO_LONGS(domid_bitmap_size));
-        if ( domid_bitmap == NULL )
-            goto error;
-        memset(domid_bitmap, 0, domid_bitmap_size / 8);
-        __set_bit(0, domid_bitmap);
-    }
+    domid_bitmap_size = cap_ndoms(drhd->iommu->cap);
+    domid_bitmap = xmalloc_array(unsigned long,
+                                 BITS_TO_LONGS(domid_bitmap_size));
+    if ( domid_bitmap == NULL )
+        goto error;
+    memset(domid_bitmap, 0, domid_bitmap_size / 8);
+    __set_bit(0, domid_bitmap);
 
     scan_pci_devices();
 

_______________________________________________
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: Disable VT-d if no DRHD units are probed., Xen patchbot-unstable <=