Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765467AbZCaXjz (ORCPT ); Tue, 31 Mar 2009 19:39:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1764337AbZCaXWv (ORCPT ); Tue, 31 Mar 2009 19:22:51 -0400 Received: from sous-sol.org ([216.99.217.87]:52976 "EHLO x200.localdomain" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1764339AbZCaXWu (ORCPT ); Tue, 31 Mar 2009 19:22:50 -0400 Message-Id: <20090331231826.243558906@sous-sol.org> User-Agent: quilt/0.47-1 Date: Tue, 31 Mar 2009 16:11:30 -0700 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Joerg Roedel , Marcelo Tosatti , Avi Kivity Subject: [patch 45/45] KVM: MMU: Fix another largepage memory leak References: <20090331231045.719396245@sous-sol.org> Content-Disposition: inline; filename=kvm-mmu-fix-another-largepage-memory-leak.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1391 Lines: 40 -stable review patch. If anyone has any objections, please let us know. --------------------- From: Joerg Roedel upstream commit: c5bc22424021cabda862727fb3f5098b866f074d 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. Cc: stable@kernel.org Signed-off-by: Joerg Roedel Acked-by: Marcelo Tosatti Signed-off-by: Avi Kivity [chrisw: backport to 2.6.29] Signed-off-by: Chris Wright --- arch/x86/kvm/paging_tmpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h @@ -314,9 +314,9 @@ static int FNAME(shadow_walk_entry)(stru return 0; 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 && gw->level == PT_DIRECTORY_LEVEL) { -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/