Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5547863pxb; Mon, 14 Feb 2022 01:32:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYa6yfbBtEJ6EFyeYozLZyNnkE+LhczxAAyAkedoB0iUXCEK1Frf3mEAwYEAa3m6n9IVh1 X-Received: by 2002:a17:907:d8d:: with SMTP id go13mr10414996ejc.440.1644831130694; Mon, 14 Feb 2022 01:32:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644831130; cv=none; d=google.com; s=arc-20160816; b=jqykjklaEbilxL6O6ZcAC88/jElujKwb0/zwXgq1ayMcy9afBk03tYNvhD2FhhpShu QbVGoY6kVpme+SJn6GJzghGFHkr3P1NnHng1SEpBTUHeWL9MISd8pdFcXwbipN6Omb31 qQcGK1whV1bjH18aYEeJQg85ItqlyWi8VchbQSsml9/OJPG8oEBW3NShkzg4ZjhyvRNX qNkfTfXTQyzGBn/nuQiUowI5HlDuIcH6yVtGBon11p5t9NNiRK+7zfNaPCPezUJrkvNb WAKbrgoloRD5oSBEgTVBwSBrLSsiiFnhEaMLPoPYTPvNYGbEvasO89TCJpedybv3CBNf BMMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=+bGomXKmD4Labg1JIcePjP5kik7k3u2urR4t7NcrCQU=; b=Kl5Kx2zzcJmxvee3qDLFgp2iKCCFW/BBOEd+oxh0pN8xe440/hU5cECPgEytecfGdf b+KJsjVmrrc3V74QQZZC9amRSBt+T6g3OD9hhwYkpAxIvJkk7ej4Q+rCP7F5cF1Pl3/Z SLT9j4d2qxqNC4176czvqhL5a5Zozf3XQU42zOGwYsuLbmwcWCM2kBnXdBLgZWDvUmcO /jRpR9/jrJPxPzMI4eXUdBKZxIghJXE6GbF2JFw2xfUvVAdU20sTiFvXV2fgAKmmtjKD p+4BD+KrreFVK3dUcjANds7s+0jn0h22mjmlwYCkTTIgmZ9BrZ8gJeeb8QnCpIloRh/F fL/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L9AYwlTF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t26si2816666edr.130.2022.02.14.01.31.47; Mon, 14 Feb 2022 01:32:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L9AYwlTF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352317AbiBKRsB (ORCPT + 93 others); Fri, 11 Feb 2022 12:48:01 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352316AbiBKRsA (ORCPT ); Fri, 11 Feb 2022 12:48:00 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0B663AE for ; Fri, 11 Feb 2022 09:47:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644601678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+bGomXKmD4Labg1JIcePjP5kik7k3u2urR4t7NcrCQU=; b=L9AYwlTF9HoLOmw2PsmXWKi44IvZAz9pxKVYf49yQHcIKtvraksYUki9OTPKo2yqQ3k15e AfJ1MJGoKKeKTadoPLyXZSmB/kGtFcbtf1O0gbpjQFRYQucd2QdzdAxXORaD5ViSLrhI44 4KQZKPN/DaTo/Hdq+rmQp1BqpRPHaJU= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-534-kcPVuhWQNnm5Q6NEpDGgHA-1; Fri, 11 Feb 2022 12:47:56 -0500 X-MC-Unique: kcPVuhWQNnm5Q6NEpDGgHA-1 Received: by mail-ej1-f69.google.com with SMTP id d7-20020a1709061f4700b006bbf73a7becso4402987ejk.17 for ; Fri, 11 Feb 2022 09:47:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=+bGomXKmD4Labg1JIcePjP5kik7k3u2urR4t7NcrCQU=; b=ZUF6xGvDe51bqvi7qMarhTa/eHdeb32NPA7ZwnZIRuKQqd48t3UAE1tq74b8ti69uh b80dMQYyTZ/EVP2PNXzvcHncNGERSJ9+bh82njOAaYEEA3+5ep7ESbmNlBoQUFdWaOuZ WOmEhL4oGVoFXmBbl5O9oor/GdlK5gWcvZb7NhiPsTLis9vJOAAg0denYlch5dOVKglX ++EHfiFz1E+CzgTVMVUNu+RQX8JApy1cobJL/gNAyWDjANWSR3FdRJvbkkuJge5gEj7D Q9lAVsvzVz46VN7xtf4XIpTbMcAVYjXlcvxno1p/WrYLzgEHMxnWQ0w4wa7F7z6gYXQd jleg== X-Gm-Message-State: AOAM5331dvBQgcW9mzGlHi4eSDyA/vY2soCSgt+c9tosT0VO4FDfByKw /wMwKuiv86nAaGWCI4YvrmM8FYVbj0uPcV+e0QuGTO4Dnvu2IyqK6fhTx008B2IPOZ767s47h3u lyACIGp8wNv1XPnRVn+KtBCnc X-Received: by 2002:a17:907:94d5:: with SMTP id dn21mr2371718ejc.77.1644601675460; Fri, 11 Feb 2022 09:47:55 -0800 (PST) X-Received: by 2002:a17:907:94d5:: with SMTP id dn21mr2371707ejc.77.1644601675282; Fri, 11 Feb 2022 09:47:55 -0800 (PST) Received: from ?IPV6:2001:b07:6468:f312:63a7:c72e:ea0e:6045? ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.googlemail.com with ESMTPSA id gx17sm4290834ejb.28.2022.02.11.09.47.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Feb 2022 09:47:54 -0800 (PST) Message-ID: <56ee0380-3717-b150-c674-08f76b6e295b@redhat.com> Date: Fri, 11 Feb 2022 18:47:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 10/12] KVM: MMU: load new PGD after the shadow MMU is initialized Content-Language: en-US To: Sean Christopherson Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, vkuznets@redhat.com, mlevitsk@redhat.com, dmatlack@google.com References: <20220209170020.1775368-1-pbonzini@redhat.com> <20220209170020.1775368-11-pbonzini@redhat.com> From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/11/22 18:45, Sean Christopherson wrote: > On Wed, Feb 09, 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 >> --- > > If you add a sanity check as described in the other thread[*], > > Reviewed-by: Sean Christopherson It's not as easy as I thought, but it becomes almost trivial with the CPU/MMU role refactoring. I'll get that posted as soon as I can push a final-ish version of this one to kvm/queue. Paolo