Skip to content

Commit 9781e75

Browse files
kvaneeshmpe
authored andcommitted
powerpc/kvm/book3s: Use find_kvm_host_pte in page fault handler
Signed-off-by: Aneesh Kumar K.V <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3552887 commit 9781e75

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/powerpc/kvm/book3s_64_mmu_hv.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -602,12 +602,12 @@ int kvmppc_book3s_hv_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu,
602602
* Read the PTE from the process' radix tree and use that
603603
* so we get the shift and attribute bits.
604604
*/
605-
local_irq_disable();
606-
ptep = __find_linux_pte(vcpu->arch.pgdir, hva, NULL, &shift);
605+
spin_lock(&kvm->mmu_lock);
606+
ptep = find_kvm_host_pte(kvm, mmu_seq, hva, &shift);
607607
pte = __pte(0);
608608
if (ptep)
609-
pte = *ptep;
610-
local_irq_enable();
609+
pte = READ_ONCE(*ptep);
610+
spin_unlock(&kvm->mmu_lock);
611611
/*
612612
* If the PTE disappeared temporarily due to a THP
613613
* collapse, just return and let the guest try again.

0 commit comments

Comments
 (0)