ENUM PT_FEATURES(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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, from 0 all the way to PT_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 full pt_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 β€” like PT_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 the struct iommu_iotlb_gather pt 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 titled enum pt_features(9). Slay, go read the kernel source, periodt. βœ¨πŸŒˆπŸ’–
πŸ“¦ where this page comes from