From mboxrd@z Thu Jan 1 00:00:00 1970 From: Izik Eidus Subject: Re: [patch 2/2] KVM: MMU: fix bogus alloc_mmu_pages assignment Date: Tue, 28 Jul 2009 22:05:55 +0300 Message-ID: <4A6F4C13.9090108@redhat.com> References: <20090728182657.694401826@amt.cnet> <20090728182726.192108441@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:33062 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750848AbZG1THL (ORCPT ); Tue, 28 Jul 2009 15:07:11 -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 n6SJ7Cfi006780 for ; Tue, 28 Jul 2009 15:07:12 -0400 In-Reply-To: <20090728182726.192108441@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti wrote: > 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 > > 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 > > > ack