From 1e0d384813fb11515cf43d42d7dc2c25ca021080 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost <ehabkost@redhat.com> Date: Thu, 27 Aug 2009 10:13:36 -0300 Subject: [PATCH] KVM: MMU: fix bogus alloc_mmu_pages assignment Message-id: <20090826131839.GA676@amt.cnet> Patchwork-id: 3312 O-Subject: KVM: MMU: fix bogus alloc_mmu_pages assignment Bugzilla: CVE: RH-Acked-by: Avi Kivity <avi@redhat.com> RH-Acked-by: Juan Quintela <quintela@redhat.com> RH-Acked-by: Izik Eidus <ieidus@redhat.com> 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 <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit 1374571813a9e30e65c5274aa9fdff15f2c58ee2) Bugzilla: 487857 Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- arch/x86/kvm/mmu.c | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 29bbf8c..8700a20 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2785,14 +2785,6 @@ static int alloc_mmu_pages(struct kvm_vcpu *vcpu) 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 -- 1.6.3.rc4.29.g8146