Skip to contentSkip to conversation

kvm x86: release time_page on vcpu destruction

PATCH Applied Joerg Roedel 3 participants 3 messages Feb 25, 2009 – Feb 26, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

---
 arch/x86/kvm/x86.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/x86/kvm/x86.c +5 -0
index 8ca100a..a1ecec5 100644
@@ -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
#1 lore raw
Quoted 13 lines · Joerg Roedel

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

---
 arch/x86/kvm/x86.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/x86/kvm/x86.c +0 -0
index 8ca100a..a1ecec5 100644

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.

Applied
#2 lore raw
In reply to Joerg Roedel
Quoted 3 lines · Joerg Roedel

Not releasing the time_page causes 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