iommu/vt-d: Omit devTLB invalidation requests when TES=0
authorLu Baolu <baolu.lu@linux.intel.com>
Wed, 22 Nov 2023 03:26:03 +0000 (11:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Dec 2023 07:52:24 +0000 (08:52 +0100)
commit7ccb57771b9a7de9debb8da73884fb923e77aeef
tree083c6ffaaa2aa80b868f6486af0f4cf11cf90e22
parent59fe58d59070e60ea938f8d6d5435e85d16d9a71
iommu/vt-d: Omit devTLB invalidation requests when TES=0

[ Upstream commit 0f5432a9b839847dcfe9fa369d72e3d646102ddf ]

The latest VT-d spec indicates that when remapping hardware is disabled
(TES=0 in Global Status Register), upstream ATS Invalidation Completion
requests are treated as UR (Unsupported Request).

Consequently, the spec recommends in section 4.3 Handling of Device-TLB
Invalidations that software refrain from submitting any Device-TLB
invalidation requests when address remapping hardware is disabled.

Verify address remapping hardware is enabled prior to submitting Device-
TLB invalidation requests.

Fixes: 792fb43ce2c9 ("iommu/vt-d: Enable Intel IOMMU scalable mode by default")
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20231114011036.70142-2-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/intel/dmar.c