diff options
author | Sean Christopherson <seanjc@google.com> | 2021-06-18 14:46:58 -0700 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-06-21 12:58:55 -0400 |
commit | ba1f82456ba8438a8abc96274d57bfe76d34a4a8 (patch) | |
tree | cc41db33207d02b21bf933e02db03a4f22dcfa5e /arch/x86/kvm/vmx/vmcs12.h | |
parent | 5140bc7d6bc8abad58b4f2a2c011607bfd922992 (diff) | |
download | linux-stable-ba1f82456ba8438a8abc96274d57bfe76d34a4a8.tar.gz linux-stable-ba1f82456ba8438a8abc96274d57bfe76d34a4a8.tar.bz2 linux-stable-ba1f82456ba8438a8abc96274d57bfe76d34a4a8.zip |
KVM: nVMX: Dynamically compute max VMCS index for vmcs12
Calculate the max VMCS index for vmcs12 by walking the array to find the
actual max index. Hardcoding the index is prone to bitrot, and the
calculation is only done on KVM bringup (albeit on every CPU, but there
aren't _that_ many null entries in the array).
Fixes: 3c0f99366e34 ("KVM: nVMX: Add a TSC multiplier field in VMCS12")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210618214658.2700765-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx/vmcs12.h')
-rw-r--r-- | arch/x86/kvm/vmx/vmcs12.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/arch/x86/kvm/vmx/vmcs12.h b/arch/x86/kvm/vmx/vmcs12.h index bb81a23afe89..5e0e1b39f495 100644 --- a/arch/x86/kvm/vmx/vmcs12.h +++ b/arch/x86/kvm/vmx/vmcs12.h @@ -206,12 +206,6 @@ struct __packed vmcs12 { #define VMCS12_SIZE KVM_STATE_NESTED_VMX_VMCS_SIZE /* - * VMCS12_MAX_FIELD_INDEX is the highest index value used in any - * supported VMCS12 field encoding. - */ -#define VMCS12_MAX_FIELD_INDEX 0x17 - -/* * For save/restore compatibility, the vmcs12 field offsets must not change. */ #define CHECK_OFFSET(field, loc) \ |