summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/book3s_64_mmu_hv.c
diff options
context:
space:
mode:
authorPaul Mackerras2017-11-09 04:30:24 +0100
committerPaul Mackerras2017-11-09 04:30:24 +0100
commit072df8130c6b602c8ee219f7b06394680cafad2f (patch)
treead7cbc2342be72236851b19a5d9e8a0908dbbdf7 /arch/powerpc/kvm/book3s_64_mmu_hv.c
parentKVM: PPC: Book3S HV: Run HPT guests on POWER9 radix hosts (diff)
parentKVM: PPC: Book3S HV: Fix exclusion between HPT resizing and other HPT updates (diff)
downloadkernel-qcow2-linux-072df8130c6b602c8ee219f7b06394680cafad2f.tar.gz
kernel-qcow2-linux-072df8130c6b602c8ee219f7b06394680cafad2f.tar.xz
kernel-qcow2-linux-072df8130c6b602c8ee219f7b06394680cafad2f.zip
Merge branch 'kvm-ppc-fixes' into kvm-ppc-next
This merges in a couple of fixes from the kvm-ppc-fixes branch that modify the same areas of code as some commits from the kvm-ppc-next branch, in order to resolve the conflicts. Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'arch/powerpc/kvm/book3s_64_mmu_hv.c')
-rw-r--r--arch/powerpc/kvm/book3s_64_mmu_hv.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
index 6aec8a22aeff..235319c2574e 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
@@ -651,6 +651,16 @@ int kvmppc_book3s_hv_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu,
hnow_v = hpte_new_to_old_v(hnow_v, hnow_r);
hnow_r = hpte_new_to_old_r(hnow_r);
}
+
+ /*
+ * If the HPT is being resized, don't update the HPTE,
+ * instead let the guest retry after the resize operation is complete.
+ * The synchronization for mmu_ready test vs. set is provided
+ * by the HPTE lock.
+ */
+ if (!kvm->arch.mmu_ready)
+ goto out_unlock;
+
if ((hnow_v & ~HPTE_V_HVLOCK) != hpte[0] || hnow_r != hpte[1] ||
rev->guest_rpte != hpte[2])
/* HPTE has been changed under us; let the guest retry */