summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorSheng Yang2009-03-18 08:33:06 +0100
committerDavid Woodhouse2009-03-24 10:42:51 +0100
commitdbb9fd8630e95b6155aff658a2b5f80e95ca2bc6 (patch)
treeb24caff50e1c5bfb428cb7422608bfef95d916e8 /drivers/pci
parentintel-iommu: Snooping control support (diff)
downloadkernel-qcow2-linux-dbb9fd8630e95b6155aff658a2b5f80e95ca2bc6.tar.gz
kernel-qcow2-linux-dbb9fd8630e95b6155aff658a2b5f80e95ca2bc6.tar.xz
kernel-qcow2-linux-dbb9fd8630e95b6155aff658a2b5f80e95ca2bc6.zip
iommu: Add domain_has_cap iommu_ops
This iommu_op can tell if domain have a specific capability, like snooping control for Intel IOMMU, which can be used by other components of kernel to adjust the behaviour. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/intel-iommu.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index be999ff025af..3778ab149baf 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -3158,6 +3158,17 @@ static phys_addr_t intel_iommu_iova_to_phys(struct iommu_domain *domain,
return phys;
}
+static int intel_iommu_domain_has_cap(struct iommu_domain *domain,
+ unsigned long cap)
+{
+ struct dmar_domain *dmar_domain = domain->priv;
+
+ if (cap == IOMMU_CAP_CACHE_COHERENCY)
+ return dmar_domain->iommu_snooping;
+
+ return 0;
+}
+
static struct iommu_ops intel_iommu_ops = {
.domain_init = intel_iommu_domain_init,
.domain_destroy = intel_iommu_domain_destroy,
@@ -3166,6 +3177,7 @@ static struct iommu_ops intel_iommu_ops = {
.map = intel_iommu_map_range,
.unmap = intel_iommu_unmap_range,
.iova_to_phys = intel_iommu_iova_to_phys,
+ .domain_has_cap = intel_iommu_domain_has_cap,
};
static void __devinit quirk_iommu_rwbf(struct pci_dev *dev)