From patchwork Tue Jul 28 18:26:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 37881 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6SIRt5t023262 for ; Tue, 28 Jul 2009 18:27:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755370AbZG1S1v (ORCPT ); Tue, 28 Jul 2009 14:27:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755389AbZG1S1v (ORCPT ); Tue, 28 Jul 2009 14:27:51 -0400 Received: from mx2.redhat.com ([66.187.237.31]:36494 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755362AbZG1S1u (ORCPT ); Tue, 28 Jul 2009 14:27:50 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6SIRpN4026037 for ; Tue, 28 Jul 2009 14:27:51 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6SIRoXA027920; Tue, 28 Jul 2009 14:27:50 -0400 Received: from amt.cnet (vpn-51-15.sfbay.redhat.com [10.14.51.15]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6SIRm2M026244; Tue, 28 Jul 2009 14:27:49 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id D0A0D274001; Tue, 28 Jul 2009 15:27:42 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id n6SIRfCg010242; Tue, 28 Jul 2009 15:27:41 -0300 Message-Id: <20090728182726.192108441@amt.cnet> User-Agent: quilt/0.47-1 Date: Tue, 28 Jul 2009 15:26:59 -0300 From: Marcelo Tosatti To: Avi Kivity Cc: Izik Eidus , kvm@vger.kernel.org, Marcelo Tosatti Subject: [patch 2/2] KVM: MMU: fix bogus alloc_mmu_pages assignment References: <20090728182657.694401826@amt.cnet> Content-Disposition: inline; filename=alloc-mmu-pages-patch X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Remove the bogus n_free_mmu_pages assignment from alloc_mmu_pages. It breaks accounting of mmu pages, since n_free_mmu_pages is modified but the real number of pages remains the same. Signed-off-by: Marcelo Tosatti --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: kvm/arch/x86/kvm/mmu.c =================================================================== --- kvm.orig/arch/x86/kvm/mmu.c +++ kvm/arch/x86/kvm/mmu.c @@ -2706,14 +2706,6 @@ static int alloc_mmu_pages(struct kvm_vc ASSERT(vcpu); - spin_lock(&vcpu->kvm->mmu_lock); - if (vcpu->kvm->arch.n_requested_mmu_pages) - vcpu->kvm->arch.n_free_mmu_pages = - vcpu->kvm->arch.n_requested_mmu_pages; - else - vcpu->kvm->arch.n_free_mmu_pages = - vcpu->kvm->arch.n_alloc_mmu_pages; - spin_unlock(&vcpu->kvm->mmu_lock); /* * When emulating 32-bit mode, cr3 is only 32 bits even on x86_64. * Therefore we need to allocate shadow page tables in the first