iommu/io-pgtable-arm-v7s: Support lockless operation
authorRobin Murphy <robin.murphy@arm.com>
Thu, 22 Jun 2017 15:53:55 +0000 (16:53 +0100)
committerWill Deacon <will.deacon@arm.com>
Fri, 23 Jun 2017 16:58:00 +0000 (17:58 +0100)
commit119ff305b02793dc31eb1e921b85925ce10dc0a1
tree95b88f07fdc2465388f9526f1b2213317c6f4d3d
parent2c3d273eabe8b1ed3b3cffe2c79643b1bf7e2d4a
iommu/io-pgtable-arm-v7s: Support lockless operation

Mirroring the LPAE implementation, rework the v7s code to be robust
against concurrent operations. The same two potential races exist, and
are solved in the same manner, with the fixed 2-level structure making
life ever so slightly simpler.

What complicates matters compared to LPAE, however, is large page
entries, since we can't update a block of 16 PTEs atomically, nor assume
available software bits to do clever things with. As most users are
never likely to do partial unmaps anyway (due to DMA API rules), it
doesn't seem unreasonable for this case to remain behind a serialising
lock; we just pull said lock down into the bowels of the implementation
so it's well out of the way of the normal call paths.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/io-pgtable-arm-v7s.c