From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751901AbaCZEys (ORCPT ); Wed, 26 Mar 2014 00:54:48 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:50799 "EHLO e23smtp03.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751783AbaCZEyR (ORCPT ); Wed, 26 Mar 2014 00:54:17 -0400 Message-ID: <53325D90.80808@linux.vnet.ibm.com> Date: Wed, 26 Mar 2014 12:54:40 +0800 From: Xiao Guangrong User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Hu Yaohui CC: Gleb Natapov , avi.kivity@gmail.com, Marcelo Tosatti , Paolo Bonzini , "linux-kernel@vger.kernel.org" , kvm Subject: Re: [PATCH v4 0/5] KVM: x86: flush tlb out of mmu-lock after write protection References: <1394460109-3150-1-git-send-email-xiaoguangrong@linux.vnet.ibm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14032604-6102-0000-0000-00000532E98D Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.