x86/cacheinfo: Refactor CPUID leaf 0x2 cache descriptor lookup
authorThomas Gleixner <tglx@linutronix.de>
Mon, 24 Mar 2025 13:33:00 +0000 (14:33 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 25 Mar 2025 09:22:13 +0000 (10:22 +0100)
commitee159792a4db06e359a5e2e231c6f1242ec76c31
tree837e0a17005ecaaccbba074446c0a417710f576e
parenta078aaa38a23a2595addb14ac286d8b8ae793d39
x86/cacheinfo: Refactor CPUID leaf 0x2 cache descriptor lookup

Extract the cache descriptor lookup logic out of the leaf 0x2 parsing
code and into a dedicated function.  This disentangles such lookup from
the deeply nested leaf 0x2 parsing loop.

Remove the cache table termination entry, as it is no longer needed
after the ARRAY_SIZE()-based lookup.

[ darwi: Move refactoring logic into this separate commit + commit log.
 Remove the cache table termination entry. ]

Signed-off-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-6-darwi@linutronix.de
arch/x86/kernel/cpu/cacheinfo.c