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

[Xen-changelog] [xen-unstable] vtd: There is only one INCLUDE_ALL DMAR unit in system, but no



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1216975541 -3600
# Node ID 5e44f5d764323c713ee804c5b78087c652bd9747
# Parent  7b6942ad565c95a770d53f3670b69b010ef4d4b1
vtd: There is only one INCLUDE_ALL DMAR unit in system, but no
restriction on whether it's the last unit.

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

diff -r 7b6942ad565c -r 5e44f5d76432 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c        Fri Jul 25 09:44:48 2008 +0100
+++ b/xen/drivers/passthrough/vtd/dmar.c        Fri Jul 25 09:45:41 2008 +0100
@@ -255,7 +255,7 @@ static int __init acpi_parse_dev_scope(v
             break;
         }
 
-       case ACPI_DEV_MSI_HPET:
+        case ACPI_DEV_MSI_HPET:
             dprintk(XENLOG_INFO VTDPREFIX, "found MSI HPET: bdf = %x:%x.%x\n",
                     bus, path->dev, path->fn);
             scope->devices[didx++] = PCI_BDF(bus, path->dev, path->fn);
@@ -305,13 +305,6 @@ acpi_parse_one_drhd(struct acpi_dmar_ent
     int ret = 0;
     static int include_all = 0;
 
-    if ( include_all )
-    {
-        dprintk(XENLOG_WARNING VTDPREFIX,
-                "DMAR unit with INCLUDE_ALL is not not the last unit.\n");
-        return -EINVAL;
-    }
-
     dmaru = xmalloc(struct acpi_drhd_unit);
     if ( !dmaru )
         return -ENOMEM;
@@ -331,10 +324,17 @@ acpi_parse_one_drhd(struct acpi_dmar_ent
     if ( dmaru->include_all )
     {
         dprintk(XENLOG_INFO VTDPREFIX, "found INCLUDE_ALL\n");
+        /* Only allow one INCLUDE_ALL */
+        if ( include_all )
+        {
+            dprintk(XENLOG_WARNING VTDPREFIX,
+                    "Onlyu onw INCLUDE_ALL device scope is allowed\n");
+            return -EINVAL;
+        }
         include_all = 1;
     }
 
-    if ( ret )
+    if ( ret || (dmaru->scope.devices_cnt == 0 && !dmaru->include_all) )
         xfree(dmaru);
     else
         acpi_register_drhd_unit(dmaru);

_______________________________________________
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®.