kvm x86: release time_page on vcpu destruction
PATCH 1/1 kvm x86: release time_page on vcpu destruction
Not releasing the time_page causes a leak of that page or the compound page it is situated in.
Signed-off-by Joerg Roedel <[email protected]>
--- arch/x86/kvm/x86.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
arch/x86/kvm/x86.c +5 -0
@@ -4159,6 +4159,11 @@ EXPORT_SYMBOL_GPL(kvm_put_guest_fpu);void kvm_arch_vcpu_free (struct kvm_vcpu *vcpu) { +if (vcpu->arch.time_page) { +kvm_release_page_dirty (vcpu->arch.time_page); + vcpu->arch.time_page =NULL ; + } + kvm_x86_ops->vcpu_free (vcpu); }
Signature · 1 line
1.5.6.4
Quoted 13 lines · Joerg Roedel
Not releasing the
time_pagecauses a leak of that page or the compound page it is situated in.Signed-off-by Joerg Roedel <[email protected]>--- arch/x86/kvm/x86.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)arch/x86/kvm/x86.c +0
-0
arch/x86/kvm/x86.c EXPORT_SYMBOL_GPL(kvm_put_guest_fpu); · line 4168
Quoted 10 lines
arch/x86/kvm/x86.c +5
-0@@ -4159,6 +4159,11 @@ EXPORT_SYMBOL_GPL(kvm_put_guest_fpu);void kvm_arch_vcpu_free (struct kvm_vcpu *vcpu) { +if (vcpu->arch.time_page) { +kvm_release_page_dirty (vcpu->arch.time_page); + vcpu->arch.time_page =NULL ; + } + kvm_x86_ops->vcpu_free (vcpu); }
Looks good.
Avi Kivity
AppliedQuoted 3 lines · Joerg Roedel
Not releasing the
time_pagecauses a leak of that page or the compound page it is situated in.
Applied, thanks.
Signature · 1 line
error compiling committee.c: too many arguments to function