diff options
author | Hollis Blanchard <hollisb@us.ibm.com> | 2008-11-24 11:37:38 -0600 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2008-11-25 12:02:48 +0200 |
commit | c30f8a6c6d74f67bc2107726cc61a1e7c71e9740 (patch) | |
tree | cc593db75efd62f917e949df78f4fabdcddc6938 /arch/powerpc/kvm/44x_tlb.c | |
parent | 0c0f40bdbe4ddb48ebecfb5c2b56eeb175a57c45 (diff) |
KVM: ppc: stop leaking host memory on VM exit
When the VM exits, we must call put_page() for every page referenced in the
shadow TLB.
Without this patch, we usually leak 30-50 host pages (120 - 200 KiB with 4 KiB
pages). The maximum number of pages leaked is the size of our shadow TLB, 64
pages.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/44x_tlb.c')
-rw-r--r-- | arch/powerpc/kvm/44x_tlb.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/44x_tlb.c b/arch/powerpc/kvm/44x_tlb.c index 2e227a412bc..ad72c6f9811 100644 --- a/arch/powerpc/kvm/44x_tlb.c +++ b/arch/powerpc/kvm/44x_tlb.c @@ -124,6 +124,14 @@ static void kvmppc_44x_shadow_release(struct kvm_vcpu *vcpu, } } +void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu) +{ + int i; + + for (i = 0; i <= tlb_44x_hwater; i++) + kvmppc_44x_shadow_release(vcpu, i); +} + void kvmppc_tlbe_set_modified(struct kvm_vcpu *vcpu, unsigned int i) { vcpu->arch.shadow_tlb_mod[i] = 1; |