cpuid_leaf_0x2(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 🌈


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