summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/amd_iommu_proto.h
diff options
context:
space:
mode:
authorTomasz Figa <tfiga@chromium.org>2015-04-20 20:43:44 +0900
committerJoerg Roedel <jroedel@suse.de>2015-05-05 17:52:11 +0200
commitd4dd920cc2f6a948f07544caaa22bccb63378a3a (patch)
tree18ccd63fcd755756de6f1dfa8f2664adab9bd1d5 /drivers/iommu/amd_iommu_proto.h
parent5ebe6afaf0057ac3eaeb98defd5456894b446d22 (diff)
iommu/rockchip: Make sure that page table state is coherent
To flush created mappings, current mapping code relies on the fact that during unmap the driver zaps every IOVA being unmapped and that it is enough to zap a single IOVA of page table to remove the entire page table from IOMMU cache. Based on these assumptions the driver was made to simply zap the first IOVA of the mapping being created. This is enough to invalidate first page table, which could be shared with another mapping (and thus could be already present in IOMMU cache), but unfortunately it does not do anything about the last page table that could be shared with other mappings as well. Moreover, the flushing is performed before page table contents are actually modified, so there is a race between the CPU updating the page tables and hardware that could be possibly running at the same time and triggering IOMMU look-ups, which could bring back the page tables back to the cache. To fix both issues, this patch makes the mapping code zap first and last (if they are different) IOVAs of new mapping after the page table is updated. Signed-off-by: Tomasz Figa <tfiga@chromium.org> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org> Tested-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/amd_iommu_proto.h')
0 files changed, 0 insertions, 0 deletions