aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/intel-iommu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iommu/intel-iommu.c')
-rw-r--r--drivers/iommu/intel-iommu.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 237ef52c8c76..e5883602cb35 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -580,17 +580,18 @@ static void domain_update_iommu_snooping(struct dmar_domain *domain)
580 580
581static void domain_update_iommu_superpage(struct dmar_domain *domain) 581static void domain_update_iommu_superpage(struct dmar_domain *domain)
582{ 582{
583 int i, mask = 0xf; 583 struct dmar_drhd_unit *drhd;
584 struct intel_iommu *iommu = NULL;
585 int mask = 0xf;
584 586
585 if (!intel_iommu_superpage) { 587 if (!intel_iommu_superpage) {
586 domain->iommu_superpage = 0; 588 domain->iommu_superpage = 0;
587 return; 589 return;
588 } 590 }
589 591
590 domain->iommu_superpage = 4; /* 1TiB */ 592 /* set iommu_superpage to the smallest common denominator */
591 593 for_each_active_iommu(iommu, drhd) {
592 for_each_set_bit(i, &domain->iommu_bmp, g_num_of_iommus) { 594 mask &= cap_super_page_val(iommu->cap);
593 mask |= cap_super_page_val(g_iommus[i]->cap);
594 if (!mask) { 595 if (!mask) {
595 break; 596 break;
596 } 597 }
@@ -3748,6 +3749,7 @@ static int intel_iommu_domain_init(struct iommu_domain *domain)
3748 vm_domain_exit(dmar_domain); 3749 vm_domain_exit(dmar_domain);
3749 return -ENOMEM; 3750 return -ENOMEM;
3750 } 3751 }
3752 domain_update_iommu_cap(dmar_domain);
3751 domain->priv = dmar_domain; 3753 domain->priv = dmar_domain;
3752 3754
3753 return 0; 3755 return 0;