]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
KVM: x86: release time_page on vcpu destruction
authorJoerg Roedel <joerg.roedel@amd.com>
Fri, 24 Apr 2009 16:05:07 +0000 (16:05 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 8 May 2009 22:44:59 +0000 (15:44 -0700)
upstream commit: 7f1ea208968f021943d4103ba59e06bb6d8239cb

Not releasing the time_page causes a leak of that page or the compound
page it is situated in.

Cc: stable@kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
arch/x86/kvm/x86.c

index 758b7a155ae9113559b5993b38abfc3cf603fe70..425423eff489dceeb94cdd17c4d090ffb4f8d63a 100644 (file)
@@ -3962,6 +3962,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);
 }