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 70A8FC433FE for ; Fri, 18 Feb 2022 23:59:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240267AbiBRX7b (ORCPT ); Fri, 18 Feb 2022 18:59:31 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:34898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235702AbiBRX73 (ORCPT ); Fri, 18 Feb 2022 18:59:29 -0500 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00F761D6855 for ; Fri, 18 Feb 2022 15:59:11 -0800 (PST) Received: by mail-pg1-x530.google.com with SMTP id p23so9177044pgj.2 for ; Fri, 18 Feb 2022 15:59:10 -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=BnFj/P/sSAUJ2PBj29OMx3Is3iN4AQ1QPVNV5MwbNxA=; b=Uz9m8eA4rTALEnbc5wY9Pgp+Xe5r1/1hunUlI+cghaJ4UcTU/ChhyHcXUwKWnyyKuU 5MK3Aya0BRxRvnkAu64K0uO69vc+6iYGZNR6/1JzVot9iCbQLR7gF0JHoq1ZhEONCC+J WcbT2rFhXPkFSmr9+USj+p4PzEx8c/8zNQYfun+FGOjWVRe9RtAKUg9jA4ZjGLzUZ75T hF2aT3F8smJBm4y/AXOfC7NQb6CM+KLtUWLw7qr3e36YKnZL8AVFG2nc4Ew7+IwKs3GP yogBeZg4bDOU/HKhljTgkgI/xpxrBVkVkWsn+9Oy77FpfJzGPIcXOGl/xuZ0ynfaLRZJ uvCQ== 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=BnFj/P/sSAUJ2PBj29OMx3Is3iN4AQ1QPVNV5MwbNxA=; b=BhM+3/Gi5Z1eJbeVYO3Ojxd6uBVC9Yx82gqKT7qQSF3H69FDYcSrA61BuMLu+/GLXL CqMoeeMHWbq43vSfqHINjRzlpq6RXv8PRtEQvndHNsv4UHA0Q+HfutpTA/3ZgboAiUFi esevsK4p42LS4f9k1VPBwVMypK2tzBZkbADSyLcEeQt4oKtU5wECoARIJ8yl3r/cbbU+ ec/gm3M6lC5bsFXF1ypv6k45asSyAK8v0eT7nUWgYAfUXOmCEDXWbsUGXv5n5HJkcJJv hnVvFJ3I16f9YR7jpUcXBhmYRr/9OqZTL67sNif8x9wP15Od6J5C2J/AMzH9iWFA5Q5v +lfg== X-Gm-Message-State: AOAM530lgj0fmiLFksbXN7r6TOSlxfseW7jaOlvraIkBjIp/sdgg4/sJ o/NOhqEIWYWkaMl7w+zQ5oxUeg== X-Google-Smtp-Source: ABdhPJxn6B5kdlQ/wyFRCfmUM1KEAt0TwuBVoOYa6puiIqlbhJOWVs6MyXPr8xetD/doVw0NbNkaew== X-Received: by 2002:a05:6a00:a83:b0:4e1:2bd9:7566 with SMTP id b3-20020a056a000a8300b004e12bd97566mr10078164pfl.63.1645228750327; Fri, 18 Feb 2022 15:59:10 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id b13sm4070619pfm.27.2022.02.18.15.59.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 15:59:09 -0800 (PST) Date: Fri, 18 Feb 2022 23:59:06 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v2 10/18] KVM: x86/mmu: load new PGD after the shadow MMU is initialized Message-ID: References: <20220217210340.312449-1-pbonzini@redhat.com> <20220217210340.312449-11-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220217210340.312449-11-pbonzini@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 17, 2022, Paolo Bonzini wrote: > Now that __kvm_mmu_new_pgd does not look at the MMU's root_level and > shadow_root_level anymore, pull the PGD load after the initialization of > the shadow MMUs. > > Besides being more intuitive, this enables future simplifications > and optimizations because it's not necessary anymore to compute the > role outside kvm_init_mmu. In particular, kvm_mmu_reset_context was not > attempting to use a cached PGD to avoid having to figure out the new role. > It will soon be able to follow what nested_{vmx,svm}_load_cr3 are doing, > and avoid unloading all the cached roots. > > Signed-off-by: Paolo Bonzini > --- Reviewed-by: Sean Christopherson