Merge tag 'kvm-4.20-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[platform/kernel/linux-starfive.git] / arch / powerpc / kvm / book3s_64_mmu_radix.c
index 43b21e8..d68162e 100644 (file)
@@ -719,6 +719,16 @@ int kvmppc_book3s_instantiate_page(struct kvm_vcpu *vcpu,
         */
        local_irq_disable();
        ptep = __find_linux_pte(vcpu->arch.pgdir, hva, NULL, &shift);
+       /*
+        * If the PTE disappeared temporarily due to a THP
+        * collapse, just return and let the guest try again.
+        */
+       if (!ptep) {
+               local_irq_enable();
+               if (page)
+                       put_page(page);
+               return RESUME_GUEST;
+       }
        pte = *ptep;
        local_irq_enable();