summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/book3s_pr.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2024-10-10 20:24:15 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-10-25 19:00:49 +0200
commit17b7dbaf183e9cc131bbf5311db8202d323aa667 (patch)
tree3bc82296f7c2b5b6b8fbc9b989017d0753eff8db /arch/powerpc/kvm/book3s_pr.c
parentKVM: MIPS: Use kvm_faultin_pfn() to map pfns into the guest (diff)
downloadlinux-17b7dbaf183e9cc131bbf5311db8202d323aa667.tar.xz
linux-17b7dbaf183e9cc131bbf5311db8202d323aa667.zip
KVM: PPC: Remove extra get_page() to fix page refcount leak
Don't manually do get_page() when patching dcbz, as gfn_to_page() gifts the caller a reference. I.e. doing get_page() will leak the page due to not putting all references. Signed-off-by: Sean Christopherson <seanjc@google.com> Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20241010182427.1434605-74-seanjc@google.com>
Diffstat (limited to '')
-rw-r--r--arch/powerpc/kvm/book3s_pr.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index d7721297b9b6..cd7ab6d85090 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -652,7 +652,6 @@ static void kvmppc_patch_dcbz(struct kvm_vcpu *vcpu, struct kvmppc_pte *pte)
hpage_offset &= ~0xFFFULL;
hpage_offset /= 4;
- get_page(hpage);
page = kmap_atomic(hpage);
/* patch dcbz into reserved instruction, so we trap */