Skip to content

Commit 04b1b06

Browse files
yiliu1765joergroedel
authored andcommitted
iommu/vt-d: Flush piotlb for SVM and Nested domain
Besides the paging domains that use FS, SVM and Nested domains need to use piotlb invalidation descriptor as well. Fixes: b331252 ("iommu/vt-d: Create unique domain ops for each stage") Cc: stable@vger.kernel.org Signed-off-by: Yi Liu <yi.l.liu@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Link: https://lore.kernel.org/r/20251223065824.6164-1-yi.l.liu@intel.com Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
1 parent 22d169b commit 04b1b06

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

drivers/iommu/intel/cache.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,14 +363,21 @@ static void qi_batch_add_pasid_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16
363363
qi_batch_increment_index(iommu, batch);
364364
}
365365

366+
static bool intel_domain_use_piotlb(struct dmar_domain *domain)
367+
{
368+
return domain->domain.type == IOMMU_DOMAIN_SVA ||
369+
domain->domain.type == IOMMU_DOMAIN_NESTED ||
370+
intel_domain_is_fs_paging(domain);
371+
}
372+
366373
static void cache_tag_flush_iotlb(struct dmar_domain *domain, struct cache_tag *tag,
367374
unsigned long addr, unsigned long pages,
368375
unsigned long mask, int ih)
369376
{
370377
struct intel_iommu *iommu = tag->iommu;
371378
u64 type = DMA_TLB_PSI_FLUSH;
372379

373-
if (intel_domain_is_fs_paging(domain)) {
380+
if (intel_domain_use_piotlb(domain)) {
374381
qi_batch_add_piotlb(iommu, tag->domain_id, tag->pasid, addr,
375382
pages, ih, domain->qi_batch);
376383
return;

0 commit comments

Comments
 (0)