ENUM X86_HARDWARE_SUBARCH(9)
β¨ enum x86_hardware_subarch β x86 hardware subarchitecture π
okay bestie, so this is a page straight out of the Kernel API Manual (section 9, iykyk) and it's all about the enum that tells Linux which flavor of x86 hardware it just woke up on. it's giving "hello, what kind of machine are you" energy and honestly? iconic. π
πΈ NAME πΈ
enum x86_hardware_subarch β the x86 hardware subarchitecture, fr fr
π¦ SYNOPSIS π¦
enum x86_hardware_subarch {
X86_SUBARCH_PC ,
X86_SUBARCH_LGUEST ,
X86_SUBARCH_XEN ,
X86_SUBARCH_INTEL_MID ,
X86_SUBARCH_CE4100 ,
X86_NR_SUBARCHS
};
π Constants π
X86_SUBARCH_PCβ the main character π you use this when the hardware is totally enumerable with the standard PC mechanisms (PCI,ACPI) and doesn't need any special little boot flow. the default, the safe pick, the "nothing weird happening here" option.X86_SUBARCH_LGUESTβ this one is for the x86 hypervisor demo,lguest. and bestieβ¦ it's deprecated. π« like, it's still in the enum but we don't stan anymore.X86_SUBARCH_XENβ for Xen guest types that follow the PV boot path. that path starts at the asmstartup_xenentry point and later jumps to the Cxen_start_kernelentry point. bothdomUanddom0type of guests are currently supported through this PV boot path, so yeah, it's got range. π₯X86_SUBARCH_INTEL_MIDβ for Intel MID (Mobile Internet Device) platform systems, the ones that don't have the PCI legacy interfaces. no legacy PCI for you, babes. πX86_SUBARCH_CE4100β for the Intel CE media processor (CE4100) SoC, the one living in settop boxes and media devices. and ngl, the use of a subarch forCE4100is more of a hackβ¦ π the manpage literally says so, I'm just the messenger.X86_NR_SUBARCHSβ-- undescribed --π that's it. that's the whole description. it's the count sentinel and the docs simply said "no thoughts, head empty."
π§ Description π§
okay so storytime π β the x86 hardware_subarch and hardware_subarch_data were added as of the x86 boot protocol 2.07 to help distinguish and support custom x86 boot sequences. this enum right here represents the accepted values for the x86 hardware_subarch. periodt.
custom x86 boot sequences (so, everything that's not X86_SUBARCH_PC) do not have β or simply *cannot* make use of β natural stubs like BIOS or EFI. so the hardware_subarch can be used on the Linux entry path to revector to a subarchitecture stub when needed. that subarchitecture stub can be used to set up Linux boot parameters, or for special care to account for nonstandard handling of page tables. lowkey important stuff. β¨
these enums should only ever be used by x86 code, and the code that uses it should be well contained and compartmentalized. keep it in its lane, bestie. π«Ά
KVM and Xen HVM do not have a subarch, because these are expected to follow standard x86 boot entries. if there's ever a genuine need for a "hypervisor" type, that should be considered separately in the future. and future guest types should seriously consider working with standard x86 boot stubs such as the BIOS or EFI boot stubs. π
β οΈ WARNING: this enum is only used for legacy hacks β for platform features that are not easily enumerated or discoverable. you should not ever use this for new features. like, no cap. don't do it. π ββοΈ
π SEE ALSO π
- the kernel file
./arch/x86/include/uapi/asm/bootparam.hβ go read it, it's right there π
and that's the whole vibe check, bestie! π this lil page lives over at ./arch/x86/include/uapi/asm, dated October 2026, and it's officially enum x86_hardware_subarch(9) β slay, go boot something. π¦π
π¦ 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