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] don't enable device ATS if root por

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [VTD] don't enable device ATS if root port does not support it
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 06 Oct 2009 02:15:10 -0700
Delivery-date: Tue, 06 Oct 2009 02:15:13 -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 1254820274 -3600
# Node ID e39acea851f48598114a3c8ab90afc5a97b33952
# Parent  56ab22093d645c33f0e6f878362ac9b3eb1b4226
[VTD] don't enable device ATS if root port does not support it

Fixed a bug in the code that enables ATS capability on the device even
when root port does not support it.

Signed-off-by: Allen Kay <allen.m.kay@xxxxxxxxx>
---
 xen/drivers/passthrough/vtd/x86/ats.c |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diff -r 56ab22093d64 -r e39acea851f4 xen/drivers/passthrough/vtd/x86/ats.c
--- a/xen/drivers/passthrough/vtd/x86/ats.c     Tue Oct 06 10:09:21 2009 +0100
+++ b/xen/drivers/passthrough/vtd/x86/ats.c     Tue Oct 06 10:11:14 2009 +0100
@@ -118,8 +118,10 @@ int enable_ats_device(int seg, int bus, 
     u16 queue_depth;
     int pos;
 
+    if ( acpi_find_matched_atsr_unit(bus, devfn) )
+        return 0;
+
     pos = pci_find_ext_capability(seg, bus, devfn, PCI_EXT_CAP_ID_ATS);
-
     if ( !pos )
     {
         dprintk(XENLOG_ERR VTDPREFIX, "ats capability not found %x:%x:%x\n",
@@ -135,21 +137,18 @@ int enable_ats_device(int seg, int bus, 
                             PCI_FUNC(devfn), pos + ATS_REG_CAP);
     queue_depth = value & ATS_QUEUE_DEPTH_MASK;
 
-    /* BUGBUG: add back seg when multi-seg platform support is enabled */
-    value = pci_conf_read16(bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos + 
ATS_REG_CTL);
+    value = pci_conf_read16(bus, PCI_SLOT(devfn),
+                            PCI_FUNC(devfn), pos + ATS_REG_CTL);
     value |= ATS_ENABLE;
-
-    /* BUGBUG: add back seg when multi-seg platform support is enabled */
-    pci_conf_write16(bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos + ATS_REG_CTL, 
value);
-
-    if ( acpi_find_matched_atsr_unit(bus, devfn) )
-    {
-        pdev = xmalloc(struct pci_ats_dev);
-        pdev->bus = bus;
-        pdev->devfn = devfn;
-        pdev->ats_queue_depth = queue_depth;
-        list_add(&(pdev->list), &ats_devices);
-    }
+    pci_conf_write16(bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                     pos + ATS_REG_CTL, value);
+
+    pdev = xmalloc(struct pci_ats_dev);
+    pdev->bus = bus;
+    pdev->devfn = devfn;
+    pdev->ats_queue_depth = queue_depth;
+    list_add(&(pdev->list), &ats_devices);
+
     return pos;
 }        
 

_______________________________________________
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] don't enable device ATS if root port does not support it, Xen patchbot-unstable <=