Skip to content

Commit 44603de

Browse files
committed
Revert "KVM: PPC: e500: Use __kvm_faultin_pfn() to handle page faults"
This reverts commit deead14 which is commit 419cfb983ca93e75e905794521afefcfa07988bb upstream. It should not have been applied. Link: https://lore.kernel.org/r/CABgObfb5U9zwTQBPkPB=mKu-vMrRspPCm4wfxoQpB+SyAnb5WQ@mail.gmail.com Reported-by: Paolo Bonzini <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e7d3439 commit 44603de

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

arch/powerpc/kvm/e500_mmu_host.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
322322
{
323323
struct kvm_memory_slot *slot;
324324
unsigned long pfn = 0; /* silence GCC warning */
325-
struct page *page = NULL;
326325
unsigned long hva;
327326
int pfnmap = 0;
328327
int tsize = BOOK3E_PAGESZ_4K;
@@ -444,7 +443,7 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
444443

445444
if (likely(!pfnmap)) {
446445
tsize_pages = 1UL << (tsize + 10 - PAGE_SHIFT);
447-
pfn = __kvm_faultin_pfn(slot, gfn, FOLL_WRITE, NULL, &page);
446+
pfn = gfn_to_pfn_memslot(slot, gfn);
448447
if (is_error_noslot_pfn(pfn)) {
449448
if (printk_ratelimit())
450449
pr_err("%s: real page not found for gfn %lx\n",
@@ -489,6 +488,8 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
489488
}
490489
}
491490
writable = kvmppc_e500_ref_setup(ref, gtlbe, pfn, wimg);
491+
if (writable)
492+
kvm_set_pfn_dirty(pfn);
492493

493494
kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize,
494495
ref, gvaddr, stlbe);
@@ -497,7 +498,8 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
497498
kvmppc_mmu_flush_icache(pfn);
498499

499500
out:
500-
kvm_release_faultin_page(kvm, page, !!ret, writable);
501+
/* Drop refcount on page, so that mmu notifiers can clear it */
502+
kvm_release_pfn_clean(pfn);
501503
spin_unlock(&kvm->mmu_lock);
502504
return ret;
503505
}

0 commit comments

Comments
 (0)