STRUCT PT_COMMON(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct pt_common(9) πŸ’…

okay so bestie, welcome to struct pt_common β€” the manual page, from the Kernel API Manual, and honestly? it's giving "one struct to rule all the page table implementations." like, all of them. no cap. let's get into it 🫢


✨ NAME ✨

struct pt_common β€” the struct for all page table implementations 🌈

like literally every single one. main character energy fr fr πŸ‘‘


🌸 SYNOPSIS 🌸

struct pt_common {
    uintptr_t top_of_table;
    u8 max_oasz_lg2;
    u8 max_vasz_lg2;
    unsigned int features;
 };

look at her. four fields. absolutely iconic πŸŽ€


πŸ¦‹ Members πŸ¦‹

  • top_of_table β€” okay so this one is doing double duty: it encodes both the table top pointer and the top level in a single value. yes, together. one value. multitasking queen πŸ’… The lower bits of the aligned table pointer are used for the level β€” sneaky but slay. You must use READ_ONCE/WRITE_ONCE to access it, no exceptions, do not just grab it casually, i am begging 😭
  • max_oasz_lg2 β€” the maximum number of bits the OA can contain. Upper bits must be zero. This may be less than what the page table format supports, but it must not be more β€” that's the vibe check it can never fail πŸ™ˆ
  • max_vasz_lg2 β€” the maximum number of bits the VA can contain. Upper bits are 0 or 1 depending on pt_full_va_prefix. Same rules, bestie: this may be less than what the page table format supports, but it must not be more. ✨ And listen β€” when PT_FEAT_DYNAMIC_TOP is set, this reflects the maximum VA capability. that's the special case, iykyk ⭐
  • features β€” a bitmap of enum pt_features πŸ”₯

πŸ‘‘ SEE ALSO πŸ‘‘

  • Kernel file ./include/linux/generic_pt/common.h
  • Generic Radix Page Table(9)
  • enum pt_features(9)

go read those next, bestie, they're literally connected 🧚


fr fr do not forget the READ_ONCE/WRITE_ONCE on top_of_table. i'm not being dramatic. okay maybe a little. but also not. πŸ’€

and that's the whole page!! πŸ’– this little beauty lives in ./include/linux/generic_pt and the version on the tin says October 2026 β€” so go forth, be iconic, and remember: upper bits must be zero. periodt. πŸ’œπŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from