ENUM X86_HARDWARE_SUBARCH(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 asm startup_xen entry point and later jumps to the C xen_start_kernel entry point. both domU and dom0 type 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 for CE4100 is 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