Skip to content

Commit a600ccd

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Use cache_tag_flush_range() in tlb_sync
The tlb_sync callback is called by the iommu core to flush a range of caches for the affected domain. Use cache_tag_flush_range() in this callback. Signed-off-by: Lu Baolu <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 4e589a5 commit a600ccd

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4104,25 +4104,8 @@ static size_t intel_iommu_unmap_pages(struct iommu_domain *domain,
41044104
static void intel_iommu_tlb_sync(struct iommu_domain *domain,
41054105
struct iommu_iotlb_gather *gather)
41064106
{
4107-
struct dmar_domain *dmar_domain = to_dmar_domain(domain);
4108-
unsigned long iova_pfn = IOVA_PFN(gather->start);
4109-
size_t size = gather->end - gather->start;
4110-
struct iommu_domain_info *info;
4111-
unsigned long start_pfn;
4112-
unsigned long nrpages;
4113-
unsigned long i;
4114-
4115-
nrpages = aligned_nrpages(gather->start, size);
4116-
start_pfn = mm_to_dma_pfn_start(iova_pfn);
4117-
4118-
xa_for_each(&dmar_domain->iommu_array, i, info)
4119-
iommu_flush_iotlb_psi(info->iommu, dmar_domain,
4120-
start_pfn, nrpages,
4121-
list_empty(&gather->freelist), 0);
4122-
4123-
if (dmar_domain->nested_parent)
4124-
parent_domain_flush(dmar_domain, start_pfn, nrpages,
4125-
list_empty(&gather->freelist));
4107+
cache_tag_flush_range(to_dmar_domain(domain), gather->start,
4108+
gather->end, list_empty(&gather->freelist));
41264109
put_pages_list(&gather->freelist);
41274110
}
41284111

0 commit comments

Comments
 (0)