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: Simplify acpi_dmar_init().

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vtd: Simplify acpi_dmar_init().
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Oct 2009 10:35:12 -0700
Delivery-date: Wed, 28 Oct 2009 10:35:27 -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 1256750829 0
# Node ID 62313648c9f5bb6fc1a9b3a8f3fca88c13719914
# Parent  a2c17e320c47e4d188d8b32b8543ed8e8852e8b2
vtd: Simplify acpi_dmar_init().

No need to check force_iommu, as that is done later in common code.

Also no need to clear iommu_enabled as again this gets checked
later. Furthermore doing it here, from a non-Intel-specific callsite,
breaks other vendors' IOMMU support.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/drivers/passthrough/vtd/dmar.c |   47 +++++--------------------------------
 1 files changed, 7 insertions(+), 40 deletions(-)

diff -r a2c17e320c47 -r 62313648c9f5 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c        Wed Oct 28 17:08:26 2009 +0000
+++ b/xen/drivers/passthrough/vtd/dmar.c        Wed Oct 28 17:27:09 2009 +0000
@@ -527,9 +527,6 @@ static int __init acpi_parse_dmar(struct
     if ( !dmar->width )
     {
         dprintk(XENLOG_WARNING VTDPREFIX, "Zero: Invalid DMAR width\n");
-        if ( force_iommu )
-            panic("acpi_parse_dmar: Invalid DMAR width,"
-                  " crash Xen for security purpose!\n");
         return -EINVAL;
     }
 
@@ -572,15 +569,9 @@ static int __init acpi_parse_dmar(struct
 
     if ( ret )
     {
-        if ( force_iommu )
-            panic("acpi_parse_dmar: Failed to parse ACPI DMAR,"
-                  " crash Xen for security purpose!\n");
-        else
-        {
-            printk(XENLOG_WARNING
-                   "Failed to parse ACPI DMAR.  Disabling VT-d.\n");
-            disable_all_dmar_units();
-        }
+        printk(XENLOG_WARNING
+               "Failed to parse ACPI DMAR.  Disabling VT-d.\n");
+        disable_all_dmar_units();
     }
 
 out:
@@ -598,31 +589,7 @@ out:
 #define parse_dmar_table(h) acpi_table_parse(ACPI_SIG_DMAR, h)
 #endif
 
-int acpi_dmar_init(void)
-{
-    int rc;
-
-    rc = -ENODEV;
-    if ( force_iommu )
-        iommu_enabled = 1;
-
-    rc = parse_dmar_table(acpi_parse_dmar);
-    if ( rc )
-        goto fail;
-
-    rc = -ENODEV;
-    if ( list_empty(&acpi_drhd_units) )
-        goto fail;
-
-    printk("Intel VT-d DMAR tables have been parsed.\n");
-
-    return 0;
-
- fail:
-    if ( force_iommu )
-        panic("acpi_dmar_init: acpi_dmar_init failed,"
-              " crash Xen for security purpose!\n");
-
-    iommu_enabled = 0;
-    return -ENODEV;
-}
+int __init acpi_dmar_init(void)
+{
+    return parse_dmar_table(acpi_parse_dmar);
+}

_______________________________________________
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: Simplify acpi_dmar_init()., Xen patchbot-unstable <=