From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] kvm x86: release time_page on vcpu destruction Date: Wed, 25 Feb 2009 13:13:52 -0300 Message-ID: <20090225161352.GA6707@amt.cnet> References: <1235574511-4571-1-git-send-email-joerg.roedel@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Gerd Hoffmann , Glauber de Oliveira Costa , kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Joerg Roedel Return-path: Received: from mx2.redhat.com ([66.187.237.31]:60675 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754533AbZBYQOf (ORCPT ); Wed, 25 Feb 2009 11:14:35 -0500 Content-Disposition: inline In-Reply-To: <1235574511-4571-1-git-send-email-joerg.roedel@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Feb 25, 2009 at 04:08:31PM +0100, Joerg Roedel wrote: > Not releasing the time_page causes a leak of that page or the compound > page it is situated in. > > Signed-off-by: Joerg Roedel > --- > arch/x86/kvm/x86.c | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 8ca100a..a1ecec5 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); > } Looks good.