Skip to content

Commit 1f5e307

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Unconditionally flush device TLB for pasid table updates
The caching mode of an IOMMU is irrelevant to the behavior of the device TLB. Previously, commit <304b3bde24b5> ("iommu/vt-d: Remove caching mode check before device TLB flush") removed this redundant check in the domain unmap path. Checking the caching mode before flushing the device TLB after a pasid table entry is updated is unnecessary and can lead to inconsistent behavior. Extends this consistency by removing the caching mode check in the pasid table update path. Suggested-by: Yi Liu <[email protected]> Signed-off-by: Lu Baolu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent ccb02b2 commit 1f5e307

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

drivers/iommu/intel/pasid.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,7 @@ void intel_pasid_tear_down_entry(struct intel_iommu *iommu, struct device *dev,
264264
else
265265
iommu->flush.flush_iotlb(iommu, did, 0, 0, DMA_TLB_DSI_FLUSH);
266266

267-
/* Device IOTLB doesn't need to be flushed in caching mode. */
268-
if (!cap_caching_mode(iommu->cap))
269-
devtlb_invalidation_with_pasid(iommu, dev, pasid);
267+
devtlb_invalidation_with_pasid(iommu, dev, pasid);
270268
}
271269

272270
/*
@@ -493,9 +491,7 @@ int intel_pasid_setup_dirty_tracking(struct intel_iommu *iommu,
493491

494492
iommu->flush.flush_iotlb(iommu, did, 0, 0, DMA_TLB_DSI_FLUSH);
495493

496-
/* Device IOTLB doesn't need to be flushed in caching mode. */
497-
if (!cap_caching_mode(iommu->cap))
498-
devtlb_invalidation_with_pasid(iommu, dev, pasid);
494+
devtlb_invalidation_with_pasid(iommu, dev, pasid);
499495

500496
return 0;
501497
}
@@ -572,9 +568,7 @@ void intel_pasid_setup_page_snoop_control(struct intel_iommu *iommu,
572568
pasid_cache_invalidation_with_pasid(iommu, did, pasid);
573569
qi_flush_piotlb(iommu, did, pasid, 0, -1, 0);
574570

575-
/* Device IOTLB doesn't need to be flushed in caching mode. */
576-
if (!cap_caching_mode(iommu->cap))
577-
devtlb_invalidation_with_pasid(iommu, dev, pasid);
571+
devtlb_invalidation_with_pasid(iommu, dev, pasid);
578572
}
579573

580574
/**

0 commit comments

Comments
 (0)