From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH 0/4] Unlocked TLB flush Date: Mon, 7 May 2012 22:27:41 -0300 Message-ID: <20120508012741.GA26336@amt.cnet> References: <1336044182-12023-1-git-send-email-avi@redhat.com> <20120508012534.GA26243@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, Xiao Guangrong , takuya.yoshikawa@gmail.com To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36112 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758078Ab2EHC3u (ORCPT ); Mon, 7 May 2012 22:29:50 -0400 Content-Disposition: inline In-Reply-To: <20120508012534.GA26243@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, May 07, 2012 at 10:25:34PM -0300, Marcelo Tosatti wrote: > On Thu, May 03, 2012 at 02:22:58PM +0300, Avi Kivity wrote: > > This patchset implements unlocked TLB flushing for KVM. An operation that > > generates stale TLB entries can mark the TLB as dirty instead of flushing > > immediately, and then flush after releasing mmu_lock but before returning > > to the guest or the caller. A few call sites are converted too. > > > > Note not all call sites are easily convertible; as an example, sync_page() > > must flush before reading the guest page table. > > Huh? Are you referring to: > > * Note: > * We should flush all tlbs if spte is dropped even though guest is > * responsible for it. Since if we don't, > * kvm_mmu_notifier_invalidate_page > * and kvm_mmu_notifier_invalidate_range_start detect the mapping page > * isn't > * used by guest then tlbs are not flushed, so guest is allowed to > * access the > * freed pages. > * And we increase kvm->tlbs_dirty to delay tlbs flush in this case. > > With an increased dirtied_count the flush can be performed > by kvm_mmu_notifier_invalidate_page. Which is what patch 1 does. Your comment regarding sync_page() above is what is outdated, unless i am missing something.