x86/cpu: Remove CPUID leaf 0x2 parsing loop
authorAhmed S. Darwish <darwi@linutronix.de>
Mon, 24 Mar 2025 13:32:56 +0000 (14:32 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 25 Mar 2025 09:21:46 +0000 (10:21 +0100)
commitb5969494c8d8a2384c0636707a538efad15d8660
tree45d94b2f2ba0d18c18b841eab0f6e0373773b19b
parent0efb4dc3b084579efe7f5f88370b76d4f1c3bcee
x86/cpu: Remove CPUID leaf 0x2 parsing loop

Leaf 0x2 output includes a "query count" byte where it was supposed to
specify the number of repeated CPUID leaf 0x2 subleaf 0 queries needed to
extract all of the CPU's cache and TLB descriptors.

Per current Intel manuals, all CPUs supporting this leaf "will always"
return an iteration count of 1.

Remove the leaf 0x2 query loop and just query the hardware once.

Note, as previously done in:

  aec28d852ed2 ("x86/cpuid: Standardize on u32 in <asm/cpuid/api.h>")

standardize on using 'u32' and 'u8' types.

Suggested-by: Ingo Molnar <mingo@kernel.org>
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20250324133324.23458-2-darwi@linutronix.de
arch/x86/kernel/cpu/intel.c