From: David Hildenbrand Subject: Re: [PATCH v2 1/3] kvm: vmx: Introduce VMCS12_MAX_FIELD_INDEX Date: Thu, 18 Jan 2018 17:46:01 +0100 Message-ID: <07edb591-c050-31e4-4a81-b273d6fe56b2@redhat.com> References: <20171221204623.164581-2-jmattson@google.com> <20171222201112.97818-1-jmattson@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Jim Mattson , kvm@vger.kernel.org, Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35224 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753406AbeARQqG (ORCPT ); Thu, 18 Jan 2018 11:46:06 -0500 In-Reply-To: <20171222201112.97818-1-jmattson@google.com> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 22.12.2017 21:11, Jim Mattson wrote: > 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; > } > > /* > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb