public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Joerg Roedel <joerg.roedel@amd.com>
Cc: Avi Kivity <avi@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kvm mmu: fix another largepage memory leak
Date: Thu, 19 Feb 2009 10:20:25 -0300	[thread overview]
Message-ID: <20090219132025.GA29085@amt.cnet> (raw)
In-Reply-To: <1235042336-20101-1-git-send-email-joerg.roedel@amd.com>


On Thu, Feb 19, 2009 at 12:18:56PM +0100, Joerg Roedel wrote:
> In the paging_fetch function rmap_remove is called after setting a large
> pte to non-present. This causes rmap_remove to not drop the reference to
> the large page. The result is a memory leak of that page.
> 
> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
> ---
>  arch/x86/kvm/paging_tmpl.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
> index 7314c09..0f11792 100644
> --- a/arch/x86/kvm/paging_tmpl.h
> +++ b/arch/x86/kvm/paging_tmpl.h
> @@ -306,9 +306,9 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
>  			continue;
>  
>  		if (is_large_pte(*sptep)) {
> +			rmap_remove(vcpu->kvm, sptep);
>  			set_shadow_pte(sptep, shadow_trap_nonpresent_pte);
>  			kvm_flush_remote_tlbs(vcpu->kvm);
> -			rmap_remove(vcpu->kvm, sptep);
>  		}
>  
>  		if (level == PT_DIRECTORY_LEVEL
> -- 

ACK


  reply	other threads:[~2009-02-19 13:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-19 11:18 [PATCH] kvm mmu: fix another largepage memory leak Joerg Roedel
2009-02-19 13:20 ` Marcelo Tosatti [this message]
2009-02-23 10:55 ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090219132025.GA29085@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=avi@redhat.com \
    --cc=joerg.roedel@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox