cpuid_leaf(9)
π
cpuid_leaf(9) β the cpuid_leaf page, bestie edition π
okay so you're in the Kernel API Manual β¨ and this is literally the page for cpuid_leaf π
πΈ NAME πΈ
cpuid_leaf β access parsed CPUID data, no cap π«
β¨ SYNOPSIS β¨
cpuid_leaf (_cpuinfo , _leaf );
yes that's the whole thing, she's lowkey minimal π
π«Ά ARGUMENTS π«Ά
_cpuinfoβ your CPU capability structure reference, aka a'struct cpuinfo_x86'π hand her over and she'll do the rest._leafβ the CPUID leaf, and it's gotta be in compile-time0xNformat, mmkay? like e.g.0x0,0x2,0x80000000π
π¦ DESCRIPTION π¦
so basically she's giving cpuid_subleaf energy, except the CPUID subleaf is pinned to = 0 π
that's the whole vibe.
Example usage, bestie, copy it exactly π
const struct leaf_0x0_0 *l0 = cpuid_leaf(c, 0x0);
if (!l0) {
// Handle error
}
const struct leaf_0x80000000_0 *el0 = cpuid_leaf(c, 0x80000000);
if (!el0) {
// Handle error
}
like look at that if (!l0) check β she said handle your error, periodt ππ
π SEE ALSO π
go read these next, fr fr π β kernel file ./arch/x86/include/asm/cpuid/api.h:
cpuid_leaf_0x2(9)for_each_cpuid_0x2_desc(9)cpuid_subleaf(9)cpuid_leaf_raw(9)cpuid_subleaf_n(9)cpuid_subleaf_n_raw(9)cpuid_subleaf_count(9)
ok that's the page!! now go parse some CPUID data and slay ππ₯
and for the credits moment π β this cutie lives in ./arch/x86/include/asm/cpuid, dated October 2026, and the whole thing is cpuid_leaf(9) π bye bestie π¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms