cpuid_leaf_0x2(9)
π
cpuid_leaf_0x2(9) π
okay so you're in the Kernel API Manual, bestie, and this is the page for cpuid_leaf_0x2(9). It's giving "sanitize the CPUID(0x2) register output before anyone gets hurt" realness, and honestly? iconic. β¨
πΈ NAME πΈ
cpuid_leaf_0x2 β Return sanitized CPUID(0x2) register output
β¨ SYNOPSIS β¨
void cpuid_leaf_0x2 (union leaf_0x2_regs *regs );
π ARGUMENTS π
regsβ Output parameter, bestie. This is where the CPUID(0x2) output gets stored. π«Ά
π DESCRIPTION π
Query CPUID(0x2) and store its output in regs. Then β and this is the important glow-up β if the hardware hands back any invalid 1-byte descriptor, this function force sets it to zero (that's the NULL cache/TLB descriptor) before returning it to the caller. Sanitized. Clean. No cursed descriptor energy making it through. π
Use for_each_cpuid_0x2_desc to iterate over the register output in parsed form. That's your bestie for walking the results without doing raw register brain surgery. π§
Lowkey crucial: invalid 1-byte descriptors do not stay invalid β they get zeroed out as the NULL cache/TLB descriptor before the caller sees them. fr fr.
π SEE ALSO π
- Kernel file:
./arch/x86/include/asm/cpuid/api.h for_each_cpuid_0x2_desc(9)cpuid_subleaf(9)cpuid_leaf(9)cpuid_leaf_raw(9)cpuid_subleaf_n(9)cpuid_subleaf_n_raw(9)cpuid_subleaf_count(9)
mwah π β from the source/version at ./arch/x86/include/asm/cpuid, October 2026, with cpuid_leaf_0x2(9) signing off π
π¦ 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