From nobody Fri Sep 12 07:35:25 2025 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 39515C001DB for ; Thu, 10 Aug 2023 12:45:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235105AbjHJMpv (ORCPT ); Thu, 10 Aug 2023 08:45:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232117AbjHJMpt (ORCPT ); Thu, 10 Aug 2023 08:45:49 -0400 X-Greylist: delayed 907 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 10 Aug 2023 05:45:48 PDT Received: from baidu.com (mx20.baidu.com [111.202.115.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EC2F1B4 for ; Thu, 10 Aug 2023 05:45:47 -0700 (PDT) From: Shiyuan Gao To: , , CC: , , , , , , , Shiyuan Gao Subject: [PATCH] KVM: VMX: Rename vmx_get_max_tdp_level to vmx_get_max_ept_level Date: Thu, 10 Aug 2023 19:38:53 +0800 Message-ID: <20230810113853.98114-1-gaoshiyuan@baidu.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex09.internal.baidu.com (172.31.51.49) To bjkjy-mail-ex26.internal.baidu.com (172.31.50.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex15_2023-08-10 19:39:02:844 X-FEAS-Client-IP: 10.127.64.38 X-FE-Policy-ID: 15:10:21:SYSTEM Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" In vmx, ept_level looks better than tdp level and is consistent with svm get_npt_level(). Signed-off-by: Shiyuan Gao --- arch/x86/kvm/vmx/vmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index df461f387e20..f0cfd1f10a06 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -3350,7 +3350,7 @@ void vmx_set_cr0(struct kvm_vcpu *vcpu, unsigned long= cr0) vmx->emulation_required =3D vmx_emulation_required(vcpu); } =20 -static int vmx_get_max_tdp_level(void) +static int vmx_get_max_ept_level(void) { if (cpu_has_vmx_ept_5levels()) return 5; @@ -8526,7 +8526,7 @@ static __init int hardware_setup(void) */ vmx_setup_me_spte_mask(); =20 - kvm_configure_mmu(enable_ept, 0, vmx_get_max_tdp_level(), + kvm_configure_mmu(enable_ept, 0, vmx_get_max_ept_level(), ept_caps_to_lpage_level(vmx_capability.ept)); =20 /* --=20 2.36.1