From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: [patch 2/2] KVM: MMU: fix bogus alloc_mmu_pages assignment Date: Tue, 28 Jul 2009 15:26:59 -0300 Message-ID: <20090728182726.192108441@amt.cnet> References: <20090728182657.694401826@amt.cnet> Cc: Izik Eidus , kvm@vger.kernel.org, Marcelo Tosatti To: Avi Kivity Return-path: 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 Content-Disposition: inline; filename=alloc-mmu-pages-patch Sender: kvm-owner@vger.kernel.org List-ID: 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