]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tools/x86/kcpuid: Use <cpuid.h> intrinsics
authorAhmed S. Darwish <darwi@linutronix.de>
Mon, 24 Mar 2025 14:20:31 +0000 (15:20 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 25 Mar 2025 08:53:45 +0000 (09:53 +0100)
commitc479a84488d10b3d4259186d80839f99e26b1706
treed85f6fb31a81ea5b6b21afeb899c98db43ddb8ef
parent0a8f12ccd2e6edac89292af63c3a2050b4aac61b
tools/x86/kcpuid: Use <cpuid.h> intrinsics

Use the __cpuid_count() intrinsic, provided by GCC and LLVM, instead of
rolling a manual version.  Both of the kernel's minimum required GCC
version (5.1) and LLVM version (13.0.1) supports it, and it is heavily
used across standard Linux user-space tooling.

This also makes the CPUID call sites more readable.

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-11-darwi@linutronix.de
tools/arch/x86/kcpuid/kcpuid.c