ia64/xen-unstable

changeset 19766:133c889c21a7

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@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 16 13:41:17 2009 +0100 (2009-06-16)
parents f2a3b7188906
children cb6f8a34b59a
files xen/drivers/passthrough/vtd/qinval.c xen/drivers/passthrough/vtd/x86/ats.c
line diff
     1.1 --- a/xen/drivers/passthrough/vtd/qinval.c	Tue Jun 16 13:39:00 2009 +0100
     1.2 +++ b/xen/drivers/passthrough/vtd/qinval.c	Tue Jun 16 13:41:17 2009 +0100
     1.3 @@ -29,8 +29,6 @@
     1.4  #include "vtd.h"
     1.5  #include "extern.h"
     1.6  
     1.7 -int qinval_enabled;
     1.8 -
     1.9  static void print_qi_regs(struct iommu *iommu)
    1.10  {
    1.11      u64 val;
    1.12 @@ -465,7 +463,6 @@ int enable_qinval(struct iommu *iommu)
    1.13                    (sts & DMA_GSTS_QIES), sts);
    1.14      spin_unlock_irqrestore(&iommu->register_lock, flags);
    1.15  
    1.16 -    qinval_enabled = 1;
    1.17      return 0;
    1.18  }
    1.19  
     2.1 --- a/xen/drivers/passthrough/vtd/x86/ats.c	Tue Jun 16 13:39:00 2009 +0100
     2.2 +++ b/xen/drivers/passthrough/vtd/x86/ats.c	Tue Jun 16 13:41:17 2009 +0100
     2.3 @@ -87,15 +87,13 @@ int ats_device(int seg, int bus, int dev
     2.4      struct pci_dev *pdev;
     2.5      int pos = 0;
     2.6  
     2.7 -    if ( !ats_enabled )
     2.8 -        return 0;
     2.9 -
    2.10 -    if ( !qinval_enabled )
    2.11 +    if ( !ats_enabled || !iommu_qinval )
    2.12          return 0;
    2.13  
    2.14      pdev = pci_get_pdev(bus, devfn);
    2.15      drhd = acpi_find_matched_drhd_unit(pdev);
    2.16 -    if ( !ecap_dev_iotlb(drhd->iommu->ecap) )
    2.17 +    if ( !ecap_queued_inval(drhd->iommu->ecap) ||
    2.18 +         !ecap_dev_iotlb(drhd->iommu->ecap) )
    2.19          return 0;
    2.20  
    2.21      if ( !acpi_find_matched_atsr_unit(bus, devfn) )