]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iommu/vt-d: Remove domain_update_iommu_superpage()
authorLu Baolu <baolu.lu@linux.intel.com>
Mon, 4 Nov 2024 01:40:25 +0000 (09:40 +0800)
committerJoerg Roedel <jroedel@suse.de>
Tue, 5 Nov 2024 12:32:18 +0000 (13:32 +0100)
The requirement for consistent super page support across all the IOMMU
hardware in the system has been removed. In the past, if a new IOMMU
was hot-added and lacked consistent super page capability, the hot-add
process would be aborted. However, with the updated attachment semantics,
it is now permissible for the super page capability to vary among
different IOMMU hardware units.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20241021085125.192333-6-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c

index 756caa24008f0045de238cabaa07e08d8334667b..36854b683b11f5bf3120b60819397b1cf288b3cc 100644 (file)
@@ -352,36 +352,6 @@ static bool iommu_paging_structure_coherency(struct intel_iommu *iommu)
                        ecap_smpwc(iommu->ecap) : ecap_coherent(iommu->ecap);
 }
 
-static int domain_update_iommu_superpage(struct dmar_domain *domain,
-                                        struct intel_iommu *skip)
-{
-       struct dmar_drhd_unit *drhd;
-       struct intel_iommu *iommu;
-       int mask = 0x3;
-
-       if (!intel_iommu_superpage)
-               return 0;
-
-       /* set iommu_superpage to the smallest common denominator */
-       rcu_read_lock();
-       for_each_active_iommu(iommu, drhd) {
-               if (iommu != skip) {
-                       if (domain && domain->use_first_level) {
-                               if (!cap_fl1gp_support(iommu->cap))
-                                       mask = 0x1;
-                       } else {
-                               mask &= cap_super_page_val(iommu->cap);
-                       }
-
-                       if (!mask)
-                               break;
-               }
-       }
-       rcu_read_unlock();
-
-       return fls(mask);
-}
-
 /* Return the super pagesize bitmap if supported. */
 static unsigned long domain_super_pgsize_bitmap(struct dmar_domain *domain)
 {
@@ -2605,20 +2575,13 @@ int dmar_parse_one_satc(struct acpi_dmar_header *hdr, void *arg)
 
 static int intel_iommu_add(struct dmar_drhd_unit *dmaru)
 {
-       int sp, ret;
        struct intel_iommu *iommu = dmaru->iommu;
+       int ret;
 
        ret = intel_cap_audit(CAP_AUDIT_HOTPLUG_DMAR, iommu);
        if (ret)
                goto out;
 
-       sp = domain_update_iommu_superpage(NULL, iommu) - 1;
-       if (sp >= 0 && !(cap_super_page_val(iommu->cap) & (1 << sp))) {
-               pr_warn("%s: Doesn't support large page.\n",
-                       iommu->name);
-               return -ENXIO;
-       }
-
        /*
         * Disable translation if already enabled prior to OS handover.
         */