Re: [PATCH v2 04/21] KVM: x86: Generate set of VMX feature MSRs using first/last definitions

From: Xiaoyao Li
Date: Tue Feb 14 2023 - 01:37:04 EST


On 2/10/2023 8:31 AM, Sean Christopherson wrote:
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.

Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>

Reviewed-by: Xiaoyao Li <xiaoyao.li@xxxxxxxxx>