KVM: x86: Generate set of VMX feature MSRs using first/last definitions
authorSean Christopherson <seanjc@google.com>
Sat, 11 Mar 2023 00:46:01 +0000 (16:46 -0800)
committerSean Christopherson <seanjc@google.com>
Thu, 6 Apr 2023 21:57:23 +0000 (14:57 -0700)
commit9eb6ba31db27253a11441368d2801c1eedc48b4f
tree03da53f2b2ee99898e98fbc69a479255ff76cf23
parent5757f5b9562244e4b63f65576c16ca9eb21f81d2
KVM: x86: Generate set of VMX feature MSRs using first/last definitions

Add VMX MSRs to the runtime list of feature MSRs by iterating over the
range of emulated MSRs instead of manually defining each MSR in the "all"
list.  Using the range definition reduces the cost of emulating a new VMX
MSR, e.g. prevents forgetting to add an MSR to the list.

Extracting the VMX MSRs from the "all" list, which is a compile-time
constant, also shrinks the list to the point where the compiler can
heavily optimize code that iterates over the list.

No functional change intended.

Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://lore.kernel.org/r/20230311004618.920745-5-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/x86.c