]> git.dujemihanovic.xyz Git - linux.git/commit
iommu/vt-d: Fix missed device TLB cache tag
authorLu Baolu <baolu.lu@linux.intel.com>
Thu, 20 Jun 2024 06:29:40 +0000 (14:29 +0800)
committerJoerg Roedel <jroedel@suse.de>
Thu, 27 Jun 2024 10:14:19 +0000 (12:14 +0200)
commit041be2717b198dd65032f726648401ba293c1bba
treedfb457adc47767c121bdb12486923d8c38e1096f
parentc362f32a59a84fe4453abecc6b53f5f70894a6d5
iommu/vt-d: Fix missed device TLB cache tag

When a domain is attached to a device, the required cache tags are
assigned to the domain so that the related caches can be flushed
whenever it is needed. The device TLB cache tag is created based
on whether the ats_enabled field of the device's iommu data is set.
This creates an ordered dependency between cache tag assignment and
ATS enabling.

The device TLB cache tag would not be created if device's ATS is
enabled after the cache tag assignment. This causes devices with PCI
ATS support to malfunction.

The ATS control is exclusively owned by the iommu driver. Hence, move
cache_tag_assign_domain() after PCI ATS enabling to make sure that the
device TLB cache tag is created for the domain.

Fixes: 3b1d9e2b2d68 ("iommu/vt-d: Add cache tag assignment interface")
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20240620062940.201786-1-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c