Skip to content

Commit 3552887

Browse files
kvaneeshmpe
authored andcommitted
powerpc/kvm/book3s: Add helper for host page table walk
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 6cdf303 commit 3552887

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

arch/powerpc/include/asm/kvm_book3s_64.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,22 @@ static inline pte_t *find_kvm_secondary_pte(struct kvm *kvm, unsigned long ea,
647647
return pte;
648648
}
649649

650+
static inline pte_t *find_kvm_host_pte(struct kvm *kvm, unsigned long mmu_seq,
651+
unsigned long ea, unsigned *hshift)
652+
{
653+
pte_t *pte;
654+
655+
VM_WARN(!spin_is_locked(&kvm->mmu_lock),
656+
"%s called with kvm mmu_lock not held \n", __func__);
657+
658+
if (mmu_notifier_retry(kvm, mmu_seq))
659+
return NULL;
660+
661+
pte = __find_linux_pte(kvm->mm->pgd, ea, NULL, hshift);
662+
663+
return pte;
664+
}
665+
650666
extern pte_t *find_kvm_nested_guest_pte(struct kvm *kvm, unsigned long lpid,
651667
unsigned long ea, unsigned *hshift);
652668

0 commit comments

Comments
 (0)