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

[Xen-changelog] [xen-unstable] vtd: Fix some dmar bugs



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1217324501 -3600
# Node ID 507045f254e91bd19251c7b327be8f0540561c0d
# Parent  7f65527eacd63c8ecca819ca0712801d56658d6b
vtd: Fix some dmar bugs

In acpi_parse_one_drhd(), remove return directly when only one
INCLUDE_ALL check fails, so that avoid memory leak. In addition,
remove "dmaru->scope.devices_cnt == 0 && !dmaru->include_all" check,
due to PCI-PCI bridges are not counted.

This patch fixes bug #1307.

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

diff -r 7f65527eacd6 -r 507045f254e9 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c        Tue Jul 29 10:05:32 2008 +0100
+++ b/xen/drivers/passthrough/vtd/dmar.c        Tue Jul 29 10:41:41 2008 +0100
@@ -238,15 +238,15 @@ static int __init acpi_parse_dev_scope(v
             bus = pci_conf_read8(bus, path->dev, path->fn, PCI_SECONDARY_BUS);
             path++;
         }
-        
+
         switch ( acpi_scope->dev_type )
         {
         case ACPI_DEV_P2PBRIDGE:
         {
             sec_bus = pci_conf_read8(
-               bus, path->dev, path->fn, PCI_SECONDARY_BUS);
+                bus, path->dev, path->fn, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(
-               bus, path->dev, path->fn, PCI_SUBORDINATE_BUS);
+                bus, path->dev, path->fn, PCI_SUBORDINATE_BUS);
             dprintk(XENLOG_INFO VTDPREFIX,
                     "found bridge: bdf = %x:%x.%x  sec = %x  sub = %x\n",
                     bus, path->dev, path->fn, sec_bus, sub_bus);
@@ -328,13 +328,13 @@ acpi_parse_one_drhd(struct acpi_dmar_ent
         if ( include_all )
         {
             dprintk(XENLOG_WARNING VTDPREFIX,
-                    "Onlyu onw INCLUDE_ALL device scope is allowed\n");
-            return -EINVAL;
+                    "Only one INCLUDE_ALL device scope is allowed\n");
+            ret = -EINVAL;
         }
         include_all = 1;
     }
 
-    if ( ret || (dmaru->scope.devices_cnt == 0 && !dmaru->include_all) )
+    if ( ret )
         xfree(dmaru);
     else
         acpi_register_drhd_unit(dmaru);
@@ -396,7 +396,8 @@ acpi_parse_one_atsr(struct acpi_dmar_ent
         ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
                                    atsru, ATSR_TYPE);
     }
-    else {
+    else
+    {
         dprintk(XENLOG_INFO VTDPREFIX, "found ALL_PORTS\n");
         /* Only allow one ALL_PORTS */
         if ( all_ports )

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