aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Roedel <[email protected]>2009-02-25 16:08:31 +0100
committerAvi Kivity <[email protected]>2009-04-22 13:52:10 +0300
commit7f1ea208968f021943d4103ba59e06bb6d8239cb (patch)
tree1827ac4801b5b9c5bb69f921b60ab6747593beae
parent4cd481f68dde99ac416003b825c835f71e364393 (diff)
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. Cc: [email protected] Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
-rw-r--r--arch/x86/kvm/x86.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 8ca100a9ecac..a1ecec5c03e9 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -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);
}