summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/intel-iommu.c
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2019-06-11 20:28:47 -0400
committerJoerg Roedel <jroedel@suse.de>2019-06-12 04:36:59 -0400
commit6a8c6748b94b0968a2f72d4bd2231eae703c0b13 (patch)
tree7597d0f6839a4b4773237413f096eea76fd4f383 /drivers/iommu/intel-iommu.c
parentc57b260a7d7d60dfbcf794dd9836c1d9fdbf5434 (diff)
iommu/vt-d: Don't enable iommu's which have been ignored
The iommu driver will ignore some iommu units if there's no device under its scope or those devices have been explicitly set to bypass the DMA translation. Don't enable those iommu units, otherwise the devices under its scope won't work. Fixes: d8190dc638866 ("iommu/vt-d: Enable DMA remapping after rmrr mapped") Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/intel-iommu.c')
-rw-r--r--drivers/iommu/intel-iommu.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 862c978d3eb4..03946dc4941f 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -3268,7 +3268,12 @@ static int __init init_dmars(void)
3268 goto error; 3268 goto error;
3269 } 3269 }
3270 3270
3271 for_each_active_iommu(iommu, drhd) { 3271 for_each_iommu(iommu, drhd) {
3272 if (drhd->ignored) {
3273 iommu_disable_translation(iommu);
3274 continue;
3275 }
3276
3272 /* 3277 /*
3273 * Find the max pasid size of all IOMMU's in the system. 3278 * Find the max pasid size of all IOMMU's in the system.
3274 * We need to ensure the system pasid table is no bigger 3279 * We need to ensure the system pasid table is no bigger
@@ -4821,7 +4826,7 @@ int __init intel_iommu_init(void)
4821 4826
4822 /* Finally, we enable the DMA remapping hardware. */ 4827 /* Finally, we enable the DMA remapping hardware. */
4823 for_each_iommu(iommu, drhd) { 4828 for_each_iommu(iommu, drhd) {
4824 if (!translation_pre_enabled(iommu)) 4829 if (!drhd->ignored && !translation_pre_enabled(iommu))
4825 iommu_enable_translation(iommu); 4830 iommu_enable_translation(iommu);
4826 4831
4827 iommu_disable_protect_mem_regions(iommu); 4832 iommu_disable_protect_mem_regions(iommu);