Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1707615pxm; Fri, 4 Mar 2022 01:43:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzW8ifQlwmojRglKC/+U25R15QnoDgN+UoKL6JuJjr5jEflbrWq+HOBxKAbW05JQqWYFyjr X-Received: by 2002:a05:6a00:2285:b0:4e0:617e:dcee with SMTP id f5-20020a056a00228500b004e0617edceemr42097819pfe.66.1646386985855; Fri, 04 Mar 2022 01:43:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646386985; cv=none; d=google.com; s=arc-20160816; b=FMtT4pvpiEm9Q2KnpCk8vT5axoAUpJCBRI0oQ5562K3bOEqfIGRiukuA/uvLQSZXGX a0kTdoOqoTtjGTatsOlRzNu7IPTlTum6YTQqjEAZnxSsJKxCpQaSXRDfAVk3KU02sZqh LukpQ0ObdYBIGA6XQuHuc8YUM8EI8IENNuJZ1dpH4L8J+bgXz1CFhbqsjfe5xzRdeYLA du9+pQr4WRjU6avtVWBHJ7yVTH3Kw1Xhxzrd78BchpyF+1Zii/G9GyeXK2CHyR+jVCjc G2n6pX/+ByHtqtksd1MtkU6m53MsNh5FYuJ2NPYsGONv9b9Xt+jCt8cA46uOcEExvHrr /A6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=n+1C6L4TWWo6HxBz7hlGqpBnCKcY9EDXcxPAzxXUxQM=; b=qUTJlGii4odNVnGNuWmDkKFJ52QY3nd/4/+KyX4PHc4K+sMn+tDlhhFxEZTDixNx8h d7eP8sO9SxFTJqgKHCSaY2DejeoEBJs339cNmca5wZrT6nL//rkvX8P0PBQ9mx9zZPQ8 4VIstRWrqrBb2hHBQveeyFiWcX+ZINNeeKuwZPGj1bcZfpeEOgOsDDYpay3WSbsJTEL7 uDn+/4m3qwzfj6RbMxd0jSiLlEjraKjt9nsQE6lyJss7OJs4gHjqKWPDvsnBBYQyFLu2 lCFYoS6pY9tLCt/5oRHHcXkiBAIerqe9+ggOPXdXG3XBQJ5bRjnbZ/sumLhOjBX8vfWl sVCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VynikB2i; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x6-20020a17090aa38600b001ba03eb8cddsi4169753pjp.95.2022.03.04.01.42.49; Fri, 04 Mar 2022 01:43:05 -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=@intel.com header.s=Intel header.b=VynikB2i; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234426AbiCDIka (ORCPT + 99 others); Fri, 4 Mar 2022 03:40:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234434AbiCDIjv (ORCPT ); Fri, 4 Mar 2022 03:39:51 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1038119F47D; Fri, 4 Mar 2022 00:38:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646383110; x=1677919110; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=cHbsgcMFLgf5FBpyxCgfO30bNR0p2jztzb1eYSzo9QM=; b=VynikB2iGN5Xy7sAwhFVkAzbg79Xq7ePniLtQZu6ue2h1UwdhfcRWHxh 4xDahyFAe+KsbKEghF774B2CfWPAmT2fn6i86qENbyO75A/xjgZNlPPbH aedO8twDDd02x9+mUePPN/3or+qMDNmtjrqCb2Go1NUQcie7zPhv74mdZ eGe+pZHv1H7xfogcmQ+pHP/jx2U9tStpyD/jdCXeEZW6k7Ak8XyJC/2+a hql+7GNSV4O/Naer0v5KUjEyGsBecuMy6AZtGAxY8AKR8zYr5xLw1lQ/A aFamNpBp3VgtHADnbatHkUHKUCmVcdIAGiBqs63+FFpLXeFl/7N5J3cm/ A==; X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="253860938" X-IronPort-AV: E=Sophos;i="5.90,154,1643702400"; d="scan'208";a="253860938" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2022 00:38:28 -0800 X-IronPort-AV: E=Sophos;i="5.90,154,1643702400"; d="scan'208";a="552141471" Received: from arthur-vostro-3668.sh.intel.com ([10.239.13.120]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2022 00:38:23 -0800 From: Zeng Guang To: Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, Dave Hansen , Tony Luck , Kan Liang , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Kim Phillips , Jarkko Sakkinen , Jethro Beekman , Kai Huang Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Robert Hu , Gao Chao , Zeng Guang , Robert Hoo Subject: [PATCH v7 4/8] KVM: VMX: dump_vmcs() reports tertiary_exec_control field as well Date: Fri, 4 Mar 2022 16:07:21 +0800 Message-Id: <20220304080725.18135-5-guang.zeng@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220304080725.18135-1-guang.zeng@intel.com> References: <20220304080725.18135-1-guang.zeng@intel.com> X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 From: Robert Hoo Add tertiary_exec_control field report in dump_vmcs() Reviewed-by: Maxim Levitsky Signed-off-by: Robert Hoo Signed-off-by: Zeng Guang --- arch/x86/kvm/vmx/vmx.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 8a5713d49635..7beba7a9f247 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -5891,6 +5891,7 @@ void dump_vmcs(struct kvm_vcpu *vcpu) struct vcpu_vmx *vmx = to_vmx(vcpu); u32 vmentry_ctl, vmexit_ctl; u32 cpu_based_exec_ctrl, pin_based_exec_ctrl, secondary_exec_control; + u64 tertiary_exec_control; unsigned long cr4; int efer_slot; @@ -5904,9 +5905,16 @@ void dump_vmcs(struct kvm_vcpu *vcpu) cpu_based_exec_ctrl = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL); pin_based_exec_ctrl = vmcs_read32(PIN_BASED_VM_EXEC_CONTROL); cr4 = vmcs_readl(GUEST_CR4); - secondary_exec_control = 0; + if (cpu_has_secondary_exec_ctrls()) secondary_exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL); + else + secondary_exec_control = 0; + + if (cpu_has_tertiary_exec_ctrls()) + tertiary_exec_control = vmcs_read64(TERTIARY_VM_EXEC_CONTROL); + else + tertiary_exec_control = 0; pr_err("VMCS %p, last attempted VM-entry on CPU %d\n", vmx->loaded_vmcs->vmcs, vcpu->arch.last_vmentry_cpu); @@ -6006,9 +6014,10 @@ void dump_vmcs(struct kvm_vcpu *vcpu) vmx_dump_msrs("host autoload", &vmx->msr_autoload.host); pr_err("*** Control State ***\n"); - pr_err("PinBased=%08x CPUBased=%08x SecondaryExec=%08x\n", - pin_based_exec_ctrl, cpu_based_exec_ctrl, secondary_exec_control); - pr_err("EntryControls=%08x ExitControls=%08x\n", vmentry_ctl, vmexit_ctl); + pr_err("CPUBased=0x%08x SecondaryExec=0x%08x TertiaryExec=0x%016llx\n", + cpu_based_exec_ctrl, secondary_exec_control, tertiary_exec_control); + pr_err("PinBased=0x%08x EntryControls=%08x ExitControls=%08x\n", + pin_based_exec_ctrl, vmentry_ctl, vmexit_ctl); pr_err("ExceptionBitmap=%08x PFECmask=%08x PFECmatch=%08x\n", vmcs_read32(EXCEPTION_BITMAP), vmcs_read32(PAGE_FAULT_ERROR_CODE_MASK), -- 2.27.0