KVM: nVMX: Add a helper to encode VMCS info in MSR_IA32_VMX_BASIC
authorSean Christopherson <seanjc@google.com>
Wed, 5 Jun 2024 23:19:15 +0000 (16:19 -0700)
committerSean Christopherson <seanjc@google.com>
Thu, 22 Aug 2024 18:25:52 +0000 (11:25 -0700)
commit92e648042c237c3bba223ab7f7e1a76f41ab3ef7
tree3075ec22e5b8b43c9247f9664b5aaf268d893561
parentc97b106fa8aa500823695abfda7c9bdefb42a648
KVM: nVMX: Add a helper to encode VMCS info in MSR_IA32_VMX_BASIC

Add a helper to encode the VMCS revision, size, and supported memory types
in MSR_IA32_VMX_BASIC, i.e. when synthesizing KVM's supported BASIC MSR
value, and delete the now unused VMCS size and memtype shift macros.

For a variety of reasons, KVM has shifted (pun intended) to using helpers
to *get* information from the VMX MSRs, as opposed to defined MASK and
SHIFT macros for direct use.  Provide a similar helper for the nested VMX
code, which needs to *set* information, so that KVM isn't left with a mix
of SHIFT macros and dedicated helpers.

Reported-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Link: https://lore.kernel.org/r/20240605231918.2915961-8-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/vmx.h
arch/x86/kvm/vmx/nested.c