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

[Xen-changelog] [xen-unstable] vtd: ats and queued invalidation cleanup



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1245156077 -3600
# Node ID 133c889c21a7596be60ab2a79d51b4ce9ded4521
# Parent  f2a3b71889068551ec42f1d3fe362cfab202fb40
vtd: ats and queued invalidation cleanup

Use iommu_qinval in place of qinval_enabled flag.  Use
ecap_queued_inval() for determining whether queued invalidation is
available on this vt-d engine or not.

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

diff -r f2a3b7188906 -r 133c889c21a7 xen/drivers/passthrough/vtd/qinval.c
--- a/xen/drivers/passthrough/vtd/qinval.c      Tue Jun 16 13:39:00 2009 +0100
+++ b/xen/drivers/passthrough/vtd/qinval.c      Tue Jun 16 13:41:17 2009 +0100
@@ -29,8 +29,6 @@
 #include "vtd.h"
 #include "extern.h"
 
-int qinval_enabled;
-
 static void print_qi_regs(struct iommu *iommu)
 {
     u64 val;
@@ -465,7 +463,6 @@ int enable_qinval(struct iommu *iommu)
                   (sts & DMA_GSTS_QIES), sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 
-    qinval_enabled = 1;
     return 0;
 }
 
diff -r f2a3b7188906 -r 133c889c21a7 xen/drivers/passthrough/vtd/x86/ats.c
--- a/xen/drivers/passthrough/vtd/x86/ats.c     Tue Jun 16 13:39:00 2009 +0100
+++ b/xen/drivers/passthrough/vtd/x86/ats.c     Tue Jun 16 13:41:17 2009 +0100
@@ -87,15 +87,13 @@ int ats_device(int seg, int bus, int dev
     struct pci_dev *pdev;
     int pos = 0;
 
-    if ( !ats_enabled )
-        return 0;
-
-    if ( !qinval_enabled )
+    if ( !ats_enabled || !iommu_qinval )
         return 0;
 
     pdev = pci_get_pdev(bus, devfn);
     drhd = acpi_find_matched_drhd_unit(pdev);
-    if ( !ecap_dev_iotlb(drhd->iommu->ecap) )
+    if ( !ecap_queued_inval(drhd->iommu->ecap) ||
+         !ecap_dev_iotlb(drhd->iommu->ecap) )
         return 0;
 
     if ( !acpi_find_matched_atsr_unit(bus, devfn) )

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