From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 22/27] KVM: MMU: Refactor mmu_alloc_roots function Date: Wed, 08 Sep 2010 10:16:59 +0300 Message-ID: <4C87386B.2030109@redhat.com> References: <1283788566-29186-1-git-send-email-joerg.roedel@amd.com> <1283788566-29186-23-git-send-email-joerg.roedel@amd.com> <20100907203952.GA14489@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Joerg Roedel , Alexander Graf , joro@8bytes.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Marcelo Tosatti Return-path: In-Reply-To: <20100907203952.GA14489@amt.cnet> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 09/07/2010 11:39 PM, Marcelo Tosatti wrote: > >> @@ -2406,16 +2441,11 @@ static int mmu_alloc_roots(struct kvm_vcpu *vcpu) >> root_gfn = pdptr>> PAGE_SHIFT; >> if (mmu_check_root(vcpu, root_gfn)) >> return 1; >> - } else if (vcpu->arch.mmu.root_level == 0) >> - root_gfn = 0; >> - if (vcpu->arch.mmu.direct_map) { >> - direct = 1; >> - root_gfn = i<< 30; >> } >> spin_lock(&vcpu->kvm->mmu_lock); >> kvm_mmu_free_some_pages(vcpu); >> sp = kvm_mmu_get_page(vcpu, root_gfn, i<< 30, >> - PT32_ROOT_LEVEL, direct, >> + PT32_ROOT_LEVEL, 0, >> ACC_ALL, NULL); > Should not write protect the gfn for nonpaging mode. > nonpaging mode should have direct_map set, so wouldn't enter this path at all. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.