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)
committerJoerg Roedel <jroedel@suse.de>
Mon, 27 Nov 2023 10:07:51 +0000 (11:07 +0100)
commit0f5432a9b839847dcfe9fa369d72e3d646102ddf
treecb0c12860a622c6794190d764a0edd5fe3adc5db
parente645c20e8e9cde549bc233435d3c1338e1cd27fe
iommu/vt-d: Omit devTLB invalidation requests when TES=0

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>
drivers/iommu/intel/dmar.c