iommu/vt-d: Add domain_flush_pasid_iotlb()
authorLu Baolu <baolu.lu@linux.intel.com>
Wed, 9 Aug 2023 12:47:56 +0000 (20:47 +0800)
committerJoerg Roedel <jroedel@suse.de>
Wed, 9 Aug 2023 15:44:37 +0000 (17:44 +0200)
commitac1a3483febd0ec8fced1ccb15da349dcc360fbb
treeca018892615b5bf5ac3ca2bfaf5b2f61bd38499f
parent2dcebc7ddce7ffd4015824227c7623558b89d721
iommu/vt-d: Add domain_flush_pasid_iotlb()

The VT-d spec requires to use PASID-based-IOTLB invalidation descriptor
to invalidate IOTLB and the paging-structure caches for a first-stage
page table. Add a generic helper to do this.

RID2PASID is used if the domain has been attached to a physical device,
otherwise real PASIDs that the domain has been attached to will be used.
The 'real' PASID attachment is handled in the subsequent change.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20230802212427.1497170-4-jacob.jun.pan@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c