From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB564C433EF for ; Tue, 8 Mar 2022 02:03:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244741AbiCHCEx (ORCPT ); Mon, 7 Mar 2022 21:04:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233856AbiCHCEv (ORCPT ); Mon, 7 Mar 2022 21:04:51 -0500 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1C6437AB2 for ; Mon, 7 Mar 2022 18:03:55 -0800 (PST) Received: by mail-pf1-x42a.google.com with SMTP id t5so16052825pfg.4 for ; Mon, 07 Mar 2022 18:03:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zPzE/KfxbqfCkt+sqJq4FYPy7nIua70yVKy4tSIv5RA=; b=VwTw70sJKoLQiysdLPX6D/SefpFSl81t2xvKLz2JnVk36UTyxEl5w9/YGj7WWqSmkY MAej2K+cZwfZGKdyRuU00RuqRFS36roucvKoFEEPiErMtBRcvM2FfumcB/DIyYdl/ST5 hIIM2MIjKXmhrt1rDRXTKheQtHHk1kXMQn4+3Src+BzTTa47Dh5Lr6lCgoIBgjm85IDk 2gfDrNbvHZ9+NrJVQ7IeAyS1zlA4lO/FiCAZUv1v+hSBWUaUvI8DkHOWCiLM1k+u2NiW 8k7r8UkOpplGn27bT12UbxpgH+VvUjdUjMPnC9HYpz+zWUdDrIUJDAY6sSzpTGaOKehV ZubA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zPzE/KfxbqfCkt+sqJq4FYPy7nIua70yVKy4tSIv5RA=; b=opp9lDf7Yuv+eE9Jt6inRfYID9zR+e6Pba2XzCY/4nGWuYKCPZgf5UBl+b6D3u0Mcv 0U/NKv+IfGgvTumsJUx3/P6zSlzvK65f778swM8YFfdQ4nTqn1TjiKjyB1FZOm12HRG/ 8XR/lkwYRUizJn43VFnhw7iCOuqm10jlgRG2d/CLkVUsfh1Y+nN17nrWuXZV0RnxrvWE V8YkuJzxJ9Aa63/BNRFmUt30AydjXzmIFzdhs/PNmTPE7kJZkGBJ2gj8rLBOFbJgjVwC /9RsZNqP5tWfC4hdo5iGChrDYPna6DpKIPapbhwh5MiisJwRgAGF00AxOt7XgW5HLzzH X8gg== X-Gm-Message-State: AOAM533v9NUxNyHupd9FE+1WrvZ5wHPZEdUe7iVHR0PzWMAHQuSzW1rn mcgs38iR1IbCfOutZa3cY6fYUg== X-Google-Smtp-Source: ABdhPJySyxMD46AZLFdfyu+2YVLdLlsgsst7NXg+2/aGLlTxFGSpNWOI/il55Lz0Dbvf78yMXeM+kg== X-Received: by 2002:a05:6a02:18b:b0:362:c8e4:d8f4 with SMTP id bj11-20020a056a02018b00b00362c8e4d8f4mr12427851pgb.86.1646705035060; Mon, 07 Mar 2022 18:03:55 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id i192-20020a636dc9000000b0037c7149fb0asm11654410pgc.89.2022.03.07.18.03.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 18:03:54 -0800 (PST) Date: Tue, 8 Mar 2022 02:03:50 +0000 From: Sean Christopherson To: Hao Peng Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kvm: x86: Improve virtual machine startup performance Message-ID: References: <20220301063756.16817-1-flyingpeng@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thu, Mar 03, 2022, Hao Peng wrote: > On Thu, Mar 3, 2022 at 9:29 AM Sean Christopherson wrote: > > > > On Wed, Mar 02, 2022, Hao Peng wrote: > > > Thanks for pointing this out. However, other than shadow_root_level, > > > other fields of context will not > > > change during the entire operation, such as > > > page_fault/sync_page/direct_map and so on under > > > the condition of tdp_mmu. > > > Is this patch still viable after careful confirmation of the fields > > > that won't be modified? > > > > No, passing around the "init" flag is a hack. > > > > But, we can achieve what you want simply by initializing the constant data once > > per vCPU. There's a _lot_ of state that is constant for a given MMU now that KVM > > uses separate MMUs for L1 vs. L2 when TDP is enabled. I should get patches posted > > tomorrow, just need to test (famous last words). Famous last words indeed. Long story short, the patches were mostly easy, but I wandered deep into a rabbit hole when trying to make ->inject_page_fault() constant per MMU. I'll get something posted this week, though exactly what that something is remains to be seen :-)