iommu/io-pgtable-arm: Add support for non-strict mode
authorZhen Lei <thunder.leizhen@huawei.com>
Thu, 20 Sep 2018 16:10:24 +0000 (17:10 +0100)
committerWill Deacon <will.deacon@arm.com>
Mon, 1 Oct 2018 12:01:33 +0000 (13:01 +0100)
commitb6b65ca20bc93d14319f9b5cf98fd3c19a4244e3
treece01effa867ef81b01481259e0fcccb02ad66dd0
parent68a6efe86f6a16e25556a2aff40efad41097b486
iommu/io-pgtable-arm: Add support for non-strict mode

Non-strict mode is simply a case of skipping 'regular' leaf TLBIs, since
the sync is already factored out into ops->iotlb_sync at the core API
level. Non-leaf invalidations where we change the page table structure
itself still have to be issued synchronously in order to maintain walk
caches correctly.

To save having to reason about it too much, make sure the invalidation
in arm_lpae_split_blk_unmap() just performs its own unconditional sync
to minimise the window in which we're technically violating the break-
before-make requirement on a live mapping. This might work out redundant
with an outer-level sync for strict unmaps, but we'll never be splitting
blocks on a DMA fastpath anyway.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
[rm: tweak comment, commit message, split_blk_unmap logic and barriers]
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/io-pgtable-arm.c
drivers/iommu/io-pgtable.h