Skip to contentSkip to conversation

FAILED: patch "[PATCH] kvm: arm/arm64: Force reading uncached stage2 PGD" failed to apply to 4.11-stable tree

PATCH [email protected] 1 participant 1 message May 23, 2017 Stable branch

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.11-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From 2952a6070e07ebdd5896f1f5b861acad677caded Mon Sep 17 00:00:00 2001

From: Suzuki K Poulose <[email protected]>
Date: Tue, 16 May 2017 10:34:54 +0100
Subject: [PATCH] kvm: arm/arm64: Force reading uncached stage2 PGD

Make sure we don't use a cached value of the KVM stage2 PGD while resetting the PGD.

virt/kvm/arm/mmu.c +1 -1
index 909a1a793b31..704e35f312a4 100644
@@ -837,7 +837,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);
 		kvm->arch.pgd = NULL;
 	}
 	spin_unlock(&kvm->mmu_lock);