aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSuzuki K Poulose <suzuki.poulose@arm.com>2017-05-16 10:34:54 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-09-07 08:34:10 +0200
commit628212c89faeed34704977a0edcfaaaae467a34d (patch)
treec580a9efd0e863ad9f4052025365ebda4002a206 /arch
parent57ff696f54b5c51d8d4df00295341bec17fab36f (diff)
downloadlinux-linaro-stable-628212c89faeed34704977a0edcfaaaae467a34d.tar.gz
kvm: arm/arm64: Force reading uncached stage2 PGD
commit 2952a6070e07ebdd5896f1f5b861acad677caded upstream. Make sure we don't use a cached value of the KVM stage2 PGD while resetting the PGD. Cc: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Reviewed-by: Christoffer Dall <cdall@linaro.org> Signed-off-by: Christoffer Dall <cdall@linaro.org> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/kvm/mmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 9b8a0ba33c9d..e8835d4e173c 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -833,7 +833,7 @@ void kvm_free_stage2_pgd(struct kvm *kvm)
spin_lock(&kvm->mmu_lock);
if (kvm->arch.pgd) {
unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);
- pgd = kvm->arch.pgd;
+ pgd = READ_ONCE(kvm->arch.pgd);
hwpgd = kvm_get_hwpgd(kvm);
kvm->arch.pgd = NULL;
}