From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Mattson Subject: [PATCH 1/3] kvm: vmx: Introduce VMCS12_MAX_FIELD_INDEX Date: Thu, 21 Dec 2017 12:46:21 -0800 Message-ID: <20171221204623.164581-2-jmattson@google.com> References: <20171221204623.164581-1-jmattson@google.com> Cc: Jim Mattson To: kvm@vger.kernel.org Return-path: Received: from mail-io0-f196.google.com ([209.85.223.196]:35585 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753178AbdLUUrL (ORCPT ); Thu, 21 Dec 2017 15:47:11 -0500 Received: by mail-io0-f196.google.com with SMTP id 14so15900434iou.2 for ; Thu, 21 Dec 2017 12:47:11 -0800 (PST) In-Reply-To: <20171221204623.164581-1-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