iommu/io-pgtable-arm: Simplify PGD size handling
authorRobin Murphy <robin.murphy@arm.com>
Fri, 25 Oct 2019 18:08:34 +0000 (19:08 +0100)
committerWill Deacon <will@kernel.org>
Mon, 4 Nov 2019 19:34:31 +0000 (19:34 +0000)
commitc79278c185c8848fefc25cf304eecec9c4623a40
tree382c1fd931d727b51385daeb34abd0f55aa022c1
parent594ab90fc46c0842e4f1b60b6642fa4555a999f9
iommu/io-pgtable-arm: Simplify PGD size handling

We use data->pgd_size directly for the one-off allocation and freeing of
the top-level table, but otherwise it serves for ARM_LPAE_PGD_IDX() to
repeatedly re-calculate the effective number of top-level address bits
it represents. Flip this around so we store the form we most commonly
need, and derive the lesser-used one instead. This cuts a whole bunch of
code out of the map/unmap/iova_to_phys fast-paths.

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