[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] vtd: Simplify acpi_dmar_init().



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.