summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/book3s_64_mmu_hv.c
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2020-05-05 21:16:47 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2020-05-05 21:16:47 +1000
commitf2b8d76dc6db379160ad8875f97336db2069e7bd (patch)
tree9334fc694bc5c9710563d3381b395b6985b09bcd /arch/powerpc/kvm/book3s_64_mmu_hv.c
parentae83d0b416db002fe95601e7f97f64b59514d936 (diff)
parentae49dedaa92b55258544aace7c585094b862ef79 (diff)
downloadlinux-stable-f2b8d76dc6db379160ad8875f97336db2069e7bd.tar.gz
linux-stable-f2b8d76dc6db379160ad8875f97336db2069e7bd.tar.bz2
linux-stable-f2b8d76dc6db379160ad8875f97336db2069e7bd.zip
Merge tag 'kvm-ppc-fixes-5.7-1' into topic/ppc-kvm
This brings in a fix from the kvm-ppc tree that was merged to mainline after rc2, and so isn't in the base of our topic branch. We'd like it in the topic branch because it interacts with patches we plan to carry in this branch.
Diffstat (limited to 'arch/powerpc/kvm/book3s_64_mmu_hv.c')
-rw-r--r--arch/powerpc/kvm/book3s_64_mmu_hv.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
index 6404df613ea3..2b35f9bcf892 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
@@ -604,18 +604,19 @@ int kvmppc_book3s_hv_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu,
*/
local_irq_disable();
ptep = __find_linux_pte(vcpu->arch.pgdir, hva, NULL, &shift);
+ pte = __pte(0);
+ if (ptep)
+ pte = *ptep;
+ local_irq_enable();
/*
* If the PTE disappeared temporarily due to a THP
* collapse, just return and let the guest try again.
*/
- if (!ptep) {
- local_irq_enable();
+ if (!pte_present(pte)) {
if (page)
put_page(page);
return RESUME_GUEST;
}
- pte = *ptep;
- local_irq_enable();
hpa = pte_pfn(pte) << PAGE_SHIFT;
pte_size = PAGE_SIZE;
if (shift)