Re: [PATCH v4 2/6] KVM: x86: Introduce CPUID_8000_0007_EDX 'scattered' leaf

From: Sean Christopherson
Date: Tue Oct 11 2022 - 15:15:49 EST


On Thu, Sep 22, 2022, Vitaly Kuznetsov wrote:
> diff --git a/arch/x86/kvm/reverse_cpuid.h b/arch/x86/kvm/reverse_cpuid.h
> index a19d473d0184..a5514c89dc29 100644
> --- a/arch/x86/kvm/reverse_cpuid.h
> +++ b/arch/x86/kvm/reverse_cpuid.h
> @@ -12,7 +12,8 @@
> * "bug" caps, but KVM doesn't use those.
> */
> enum kvm_only_cpuid_leafs {
> - CPUID_12_EAX = NCAPINTS,
> + CPUID_12_EAX = NCAPINTS,
> + CPUID_8000_0007_EDX = NCAPINTS + 1,

No need to explicitly initialize the new leaf, only the first enum entry needs
explicit initialization to NCAPINTS, i.e. let all other entries automatically
increment. The order doesn't matter, so not caring about the exact value will
avoid bugs due to mismerge and/or bad copy+paste.