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: prevent dom0 to use VT-d HW

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] VT-d: prevent dom0 to use VT-d HW
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 08 Sep 2009 07:15:15 -0700
Delivery-date: Tue, 08 Sep 2009 07:15:47 -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 1252419031 -3600
# Node ID 1c406a505fc02569237a1da0061cf206f862f53a
# Parent  18cd7c378c4800801f13d9e3554ddbd561b62420
VT-d: prevent dom0 to use VT-d HW

pv-ops dom0 contains Linux upstream VT-d driver, and will go to enable
it when VT-d is set in kernel config file. It should not enable VT-d
in dom0.

Currently it already zaps ACPI DMAR signature to prevents dom0 using
VT-d HW when VT-d is enabled for Xen. But when VT-d is not enabled for
Xen, and VT-d is set in pv-ops kernel config file, pv-ops dom0 will go
to enable it. This will results in pv-ops dom0 booting failure. This
patch prevents dom0 to use VT-d HW whether VT-d is enabled or disabled
for Xen.

Signed-off-by: Weidong Han <weidong.han@xxxxxxxxx>
---
 xen/drivers/passthrough/vtd/dmar.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff -r 18cd7c378c48 -r 1c406a505fc0 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c        Mon Sep 07 14:26:06 2009 +0100
+++ b/xen/drivers/passthrough/vtd/dmar.c        Tue Sep 08 15:10:31 2009 +0100
@@ -517,6 +517,12 @@ static int __init acpi_parse_dmar(struct
 
     dmar = (struct acpi_table_dmar *)table;
 
+    if ( !iommu_enabled )
+    {
+        ret = -EINVAL;
+        goto out;
+    }
+
     if ( !dmar->width )
     {
         dprintk(XENLOG_WARNING VTDPREFIX, "Zero: Invalid DMAR width\n");
@@ -563,9 +569,6 @@ static int __init acpi_parse_dmar(struct
         entry_header = ((void *)entry_header + entry_header->length);
     }
 
-    /* Zap APCI DMAR signature to prevent dom0 using vt-d HW. */
-    dmar->header.signature[0] = '\0';
-
     if ( ret )
     {
         if ( force_iommu )
@@ -579,6 +582,9 @@ static int __init acpi_parse_dmar(struct
         }
     }
 
+out:
+    /* Zap ACPI DMAR signature to prevent dom0 using vt-d HW. */
+    dmar->header.signature[0] = '\0';
     return ret;
 }
 
@@ -599,9 +605,6 @@ int acpi_dmar_init(void)
     if ( force_iommu )
         iommu_enabled = 1;
 
-    if ( !iommu_enabled )
-        goto fail;
-
     rc = parse_dmar_table(acpi_parse_dmar);
     if ( rc )
         goto fail;

_______________________________________________
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: prevent dom0 to use VT-d HW, Xen patchbot-unstable <=