From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Mattson Subject: [PATCH v2 1/3] kvm: vmx: Introduce VMCS12_MAX_FIELD_INDEX Date: Fri, 22 Dec 2017 12:11:12 -0800 Message-ID: <20171222201112.97818-1-jmattson@google.com> References: <20171221204623.164581-2-jmattson@google.com> Cc: Jim Mattson To: kvm@vger.kernel.org, Paolo Bonzini Return-path: Received: from mail-it0-f67.google.com ([209.85.214.67]:46137 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756764AbdLVUL3 (ORCPT ); Fri, 22 Dec 2017 15:11:29 -0500 Received: by mail-it0-f67.google.com with SMTP id t1so15479201ite.5 for ; Fri, 22 Dec 2017 12:11:28 -0800 (PST) In-Reply-To: <20171221204623.164581-2-jmattson@google.com> Sender: kvm-owner@vger.kernel.org List-ID: This is the highest index value used in any supported VMCS12 field encoding. It is used to populate the IA32_VMX_VMCS_ENUM MSR. Signed-off-by: Jim Mattson --- arch/x86/kvm/vmx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 669f5f74857d..dfce28498636 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -418,6 +418,12 @@ struct __packed vmcs12 { */ #define VMCS12_SIZE 0x1000 +/* + * VMCS12_MAX_FIELD_INDEX is the highest index value used in any + * supported VMCS12 field encoding. + */ +#define VMCS12_MAX_FIELD_INDEX 0x17 + /* * The nested_vmx structure is part of vcpu_vmx, and holds information we need * for correct emulation of VMX (i.e., nested VMX) on this vcpu. @@ -3005,7 +3011,7 @@ static void nested_vmx_setup_ctls_msrs(struct vcpu_vmx *vmx) rdmsrl(MSR_IA32_VMX_CR4_FIXED1, vmx->nested.nested_vmx_cr4_fixed1); /* highest index: VMX_PREEMPTION_TIMER_VALUE */ - vmx->nested.nested_vmx_vmcs_enum = 0x2e; + vmx->nested.nested_vmx_vmcs_enum = VMCS12_MAX_FIELD_INDEX << 1; } /* -- 2.15.1.620.gb9897f4670-goog