OSDN Git Service

KVM: arm64: Upgrade VMID accesses to {READ,WRITE}_ONCE
authorMarc Zyngier <maz@kernel.org>
Fri, 6 Aug 2021 11:31:08 +0000 (12:31 +0100)
committerMarc Zyngier <maz@kernel.org>
Fri, 20 Aug 2021 08:12:24 +0000 (09:12 +0100)
commitcf364e08ea1c5dd217afb658d510aaef7d0cc6f4
tree73d252192060ec25e5dce98cc87edfdfdd7cf1b9
parent4efc0ede4f31d7ec25c3dee0c8f07f93735cee6d
KVM: arm64: Upgrade VMID accesses to {READ,WRITE}_ONCE

Since TLB invalidation can run in parallel with VMID allocation,
we need to be careful and avoid any sort of load/store tearing.
Use {READ,WRITE}_ONCE consistently to avoid any surprise.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Jade Alglave <jade.alglave@arm.com>
Cc: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Reviewed-by: Quentin Perret <qperret@google.com>
Link: https://lore.kernel.org/r/20210806113109.2475-6-will@kernel.org
arch/arm64/include/asm/kvm_mmu.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/hyp/nvhe/mem_protect.c
arch/arm64/kvm/mmu.c