mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
iommu/amd: make sure TLB to be flushed before IOVA freed
[ Upstream commit3c120143f5] Although the mapping has already been removed in the page table, it maybe still exist in TLB. Suppose the freed IOVAs is reused by others before the flush operation completed, the new user can not correctly access to its meomory. Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Fixes:b1516a1465('iommu/amd: Implement flush queue') Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -2452,9 +2452,9 @@ static void __unmap_single(struct dma_ops_domain *dma_dom,
|
||||
}
|
||||
|
||||
if (amd_iommu_unmap_flush) {
|
||||
dma_ops_free_iova(dma_dom, dma_addr, pages);
|
||||
domain_flush_tlb(&dma_dom->domain);
|
||||
domain_flush_complete(&dma_dom->domain);
|
||||
dma_ops_free_iova(dma_dom, dma_addr, pages);
|
||||
} else {
|
||||
queue_add(dma_dom, dma_addr, pages);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user