Skip to content

Commit bda3dea

Browse files
kvaneeshmpe
authored andcommitted
powerpc/kvm/book3s: use find_kvm_host_pte in kvmppc_book3s_instantiate_page
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 3ff8df1 commit bda3dea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/powerpc/kvm/book3s_64_mmu_radix.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -813,12 +813,12 @@ int kvmppc_book3s_instantiate_page(struct kvm_vcpu *vcpu,
813813
* Read the PTE from the process' radix tree and use that
814814
* so we get the shift and attribute bits.
815815
*/
816-
local_irq_disable();
817-
ptep = __find_linux_pte(vcpu->arch.pgdir, hva, NULL, &shift);
816+
spin_lock(&kvm->mmu_lock);
817+
ptep = find_kvm_host_pte(kvm, mmu_seq, hva, &shift);
818818
pte = __pte(0);
819819
if (ptep)
820-
pte = *ptep;
821-
local_irq_enable();
820+
pte = READ_ONCE(*ptep);
821+
spin_unlock(&kvm->mmu_lock);
822822
/*
823823
* If the PTE disappeared temporarily due to a THP
824824
* collapse, just return and let the guest try again.

0 commit comments

Comments
 (0)