diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-06 09:22:39 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-06 09:22:39 -0700 |
commit | cc77b4db0017dab014ad7ea3d297e10f5b5bf028 (patch) | |
tree | 31d022e12b81d4870b00a766ba8ae085bb34f382 | |
parent | 132a4edb2b69924742f62dc06ace42ad2a9f57f3 (diff) | |
parent | 7a42c4ff02d1bd764804a4ba36c2b839070c5e7d (diff) |
Merge branch 'core-iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86/amd-iommu: Export cache-coherency capability
iommu-api: Extension to check for interrupt remapping
x86/amd-iommu: Use for_each_pci_dev()
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 8 | ||||
-rw-r--r-- | drivers/pci/intel-iommu.c | 2 | ||||
-rw-r--r-- | include/linux/iommu.h | 1 |
3 files changed, 9 insertions, 2 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 0d20286d78c..fa044e1e30a 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c @@ -2572,6 +2572,11 @@ static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom, static int amd_iommu_domain_has_cap(struct iommu_domain *domain, unsigned long cap) { + switch (cap) { + case IOMMU_CAP_CACHE_COHERENCY: + return 1; + } + return 0; } @@ -2609,8 +2614,7 @@ int __init amd_iommu_init_passthrough(void) pt_domain->mode |= PAGE_MODE_NONE; - while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { - + for_each_pci_dev(dev) { if (!check_device(&dev->dev)) continue; diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index c9171be7456..6a5af18faf6 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c @@ -3698,6 +3698,8 @@ static int intel_iommu_domain_has_cap(struct iommu_domain *domain, if (cap == IOMMU_CAP_CACHE_COHERENCY) return dmar_domain->iommu_snooping; + if (cap == IOMMU_CAP_INTR_REMAP) + return intr_remapping_enabled; return 0; } diff --git a/include/linux/iommu.h b/include/linux/iommu.h index be22ad83689..0a2ba409899 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -30,6 +30,7 @@ struct iommu_domain { }; #define IOMMU_CAP_CACHE_COHERENCY 0x1 +#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ struct iommu_ops { int (*domain_init)(struct iommu_domain *domain); |