OSDN Git Service

iommu/arm-smmu: Fix ATS1* register writes
authorRobin Murphy <Robin.Murphy@arm.com>
Wed, 27 May 2015 16:09:34 +0000 (17:09 +0100)
committerDavid Keitel <dkeitel@codeaurora.org>
Tue, 22 Mar 2016 18:14:59 +0000 (11:14 -0700)
commit590f6b97ce9d808e4e738acd03dfccb392ecae9b
treeaa2b2150bb8a6a0ccbbd64831746de70a8735c45
parent4efda8dbdda12bb23bf1de81a176ec62062a262c
iommu/arm-smmu: Fix ATS1* register writes

The ATS1* address translation registers only support being written
atomically - in SMMUv2 where they are 64 bits wide, 32-bit writes to
the lower half are automatically zero-extended, whilst 32-bit writes
to the upper half are ignored. Thus, the current logic of performing
64-bit writes as two 32-bit accesses is wrong.

Since we already limit IOVAs to 32 bits on 32-bit ARM, the lack of a
suitable writeq() implementation there is not an issue, and we only
need a little preprocessor ugliness to safely hide the 64-bit case.

Change-Id: Ice82b1276d30605d335f9400f8cc3da3e3348bb6
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
[pdaly@codeaurora.org Resolve minor conflicts]
drivers/iommu/arm-smmu.c