aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/amd_iommu.c8
-rw-r--r--drivers/pci/intel-iommu.c2
-rw-r--r--include/linux/iommu.h1
3 files changed, 9 insertions, 2 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 0d20286d78c6..fa044e1e30a2 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,
2572static int amd_iommu_domain_has_cap(struct iommu_domain *domain, 2572static int amd_iommu_domain_has_cap(struct iommu_domain *domain,
2573 unsigned long cap) 2573 unsigned long cap)
2574{ 2574{
2575 switch (cap) {
2576 case IOMMU_CAP_CACHE_COHERENCY:
2577 return 1;
2578 }
2579
2575 return 0; 2580 return 0;
2576} 2581}
2577 2582
@@ -2609,8 +2614,7 @@ int __init amd_iommu_init_passthrough(void)
2609 2614
2610 pt_domain->mode |= PAGE_MODE_NONE; 2615 pt_domain->mode |= PAGE_MODE_NONE;
2611 2616
2612 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 2617 for_each_pci_dev(dev) {
2613
2614 if (!check_device(&dev->dev)) 2618 if (!check_device(&dev->dev))
2615 continue; 2619 continue;
2616 2620
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index c9171be74564..6a5af18faf68 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,
3698 3698
3699 if (cap == IOMMU_CAP_CACHE_COHERENCY) 3699 if (cap == IOMMU_CAP_CACHE_COHERENCY)
3700 return dmar_domain->iommu_snooping; 3700 return dmar_domain->iommu_snooping;
3701 if (cap == IOMMU_CAP_INTR_REMAP)
3702 return intr_remapping_enabled;
3701 3703
3702 return 0; 3704 return 0;
3703} 3705}
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index be22ad83689c..0a2ba4098996 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -30,6 +30,7 @@ struct iommu_domain {
30}; 30};
31 31
32#define IOMMU_CAP_CACHE_COHERENCY 0x1 32#define IOMMU_CAP_CACHE_COHERENCY 0x1
33#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */
33 34
34struct iommu_ops { 35struct iommu_ops {
35 int (*domain_init)(struct iommu_domain *domain); 36 int (*domain_init)(struct iommu_domain *domain);