From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [patch 2/4] KVM: MMU: allow pinning spte translations (TDP-only) Date: Tue, 22 Jul 2014 13:26:22 +0800 Message-ID: <53CDF5FE.5080106@linux.vnet.ibm.com> References: <20140709191250.408928362@amt.cnet> <20140709191611.207208253@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, ak@linux.intel.com, pbonzini@redhat.com, gleb@kernel.org, avi.kivity@gmail.com To: Xiao Guangrong , mtosatti@redhat.com Return-path: Received: from e23smtp09.au.ibm.com ([202.81.31.142]:59518 "EHLO e23smtp09.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750742AbaGVF0Q (ORCPT ); Tue, 22 Jul 2014 01:26:16 -0400 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 Jul 2014 15:26:13 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 13BA82BB0040 for ; Tue, 22 Jul 2014 15:26:13 +1000 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s6M59Isw55115894 for ; Tue, 22 Jul 2014 15:09:18 +1000 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s6M5QCio011943 for ; Tue, 22 Jul 2014 15:26:12 +1000 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 07/22/2014 05:46 AM, Xiao Guangrong wrote: >> + if (is_pinned_spte(*sptep)) { >> + /* don't nuke pinned sptes if page aging: return >> + * young=yes instead. >> + */ >> + if (age) >> + return 1; >> + mmu_reload_pinned_vcpus(kvm); >> + } >> drop_spte(kvm, step); > > This has a window between zapping spte and re-pin spte, so guest will fail > at this time. I got it, mmu_reload_pinned_vcpus will kick all vcpus out of guest and pin the pages again... so it is ok. :)