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: Fix some dmar bugs

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vtd: Fix some dmar bugs
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 29 Jul 2008 11:30:11 -0700
Delivery-date: Tue, 29 Jul 2008 11:30:01 -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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] vtd: Fix some dmar bugs, Xen patchbot-unstable <=