iommu/arm-smmu: Simplify ASID/VMID handling
authorRobin Murphy <robin.murphy@arm.com>
Thu, 30 Mar 2017 16:56:29 +0000 (17:56 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 6 Apr 2017 15:06:42 +0000 (16:06 +0100)
commit280b683ceaceb7508dc1e9c7e148ea1dcdf36543
treedf65f62c0f9ecc66f1c407e6a5bdad3197f7c3a1
parent125458ab3aefe9cf2f72dcfe7338dc9ad967da0b
iommu/arm-smmu: Simplify ASID/VMID handling

Calculating ASIDs/VMIDs dynamically from arm_smmu_cfg was a neat trick,
but the global uniqueness workaround makes it somewhat more awkward, and
means we end up having to pass extra state around in certain cases just
to keep a handle on the offset.

We already have 16 bits going spare in arm_smmu_cfg; let's just
precalculate an ASID/VMID, plop it in there, and tidy up the users
accordingly. We'd also need something like this anyway if we ever get
near to thinking about SVM, so it's no bad thing.

Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/arm-smmu.c