From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gui Jianfeng Subject: Re: [PATCH 3/3] KVM MMU: Take sp level into account when calculating quadran Date: Fri, 23 Apr 2010 16:10:47 +0800 Message-ID: <4BD15607.3000000@cn.fujitsu.com> References: <4BD01820.3050809@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Xiao Guangrong To: Avi Kivity Return-path: Received: from cn.fujitsu.com ([222.73.24.84]:52425 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1756635Ab0DWILv (ORCPT ); Fri, 23 Apr 2010 04:11:51 -0400 In-Reply-To: <4BD01820.3050809@cn.fujitsu.com> Sender: kvm-owner@vger.kernel.org List-ID: Gui Jianfeng wrote: > Take sp level into account when calculating quadrant, because only when > level == PT_PAGE_TABLE_LEVEL, quadrant is needed. Please ignore this patch, Sorry for the noise. Gui > > Signed-off-by: Gui Jianfeng > --- > arch/x86/kvm/mmu.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c > index 640b82d..2a35a65 100644 > --- a/arch/x86/kvm/mmu.c > +++ b/arch/x86/kvm/mmu.c > @@ -1324,7 +1324,8 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu, > if (role.direct) > role.cr4_pae = 0; > role.access = access; > - if (vcpu->arch.mmu.root_level <= PT32_ROOT_LEVEL) { > + if (vcpu->arch.mmu.root_level <= PT32_ROOT_LEVEL && > + level == PT_PAGE_TABLE_LEVEL) { > quadrant = gaddr >> (PAGE_SHIFT + (PT64_PT_BITS * level)); > quadrant &= (1 << ((PT32_PT_BITS - PT64_PT_BITS) * level)) - 1; > role.quadrant = quadrant;