From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH v4 0/5] KVM: x86: flush tlb out of mmu-lock after write protection Date: Wed, 26 Mar 2014 12:54:40 +0800 Message-ID: <53325D90.80808@linux.vnet.ibm.com> References: <1394460109-3150-1-git-send-email-xiaoguangrong@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , avi.kivity@gmail.com, Marcelo Tosatti , Paolo Bonzini , "linux-kernel@vger.kernel.org" , kvm To: Hu Yaohui Return-path: Received: from e23smtp03.au.ibm.com ([202.81.31.145]:50800 "EHLO e23smtp03.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751803AbaCZEyR (ORCPT ); Wed, 26 Mar 2014 00:54:17 -0400 Received: from /spool/local by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 26 Mar 2014 14:54:15 +1000 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: A suggestion: please send a new mail to ask question, especially, when your question is not related to the patches, so that others will probably discover the topic and join the discussion. On 03/26/2014 12:25 AM, Hu Yaohui wrote: > Hi Guangrong, > Since you have written in the kvm/mmu.txt. > > > unsync: > If true, then the translations in this page may not match the guest's > translation. This is equivalent to the state of the tlb when a pte is > changed but before the tlb entry is flushed. Accordingly, unsync ptes > are synchronized when the guest executes invlpg or flushes its tlb by > other means. Valid for leaf pages. > > > > This make sense to me, my question is when those unsync bits will be > set? When the guest writes to the level 1 guest page tables, it will > not cause a page fault. Those unsync bit is unlikely to be set when > the entry is modified. (correct me if I am wrong). The bit is set in mmu_need_write_protect() where the host makes decision if the page need to be write-protected (!unsync) or to be unsynced.