tools/x86/kcpuid: Save CPUID output in an array
authorAhmed S. Darwish <darwi@linutronix.de>
Mon, 24 Mar 2025 14:20:25 +0000 (15:20 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 25 Mar 2025 08:53:44 +0000 (09:53 +0100)
commit6bef74cab03ada39f16f1fb86b732f7c71a9f07a
treed4a78f3f2356eefc6e8843ff5cb161b0f3451550
parent660c29fe53deeb3b3aef1d666ed3bde7608380bd
tools/x86/kcpuid: Save CPUID output in an array

For each CPUID leaf/subleaf query, save the output in an output[] array
instead of spelling it out using EAX to EDX variables.

This allows the CPUID output to be accessed programmatically instead of
calling decode_bits() four times.  Loop-based access also allows "kcpuid
--detail" to print the correct output register names in next commit.

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>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20250324142042.29010-5-darwi@linutronix.de
tools/arch/x86/kcpuid/kcpuid.c