ENUM PT_FEATURES(9)
π enum pt_features β Kernel API Manual, section 9, bestie π
Okay so this is the enum pt_features(9) page from the Kernel API Manual and honestly? It's a little banger. It's all about the feature bits you can flip on in a page table β every symbol in here is a bit position, no cap. π
β¨ NAME β¨
enum pt_features β the features that are turned on in the table. Each symbol is a bit position. That's it, that's the whole vibe. π
πΈ SYNOPSIS πΈ
enum pt_features {
PT_FEAT_DMA_INCOHERENT ,
PT_FEAT_FULL_VA ,
PT_FEAT_DYNAMIC_TOP ,
PT_FEAT_SIGN_EXTEND ,
PT_FEAT_FLUSH_RANGE ,
PT_FEAT_FLUSH_RANGE_NO_GAPS ,
PT_FEAT_DETAILED_GATHER
};
Like look at her. She's just a list of bits and she knows it. π¦
π Constants π
So here's the group chat, member by member:
PT_FEAT_DMA_INCOHERENTβ cache-flush the page table memory before you assume the hardware can read it. If this bit isn't set, an SMP release is sufficient for the HW to read it. Lowkey the most careful friend in the group. π§PT_FEAT_FULL_VAβ the table can span the full VA range, from0all the way toPT_VADDR_MAX. Main character energy, covers everything. πPT_FEAT_DYNAMIC_TOPβ the table's top level can be increased dynamically during map. Ngl this one's high maintenance: it requires HW support for atomically setting both the table top pointer and the starting table level. πPT_FEAT_SIGN_EXTENDβ the top most bit of the valid VA range sign extends up to the fullpt_vaddr_t. This divides the page table into three VA ranges:
0 -> 2^N - 1 Lower
2^N -> (MAX - 2^N - 1) Non-Canonical
MAX - 2^N -> MAX Upper
In this mode pt_common::max_vasz_lg2 includes the sign bit, and the upper bits that don't fall within the translation are just validated. π«Ά
If this is not set, there's no sign extension and valid VA goes from 0 to 2^N.
- 1.
PT_FEAT_FLUSH_RANGEβ IOTLB maintenance is done by flushing IOVA ranges, which cleans out any walk cache or any IOPTE fully contained by the range. The optimization objective here is to minimize the number of flushes, even if the ranges include IOVA gaps that don't actually need flushing. Efficiency queen behavior. π₯PT_FEAT_FLUSH_RANGE_NO_GAPSβ likePT_FEAT_FLUSH_RANGE, except the optimization objective is to only flush IOVA that has been changed. This mode is suitable for cases like hypervisor shadowing, where flushing unchanged ranges may cause the hypervisor to reparse a significant amount of page table. Not me causing an accidental reparse πPT_FEAT_DETAILED_GATHERβ fills in thestruct iommu_iotlb_gatherpt sub structure with info about which levels were changed. Receipts. Detailed receipts. π
π¦ SEE ALSO π¦
- Kernel file
./include/linux/generic_pt/common.h - Generic Radix Page Table(9)
struct pt_common(9)
iykyk π
bestie bestie bestie β this page lives in./include/linux/generic_pt, dated October 2026, and she's titledenum pt_features(9). Slay, go read the kernel source, 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