Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp769238pxb; Thu, 31 Mar 2022 17:33:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqpzPHeIg3oCYIT6QHArLt2n283UJYQ7opMJngfrlFa910AOcoEb5zqF3QafEP1M+2vEiq X-Received: by 2002:a17:903:1cd:b0:154:5edf:5704 with SMTP id e13-20020a17090301cd00b001545edf5704mr8047456plh.26.1648773238616; Thu, 31 Mar 2022 17:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648773238; cv=none; d=google.com; s=arc-20160816; b=BTjEC2uy3/F44o1JhhlY4svvxzafad1QhXIEnJFprk2ypeWnS9rtFS1ak/waKz5Wk9 7l6r+t/4sI0HV12ofJPTk8l6/XIl8hnXm6WgFUtV9rWz9NYDUSSNobi6mT3HiASO5G/K Y0HEz42vgUtaK1hVNRsReUUT9xq1s2jktmxZMkDd21iTQxT2XmLhzDjeZD+wv+HZ9Zw0 xCVW3QNSWcIXP4zdtJc9xLKUZf3RXL2NPzLmlrXF8T6ShQwxruL5Ea/9PrnjWiNnijh1 sSDnJnjbIqcRRH5mf2UwPUDtiDf1jQkVV3o/qhJmFAsszcloi6r+eiVLj/Suwh5CxW3S MLsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7uOUzZnbDEusnKR8cHWSyHd2FNHBMs+CYiJb4fGuX4g=; b=sRgtriSdvx5C6+51L2H8lBrhXutaEUYLVtJpOexmSY7dxeSSfCJigiXB9e9vdVi1cZ q7uTD4lFdn8gEyCLgkC1VKjG30EroBIcifMLJ/xI/4SINkbcC/UUVxgYrZxmNwA/EQ+6 TBuZB/x6tkrR7ETmJ9JNeBLkqqjjoW6Hq/uP4JtTcj0fzYPBV/aAyCCKG4E2buho97Cj 6NDYNhGLGcwyhCdFdr+RdZlG0V1abtHklUV3AexANQNJvSBDGf/BUpG9wVkuhTfrZeoR wip/liT1jV8rhBq2BzcjB98GnJcL9RjW/Y3grLRnecKCDCRLlENSMq8oEujM0mc1Gy3K r/KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=saclz8jk; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b21-20020a17090a8c9500b001bd14e01f3asi4343966pjo.40.2022.03.31.17.33.43; Thu, 31 Mar 2022 17:33:58 -0700 (PDT) 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=@google.com header.s=20210112 header.b=saclz8jk; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238979AbiCaWs2 (ORCPT + 99 others); Thu, 31 Mar 2022 18:48:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240324AbiCaWsZ (ORCPT ); Thu, 31 Mar 2022 18:48:25 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7817B2325D6 for ; Thu, 31 Mar 2022 15:46:37 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id bx24-20020a17090af49800b001c6872a9e4eso791812pjb.5 for ; Thu, 31 Mar 2022 15:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7uOUzZnbDEusnKR8cHWSyHd2FNHBMs+CYiJb4fGuX4g=; b=saclz8jkvtOn9nSRzBPhcHPd3drlaDn9wlVl5p8YFykQOEoBBxA0XJkjgZ8cTCzPK6 FMl6af4M26t9yd66jXObaOKA7AYFMkXhp/zQ1E5cjs+Dc23ZC7Nq5jU/PHfe2U3imyNZ hej+lIUS1XBxtRjX/eItimBO0l4FfZFjLqAwIOywtDOhEuP222M5iJalT5wFDvKu5hZM NJmvlEz/gJYLDuI1NB0/xng2DUv7PxMs7r89lLIQpBgUHyhU7N2mCgfCOjxqp5xo5mNe FH3Y02rsAJrnhoBxlMG+13CHQUkcVbCrlj1xEqWkzRqEYLxBDvivu8fTUEJwIxRgkwHy /TMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7uOUzZnbDEusnKR8cHWSyHd2FNHBMs+CYiJb4fGuX4g=; b=anI0FTL1FWQLpWPR5ADuxPArUeTu8pihd7dPQPTZy0ut/cJFNGFrUTnK+AMRsDc4VT eKft6e6p2CnK917FlsjgguwFXGuLz/aG8Nz7sOLXJ0UdEc3FkOxzQlNqXfyBM3qT5Epu YEufPfeSagHTnb7qyeUj79S5RWS787YUNkhp7CnDwtDPqxyQ3t9HyL1aErxv+u7veTGs LlDXFxEqcyYj0GkTWp5VA5cpNCIjTTwG97FjNvbPDXeuOs/VMEHh6QBN+190SwyFXQ0i /H6nNLCrTu7rjFk7nX72M7CaABrxMBkUmDY0J93+oZSyHXE4j9h17LZgsnZsQ9niFa3x NIsw== X-Gm-Message-State: AOAM530kiHTm6YZrNIddJMhXfxXZa3AfaTGqViAZC4cg6T7sGKdK5Q6i Loe60MiN7LhTHixdE747JZEGjA== X-Received: by 2002:a17:902:cccb:b0:156:4a0:a2e7 with SMTP id z11-20020a170902cccb00b0015604a0a2e7mr7427200ple.97.1648766796515; Thu, 31 Mar 2022 15:46:36 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id p4-20020a637404000000b00375948e63d6sm324113pgc.91.2022.03.31.15.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 15:46:35 -0700 (PDT) Date: Thu, 31 Mar 2022 22:46:32 +0000 From: Sean Christopherson To: Zeng Guang Cc: Paolo Bonzini , 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 , x86@kernel.org, linux-kernel@vger.kernel.org, Robert Hu , Gao Chao , Robert Hoo Subject: Re: [PATCH v7 4/8] KVM: VMX: dump_vmcs() reports tertiary_exec_control field as well Message-ID: References: <20220304080725.18135-1-guang.zeng@intel.com> <20220304080725.18135-5-guang.zeng@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220304080725.18135-5-guang.zeng@intel.com> X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Nit, shortlog is funky, it'd read better as KVM: VMX: Report tertiary_exec_control field in dump_vmcs() On Fri, Mar 04, 2022, Zeng Guang wrote: > From: Robert Hoo > > Add tertiary_exec_control field report in dump_vmcs() Please call out the shuffling of PinBased and provide a sample dump. It's not mandatory to put that sort of info in the changelog, but it really does help reviewers, e.g. I remember discussing the shuffling and seeing the sample output, but other reviewers coming into this blind won't have that luxury. > 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 >