diff mbox

[2/2] KVM: MMU: fix bogus alloc_mmu_pages assignment

Message ID 20090728182726.192108441@amt.cnet (mailing list archive)
State New, archived
Headers show

Commit Message

Marcelo Tosatti July 28, 2009, 6:26 p.m. UTC
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>



--
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

Comments

Izik Eidus July 28, 2009, 7:05 p.m. UTC | #1
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 <mtosatti@redhat.com>
>
> 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
--
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
diff mbox

Patch

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