Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp704489pxm; Fri, 25 Feb 2022 17:47:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwgb0+JPm8JJ4edOG6qHWlWpDCzyq6DyH/5cFpyJUzR9gBILVmUJzBq+1/pNLj1aiWUL/AV X-Received: by 2002:a17:90a:d3d1:b0:1bb:fdc5:182 with SMTP id d17-20020a17090ad3d100b001bbfdc50182mr5896240pjw.206.1645840020215; Fri, 25 Feb 2022 17:47:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645840020; cv=none; d=google.com; s=arc-20160816; b=xUXhPQGWN7WGK3HHFUkriGxKXxa6RKXbHkQA50hEHvxEB/HQJuMyAsVPHHXq0V5N++ glRFCgWBCfmLhKdFdzB1nW/Zg0ooE6LOuxo6m3WErN2R3lmEO3korMYFnkF3MrtVyW5B dmxC14FZrxV1izA3h3pubovbX8dInOQ7hSfx0Ya5xfCBYIqxCghGfFVXzoqDFgfgwP6X M4xYnY4+nnUoiTPYPX4g9Gn/I/WqJFJ+RzIO1b613Cn/acvlfQHmQRI1VGRQTNsc1SZ9 TilL06d+KQnk2EqGt2emChl82JnXLh1FdtHVY/p0Cwz4g98TFyF6AWeJUCNplJ2S6pd7 nmTw== 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=ivd3PPxdGQUkmJ5t3Brc9B0aeJHFcAFOciq8j2MSNoo=; b=j4ettj8KaPPtSbPXv00oLgH3z0smOqvQIiNKT9QH1XP7ql4rCf6vIgno7acIQtQLWO lGDk4XfZquWafygdqFGwK5xl3TjjaeNEJEaF4HXpdENYNkTyWh4UXKvPHuDSWl/r/f2f lzfIBaTo8lIjsHoIGMYc6GxfmZL7rTcrjbcaZu4uAi20LwVCGejybVLepVdgQpEUQwit TcXrFH2+rR6rNJofi1sw37/eioy7cuTMU5w06EsPuyTh7FewA0vmdqQoN9tPRXrqPCC+ jHX4FkrfK8tmxxkHMh9velS0dBzYZV29J1as8wAIarxCZM0Cqnh28ZTzkwNWSo6w07kU Kr+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EfowDODo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u7-20020a63f647000000b0037866cad2d6si618472pgj.24.2022.02.25.17.46.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 17:47:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EfowDODo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 61B9B2013F4; Fri, 25 Feb 2022 17:35:44 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238726AbiBYIyK (ORCPT + 99 others); Fri, 25 Feb 2022 03:54:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238758AbiBYIyF (ORCPT ); Fri, 25 Feb 2022 03:54:05 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10DE7222187; Fri, 25 Feb 2022 00:53:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645779214; x=1677315214; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=6nN+aBuikGWyJ9R1HQeB9Y3n4h+iAnnSA4KQ/7gg/yc=; b=EfowDODoAVx6dNlhcUWBJUWMtw8DRP7hcH4hMUzg0Bl4mSxDaHGAv7ya K9VZRl4MFSnzX+6c5COdcwyeDMSN6OfwtCek+KdGefrSEWsbYv1DkdX6e JfsIvX5QG4PBYOHO+wG8OaJeiqN7a76mQsMvQlpp45Gy11qcINEJro/Ut 837Oe84wKji1uNF4oUCdQYpwsSwbp6AH3VT3+Jpqe0vXBqPMdeCrzvG7D ZweKk1zlP3XkmMMIr4pU6p62OGPM6DaVK+ss7Rws08DHl0kguPuixtTx/ aQLwySL5q6r1wjE1kClX+FLwj6WQa9+FVLX9RTcq9+UqFvEXwOzZ3VGcY g==; X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="277090064" X-IronPort-AV: E=Sophos;i="5.90,136,1643702400"; d="scan'208";a="277090064" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2022 00:53:33 -0800 X-IronPort-AV: E=Sophos;i="5.90,136,1643702400"; d="scan'208";a="549186493" 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; 25 Feb 2022 00:53:24 -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 v6 4/9] KVM: VMX: dump_vmcs() reports tertiary_exec_control field as well Date: Fri, 25 Feb 2022 16:22:18 +0800 Message-Id: <20220225082223.18288-5-guang.zeng@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220225082223.18288-1-guang.zeng@intel.com> References: <20220225082223.18288-1-guang.zeng@intel.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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() 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