Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934474AbbENAep (ORCPT ); Wed, 13 May 2015 20:34:45 -0400 Received: from mga11.intel.com ([192.55.52.93]:16846 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752393AbbENAek (ORCPT ); Wed, 13 May 2015 20:34:40 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,424,1427785200"; d="scan'208";a="694591902" Date: Thu, 14 May 2015 08:16:49 +0800 From: Wanpeng Li To: Paolo Bonzini Cc: Xiao Guangrong , gleb@kernel.org, mtosatti@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 09/10] KVM: MMU: fix MTRR update Message-ID: <20150514001648.GA5206@kernel> Reply-To: Wanpeng Li References: <1431499348-25188-1-git-send-email-guangrong.xiao@linux.intel.com> <1431499348-25188-10-git-send-email-guangrong.xiao@linux.intel.com> <20150513084341.GA4910@kernel> <55535B40.2060504@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55535B40.2060504@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1055 Lines: 35 On Wed, May 13, 2015 at 04:10:08PM +0200, Paolo Bonzini wrote: > > >On 13/05/2015 10:43, Wanpeng Li wrote: >> kvm_mmu_reset_context >> kvm_mmu_unload >> mmu_free_roots >> >> The original root shadow page will be freed in mmu_free_roots, where I >> miss? >> >> Another question maybe not related to this patch: >> >> If kvm_mmu_reset_context is just called to destroy the original root >> shadow page and all the sptes will remain valid? > >SPTEs are kept around and cached. The "role" field is used as the hash >key; if the role doesn't change, SPTEs are reused, so you have to zap >the SPTEs explicitly. Thanks for your explanation. :) Btw, why the patch changelog mentioned that the root shadow page will be reused, I think it will be zapped in mmu_free_roots. Regards, Wanpeng Li > >Paolo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/