From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH v5 8/9] KVM: MMU: combine guest pte read between fetch and pte prefetch Date: Wed, 7 Jul 2010 10:07:05 -0300 Message-ID: <20100707130705.GA4293@amt.cnet> References: <4C330918.6040709@cn.fujitsu.com> <4C330A9A.9030106@cn.fujitsu.com> <20100706195254.GA4311@amt.cnet> <4C33D703.4090208@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , LKML , KVM list To: Xiao Guangrong Return-path: Content-Disposition: inline In-Reply-To: <4C33D703.4090208@cn.fujitsu.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Wed, Jul 07, 2010 at 09:23:15AM +0800, Xiao Guangrong wrote: > > > Marcelo Tosatti wrote: > > >> - > >> - first_pte_gpa = gfn_to_gpa(sp->gfn) + > >> - (offset + i) * sizeof(pt_element_t); > >> - > >> - if (kvm_read_guest_atomic(vcpu->kvm, first_pte_gpa, gptep, > >> - sizeof(gptep)) < 0) > >> - return; > >> + gptep = gw->prefetch_ptes; > > > > Where do you reread the gpte in the prefetch path? > > > > Marcelo, > > Thanks for your review. > > Below codes read gptes in the prefetch path: > > index = sptep - sp->spt; > i = index & ~(PTE_PREFETCH_NUM - 1); > max = index | (PTE_PREFETCH_NUM - 1); > > if (PTTYPE == 32) > offset = sp->role.quadrant << PT64_LEVEL_BITS; > > first_pte_gpa = gfn_to_gpa(sp->gfn) + > (offset + i) * sizeof(pt_element_t); > > if (kvm_read_guest_atomic(vcpu->kvm, first_pte_gpa, gptep, > sizeof(gptep)) < 0) > return; > > It reads the 16 aligned items around sptep's corresponding gpte and this gpte > is also in this area. :-) But you removed that in patch 8?