Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A85CC4338F for ; Thu, 29 Jul 2021 16:38:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF07260EFD for ; Thu, 29 Jul 2021 16:38:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229761AbhG2Qie (ORCPT ); Thu, 29 Jul 2021 12:38:34 -0400 Received: from mga11.intel.com ([192.55.52.93]:25602 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbhG2Qic (ORCPT ); Thu, 29 Jul 2021 12:38:32 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10060"; a="209812830" X-IronPort-AV: E=Sophos;i="5.84,278,1620716400"; d="scan'208";a="209812830" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2021 09:38:28 -0700 X-IronPort-AV: E=Sophos;i="5.84,278,1620716400"; d="scan'208";a="507347688" Received: from wye1-mobl1.ccr.corp.intel.com (HELO localhost) ([10.249.174.73]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2021 09:38:25 -0700 Date: Fri, 30 Jul 2021 00:38:22 +0800 From: Yu Zhang To: Paolo Bonzini Cc: Ben Gardon , Yan Zhao , Sean Christopherson , "kvm@vger.kernel.org" Subject: Re: A question of TDP unloading. Message-ID: <20210729163822.ubzszrvnnmol4zlr@linux.intel.com> References: <20210727161957.lxevvmy37azm2h7z@linux.intel.com> <20210728065605.e4ql2hzrj5fkngux@linux.intel.com> <20210728072514.GA375@yzhao56-desk.sh.intel.com> <20210728172241.aizlvj2alvxfvd43@linux.intel.com> <20210729030056.uk644q3eeoux2qfa@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thu, Jul 29, 2021 at 11:19:08AM +0200, Paolo Bonzini wrote: > On 29/07/21 05:00, Yu Zhang wrote: > > > I have a few questions about these unnecessary tear-downs during boot: > > > 1. How many teardowns did you observe, and how many different roles > > > did they represent? Just thrashing between two roles, or 12 different > > > roles? > > I saw 106 reloadings of the root TDP. Among them, 14 are caused by memslot > > changes. Remaining ones are caused by the context reset from CR0/CR4/EFER > > changes(85 for CR0 changes). > > Possibly because CR0/CR4/EFER are changed multiple times on SMM entry (to go > from real mode to protected mode to 32-bit to 64-bit)? But most of those > page tables should be very very small; they probably have only one page per > level. The SMM page tables are very small too, the only one that is really > expensive to rebuild is the main non-SMM EPT. Thanks Paolo. Well, I did not see any SMM entry in the whole test. And most resetings are due to CR0 changes in OVMF(74 out of 85), the rest are from guest kernel initialization stage. As expected, the number of SPs used are fairly small - about 5 - 10 for each TDP tree. For legcy TDP, since only 4 different TDP trees are built( the ones caused by memslot zapping are not counted). The total number of SPs are only 30+. B.R. Yu > > Paolo >