]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iommu/vt-d: Always reserve a domain ID for identity setup
authorLu Baolu <baolu.lu@linux.intel.com>
Mon, 2 Sep 2024 02:27:13 +0000 (10:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:00:27 +0000 (12:00 +0200)
[ Upstream commit 2c13012e09190174614fd6901857a1b8c199e17d ]

We will use a global static identity domain. Reserve a static domain ID
for it.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Link: https://lore.kernel.org/r/20240809055431.36513-4-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/intel/iommu.c

index e9bea0305c2681d65ee7c74a000c125e1d7e5005..eed67326976d3d1fc6c0f7ecd7e7740ece524e5a 100644 (file)
@@ -1462,10 +1462,10 @@ static int iommu_init_domains(struct intel_iommu *iommu)
         * entry for first-level or pass-through translation modes should
         * be programmed with a domain id different from those used for
         * second-level or nested translation. We reserve a domain id for
-        * this purpose.
+        * this purpose. This domain id is also used for identity domain
+        * in legacy mode.
         */
-       if (sm_supported(iommu))
-               set_bit(FLPT_DEFAULT_DID, iommu->domain_ids);
+       set_bit(FLPT_DEFAULT_DID, iommu->domain_ids);
 
        return 0;
 }