From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch 02/10] KVM: MMU: move local TLB flush to mmu_set_spte Date: Fri, 19 Sep 2008 17:21:09 -0700 Message-ID: <48D441F5.5000707@redhat.com> References: <20080918212749.800177179@localhost.localdomain> <20080918213336.548424061@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org, "David S. Ahern" To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:33009 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752598AbYITAVI (ORCPT ); Fri, 19 Sep 2008 20:21:08 -0400 In-Reply-To: <20080918213336.548424061@localhost.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti wrote: > Since the sync page path can collapse flushes. > > Also only flush if the spte was writable before. > > Signed-off-by: Marcelo Tosatti > > @@ -1241,9 +1239,12 @@ static void mmu_set_spte(struct kvm_vcpu > } > } > if (set_spte(vcpu, shadow_pte, pte_access, user_fault, write_fault, > - dirty, largepage, gfn, pfn, speculative)) > + dirty, largepage, gfn, pfn, speculative)) { > if (write_fault) > *ptwrite = 1; > + if (was_writeble) > + kvm_x86_ops->tlb_flush(vcpu); > + } > > I think we had cases where the spte.pfn contents changed, for example when a large page was replaced by a normal page, and also: } else if (pfn != spte_to_pfn(*shadow_pte)) { -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.