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 0F81BC433EF for ; Sat, 5 Feb 2022 14:48:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380175AbiBEOrF (ORCPT ); Sat, 5 Feb 2022 09:47:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41956 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239597AbiBEOrE (ORCPT ); Sat, 5 Feb 2022 09:47:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644072424; 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=aPLpvuiVypXts2FgeP2y88Eeuzjb+/ygbPxEt8OZv/4=; b=NajsOKvBTJjgU6z18Lwi/co+RNMtP6ztx2GH6QKyNg19gvfSl2hiQrx0TYozrFGJUKMIRd hOu/PyhUR4bkFgJZ7gxV+xEJW+KxwIA22k9pEOJ63yi3jAudSOxnsnKlE+u2KKM9tdelru 5MRqraOS5Bqdft++kwm9ylVTrl72dy8= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-136-Kjng4bB0MTKRMhy7aGCiaw-1; Sat, 05 Feb 2022 09:47:02 -0500 X-MC-Unique: Kjng4bB0MTKRMhy7aGCiaw-1 Received: by mail-ed1-f72.google.com with SMTP id i22-20020a0564020f1600b00407b56326a2so4757746eda.18 for ; Sat, 05 Feb 2022 06:47:02 -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=aPLpvuiVypXts2FgeP2y88Eeuzjb+/ygbPxEt8OZv/4=; b=FyHyqQUQxbrfMzxLmNWq4SmcFYXHXxtrY0lfyLIpgSPyP3tREdBeApiAn2WLJ7Zpmx wzD0yfVESqDE+XrmIfhtEEv+5KQ7OBI/6yBmn1YCLg+0du/OjnyFq00yP2MMIU63yOP1 Up/qUAsfs9VFdYOlRMv7PmN+IIG+nh+DxHfFQsE7QkC5e5VYMtQKdbtMYYqLqFbdHUDj EzZ5i7mRZWf8Tw5BPTuo/v1XJevxBDY4j8X9aGyXv7/lCgiCyiHrRaNkwpy3xq2jHKM1 bYgM2GSFOFXW17ujROhct6+kvOtRZTQTstFiX0RI0OI9rSpltA3zcr3wgJueNIbLdmLt 6ZlA== X-Gm-Message-State: AOAM530zYSyyiXXMc/C/2ficFecY6wE26P0GOt856XsnRg4EFT8tp8WS 8uRKSG+bu+jEx/B2J0D8F1QrSZzVdRXtjtREKMtzLn0+Hnkt9/O3fBIR8UC0KYwl1ckA6R/joPJ UJNLAkCIidIumiZ6XK83pZ2vI X-Received: by 2002:a05:6402:1007:: with SMTP id c7mr4656912edu.424.1644072421483; Sat, 05 Feb 2022 06:47:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzekRqBKPktvzvqCpa6BNeqw4RYiEIa8aq6jU7oJn2qc5RF0X07KF/wHqGZiSVkAT4tRoUA9w== X-Received: by 2002:a05:6402:1007:: with SMTP id c7mr4656885edu.424.1644072421248; Sat, 05 Feb 2022 06:47:01 -0800 (PST) Received: from ?IPV6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.googlemail.com with ESMTPSA id g9sm1673202ejf.33.2022.02.05.06.47.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 05 Feb 2022 06:47:00 -0800 (PST) Message-ID: <32abf43b-7220-e905-c877-301fd1301ea1@redhat.com> Date: Sat, 5 Feb 2022 15:46:59 +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 07/23] KVM: MMU: remove kvm_mmu_calc_root_page_role Content-Language: en-US To: David Matlack Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, seanjc@google.com, vkuznets@redhat.com References: <20220204115718.14934-1-pbonzini@redhat.com> <20220204115718.14934-8-pbonzini@redhat.com> From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/4/22 20:32, David Matlack wrote: > On Fri, Feb 04, 2022 at 06:57:02AM -0500, Paolo Bonzini wrote: >> Since the guest PGD is now loaded after the MMU has been set up >> completely, the desired role for a cache hit is simply the current >> mmu_role. There is no need to compute it again, so __kvm_mmu_new_pgd >> can be folded in kvm_mmu_new_pgd. >> >> As an aside, the !tdp_enabled case in the function was dead code, >> and that also gets mopped up as a side effect. > Couldn't the !tdp_enabled case be called via kvm_set_cr3() -> > kvm_mmu_new_pgd()? > Right, it's not dead code. Rather, there never was a need for kvm_mmu_calc_root_page_role(vcpu) as opposed to just using what is already in vcpu->arch.mmu. Paolo