iommu/arm-smmu-v3: Use WRITE_ONCE() when changing validity of an STE
authorWill Deacon <will@kernel.org>
Wed, 15 Jan 2020 15:21:47 +0000 (15:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Feb 2020 14:42:34 +0000 (15:42 +0100)
commit712ae1c8d30944bd7c7233773e022d611b515f14
tree63f72af6778d78aa311d9c5c451ea086bb679ebd
parentc2ddc19a9614e9ff9bee880cac8a2f4915f255db
iommu/arm-smmu-v3: Use WRITE_ONCE() when changing validity of an STE

[ Upstream commit d71e01716b3606a6648df7e5646ae12c75babde4 ]

If, for some bizarre reason, the compiler decided to split up the write
of STE DWORD 0, we could end up making a partial structure valid.

Although this probably won't happen, follow the example of the
context-descriptor code and use WRITE_ONCE() to ensure atomicity of the
write.

Reported-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/arm-smmu-v3.c