]> git.ipfire.org Git - thirdparty/linux.git/commit
x86/cacheinfo: Remove CPUID leaf 0x2 parsing loop
authorAhmed S. Darwish <darwi@linutronix.de>
Mon, 24 Mar 2025 13:32:57 +0000 (14:32 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 25 Mar 2025 09:22:02 +0000 (10:22 +0100)
commit09a1da4beb310420b720994f7b6599e8d0bce3e1
treef6e4bb181721897b3fb92e6ad00f32b5196b060e
parentb5969494c8d8a2384c0636707a538efad15d8660
x86/cacheinfo: 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 at commit 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-3-darwi@linutronix.de
arch/x86/kernel/cpu/cacheinfo.c