iommu/vt-d: Update the definition of the blocking domain
authorJason Gunthorpe <jgg@nvidia.com>
Wed, 27 Sep 2023 23:47:32 +0000 (20:47 -0300)
committerJoerg Roedel <jroedel@suse.de>
Thu, 26 Oct 2023 14:53:50 +0000 (16:53 +0200)
The global static should pre-define the type and the NOP free function can
be now left as NULL.

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Sven Peter <sven@svenpeter.dev>
Link: https://lore.kernel.org/r/2-v2-bff223cf6409+282-dart_paging_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c

index 5db283c17e0dc5cd7ffd0147efec316595df53c8..6b0276b67caa6c3a8be7e0ab8303963b65d1c215 100644 (file)
@@ -4029,9 +4029,9 @@ static int blocking_domain_attach_dev(struct iommu_domain *domain,
 }
 
 static struct iommu_domain blocking_domain = {
+       .type = IOMMU_DOMAIN_BLOCKED,
        .ops = &(const struct iommu_domain_ops) {
                .attach_dev     = blocking_domain_attach_dev,
-               .free           = intel_iommu_domain_free
        }
 };
 
@@ -4076,7 +4076,7 @@ static struct iommu_domain *intel_iommu_domain_alloc(unsigned type)
 
 static void intel_iommu_domain_free(struct iommu_domain *domain)
 {
-       if (domain != &si_domain->domain && domain != &blocking_domain)
+       if (domain != &si_domain->domain)
                domain_exit(to_dmar_domain(domain));
 }