]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: x86: Include multiple indices with CPUID leaf 0x8000001d
authorJim Mattson <jmattson@google.com>
Wed, 27 Mar 2019 20:15:36 +0000 (13:15 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 May 2019 19:27:06 +0000 (21:27 +0200)
commit2e215c23b605e9c856ef168a68ecb114c2b0d33a
tree92b54972850c5423e5559ec0f9ff193dddaf77a3
parent51980a20dba5820b5f149f2f364774211d414973
kvm: x86: Include multiple indices with CPUID leaf 0x8000001d

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: 27bf221fac087 ("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: Jim Mattson <jmattson@google.com>
Reviewed-by: Marc Orr <marcorr@google.com>
Reviewed-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c