Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752048Ab0GGB1K (ORCPT ); Tue, 6 Jul 2010 21:27:10 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:49254 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750795Ab0GGB1I (ORCPT ); Tue, 6 Jul 2010 21:27:08 -0400 Message-ID: <4C33D703.4090208@cn.fujitsu.com> Date: Wed, 07 Jul 2010 09:23:15 +0800 From: Xiao Guangrong User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Marcelo Tosatti CC: Avi Kivity , LKML , KVM list Subject: Re: [PATCH v5 8/9] KVM: MMU: combine guest pte read between fetch and pte prefetch References: <4C330918.6040709@cn.fujitsu.com> <4C330A9A.9030106@cn.fujitsu.com> <20100706195254.GA4311@amt.cnet> In-Reply-To: <20100706195254.GA4311@amt.cnet> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1103 Lines: 43 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. :-) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/