From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v4 5/6] KVM: MMU: combine guest pte read between walk and pte prefetch Date: Sat, 03 Jul 2010 14:48:35 +0300 Message-ID: <4C2F2393.9050301@redhat.com> References: <4C2C9DC0.8050607@cn.fujitsu.com> <4C2C9E6C.2040803@cn.fujitsu.com> <20100702170303.GC25969@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Xiao Guangrong , LKML , KVM list To: Marcelo Tosatti Return-path: In-Reply-To: <20100702170303.GC25969@amt.cnet> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 07/02/2010 08:03 PM, Marcelo Tosatti wrote: > On Thu, Jul 01, 2010 at 09:55:56PM +0800, Xiao Guangrong wrote: > >> Combine guest pte read between guest pte walk and pte prefetch >> >> Signed-off-by: Xiao Guangrong >> --- >> arch/x86/kvm/paging_tmpl.h | 48 ++++++++++++++++++++++++++++++------------- >> 1 files changed, 33 insertions(+), 15 deletions(-) >> > Can't do this, it can miss invlpg: > > vcpu0 vcpu1 > read guest ptes > modify guest pte > invlpg > instantiate stale > guest pte > > See how the pte is reread inside fetch with mmu_lock held. > Note, this is fine if the pte is unsync, since vcpu0 will soon invlpg it. It's only broken for sync ptes. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.