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 0A609C433FE for ; Tue, 8 Mar 2022 02:04:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343712AbiCHCEy (ORCPT ); Mon, 7 Mar 2022 21:04:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244760AbiCHCEv (ORCPT ); Mon, 7 Mar 2022 21:04:51 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B27CF37BC2 for ; Mon, 7 Mar 2022 18:03:55 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id 6so10587076pgg.0 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=fCk48hkbDCO0W6hf0wvN/mNLszAIqCLYyuvU9RWxw3UAMVicA13yrSth2yLczhuarH JMqqP2SPW9EWiDdG+8ZJz1dXV4VD2B1MKs9aJSMGgrPR1EjE7JUOn5QH60CZ7grZIddM cIVeuNbC/b4oLM67CtgHIOz5nKaGiHDpcIt7W5pXdIoItRKu6EO1CmNIwMeWfy0Wfr0A /FMAnh+akOUWdv+VncaFYq0kLrCJVnTYpn2Bj8s/yGF6rt+ZpPj3Z2k0Sed/a7nutfpD 4ujxlqhy/WdmpUPQfyDg2/CoJoh06y3Rct2aUUaeGMPHZmYj+8uSrgfxbzq12WvrTAp6 cbsw== X-Gm-Message-State: AOAM532yue5fQ5vTb2TiakzAB8SLXmC+4py8GPD96YFlhL+GrJNc3/AN xy4OhYj2p9CMZyC1ZNqW8hFi+wnELIBb5Q== 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: linux-kernel@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 :-)