From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [patch 4/4] KVM: MMU: pinned sps are not candidates for deletion. Date: Tue, 9 Sep 2014 12:41:27 -0300 Message-ID: <20140909154127.GC4153@amt.cnet> References: <20140709191250.408928362@amt.cnet> <20140709191611.349481802@amt.cnet> <1C17FA2A-5EFB-46D8-A105-CCC31B4BCFC6@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, ak@linux.intel.com, pbonzini@redhat.com, gleb@kernel.org, avi.kivity@gmail.com To: Xiao Guangrong Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53719 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757123AbaIIPlt (ORCPT ); Tue, 9 Sep 2014 11:41:49 -0400 Content-Disposition: inline In-Reply-To: <1C17FA2A-5EFB-46D8-A105-CCC31B4BCFC6@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jul 22, 2014 at 05:59:42AM +0800, Xiao Guangrong wrote: > > On Jul 10, 2014, at 3:12 AM, mtosatti@redhat.com wrote: > > > Skip pinned shadow pages when selecting pages to zap. > > It seems there is no way to prevent changing pinned spte on > zap-all path? Xiao, The way would be to reload remote mmus, forcing the vcpu to exit, zapping a page, then vcpu will pagefault any necessary page via kvm_mmu_pin_pages. kvm_mmu_invalidate_zap_all_pages does: - spin_lock(mmu_lock) - kvm_reload_remote_mmus ... - spin_unlock(mmu_lock) So its OK to change pinned spte on zap all path. > I am thing if we could move pinned spte to another list (eg. pinned_shadow_pages) > instead of active list so that it can not be touched by any other free paths. > Your idea? As mentioned it above, it is ok to zap pinned sptes as long w reload remote mmus request is performed. That said, you still consider a separate list?