aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/intel-iommu.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index e3e84cac0e98..466079535330 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -1530,12 +1530,15 @@ static int domain_context_mapping_one(struct dmar_domain *domain, int segment,
1530 1530
1531 /* Skip top levels of page tables for 1531 /* Skip top levels of page tables for
1532 * iommu which has less agaw than default. 1532 * iommu which has less agaw than default.
1533 * Unnecessary for PT mode.
1533 */ 1534 */
1534 for (agaw = domain->agaw; agaw != iommu->agaw; agaw--) { 1535 if (translation != CONTEXT_TT_PASS_THROUGH) {
1535 pgd = phys_to_virt(dma_pte_addr(pgd)); 1536 for (agaw = domain->agaw; agaw != iommu->agaw; agaw--) {
1536 if (!dma_pte_present(pgd)) { 1537 pgd = phys_to_virt(dma_pte_addr(pgd));
1537 spin_unlock_irqrestore(&iommu->lock, flags); 1538 if (!dma_pte_present(pgd)) {
1538 return -ENOMEM; 1539 spin_unlock_irqrestore(&iommu->lock, flags);
1540 return -ENOMEM;
1541 }
1539 } 1542 }
1540 } 1543 }
1541 } 1544 }