linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm x86: release time_page on vcpu destruction
@ 2009-02-25 15:08 Joerg Roedel
  2009-02-25 16:13 ` Marcelo Tosatti
  2009-02-26  9:54 ` Avi Kivity
  0 siblings, 2 replies; 3+ messages in thread
From: Joerg Roedel @ 2009-02-25 15:08 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti
  Cc: Gerd Hoffmann, Glauber de Oliveira Costa, kvm, linux-kernel,
	Joerg Roedel

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

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
 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);
 }
 
-- 
1.5.6.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kvm x86: release time_page on vcpu destruction
  2009-02-25 15:08 [PATCH] kvm x86: release time_page on vcpu destruction Joerg Roedel
@ 2009-02-25 16:13 ` Marcelo Tosatti
  2009-02-26  9:54 ` Avi Kivity
  1 sibling, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2009-02-25 16:13 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Avi Kivity, Gerd Hoffmann, Glauber de Oliveira Costa, kvm, linux-kernel

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 <joerg.roedel@amd.com>
> ---
>  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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kvm x86: release time_page on vcpu destruction
  2009-02-25 15:08 [PATCH] kvm x86: release time_page on vcpu destruction Joerg Roedel
  2009-02-25 16:13 ` Marcelo Tosatti
@ 2009-02-26  9:54 ` Avi Kivity
  1 sibling, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2009-02-26  9:54 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Marcelo Tosatti, Gerd Hoffmann, Glauber de Oliveira Costa, kvm,
	linux-kernel

Joerg Roedel wrote:
> Not releasing the time_page causes a leak of that page or the compound
> page it is situated in.
>   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-26  9:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-25 15:08 [PATCH] kvm x86: release time_page on vcpu destruction Joerg Roedel
2009-02-25 16:13 ` Marcelo Tosatti
2009-02-26  9:54 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).