• Jim Mattson's avatar
    kvm: x86: Include multiple indices with CPUID leaf 0x8000001d · 32a243df
    Jim Mattson authored
    Per the APM, "CPUID Fn8000_001D_E[D,C,B,A]X reports cache topology
    information for the cache enumerated by the value passed to the
    instruction in ECX, referred to as Cache n in the following
    description. To gather information for all cache levels, software must
    repeatedly execute CPUID with 8000_001Dh in EAX and ECX set to
    increasing values beginning with 0 until a value of 00h is returned in
    the field CacheType (EAX[4:0]) indicating no more cache descriptions
    are available for this processor."
    
    The termination condition is the same as leaf 4, so we can reuse that
    code block for leaf 0x8000001d.
    
    Fixes: 8765d753 ("KVM: X86: Extend CPUID range to include new leaf")
    Cc: Brijesh Singh <brijesh.singh@amd.com>
    Cc: Borislav Petkov <bp@suse.de>
    Signed-off-by: default avatarJim Mattson <jmattson@google.com>
    Reviewed-by: default avatarMarc Orr <marcorr@google.com>
    Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    32a243df
cpuid.c 25.3 KB