STRUCT PT_COMMON(9)
π 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 useREAD_ONCE/WRITE_ONCEto 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 are0or1depending onpt_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 β whenPT_FEAT_DYNAMIC_TOPis set, this reflects the maximum VA capability. that's the special case, iykyk βfeaturesβ a bitmap ofenum 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 theREAD_ONCE/WRITE_ONCEontop_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
- 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