]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Dynamically compute max VMCS index for vmcs12
authorSean Christopherson <seanjc@google.com>
Fri, 18 Jun 2021 21:46:58 +0000 (14:46 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 21 Jun 2021 16:58:55 +0000 (12:58 -0400)
commit95dc7e38ab4813a6a54aad42db8cbb0300eb74ff
treecc41db33207d02b21bf933e02db03a4f22dcfa5e
parent30e669f6d27e701b7637ca850fb696d58d5e0b5a
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: e52ff3c7d2a0 ("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>
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmcs.h
arch/x86/kvm/vmx/vmcs12.h