pt_upper_range(9)
π pt_upper_range β wait, bestie, this is the manual for it
okay so real talk, we're in the Kernel API Manual today and the star of the show is pt_upper_range(9). yes, a whole manpage, for one lil function. she's iconic like that π
β¨ NAME β¨
pt_upper_range β returns a range that spans part of the top level. yep, part of it, not the whole thing, depending on how the vibes (okay, the feature flags) are set π¦
πΈ SYNOPSIS πΈ
struct pt_range pt_upper_range (struct pt_common *common );
that's it. that's the whole call. one argument, returns a struct pt_range, we love a low-maintenance queen π
π«Ά ARGUMENTS π«Ά
commonβ the table. that's the whole description in the original and honestly? respect the brevity. it's the table, bestie, hand it over π
π DESCRIPTION π
okay so here's the tea β
for PT_FEAT_SIGN_EXTEND this returns the upper range, and it covers half the total page table. literally half. 50%. a whole 0.5 of the page table, no cap.
otherwise β like, if that feature isn't in the picture β it just returns the entire page table. the whole thing. all of it. main character range energy π
so like, tl;dr: sometimes you get half, sometimes you get everything. depends on PT_FEAT_SIGN_EXTEND. check before you assume, iykyk π€
π SEE ALSO π
okay this list is long, buckle up bestie, we're going on a tour of the whole pt family π§β¨
kernel file ./drivers/iommu/generic_pt/pt_iter.h β that's where the magic lives, go read it, she's gorgeous π
and then all of these icons:
pt_check_range(9)pt_index_to_va(9)pt_entry_fully_covered(9)pt_range_to_index(9)pt_range_to_end_index(9)pt_next_entry(9)for_each_pt_level_entry(9)pt_load_single_entry(9)pt_top_range(9)pt_all_range(9)pt_make_range(9)pt_init(9)pt_init_top(9)pt_descend(9)pt_walk_range(9)pt_range_slice(9)pt_top_memsize_lg2(9)pt_compute_best_pgsize(9)PT_MAKE_LEVELS(9)
go click through them like it's a playlist, fr fr π§π₯
ngl the entire vibe of this page is "small function, big range energy". go read the neighbours, they explain the ecosystem π
okay that's the whole page, we ate and left no crumbs π
she ships out of ./drivers/iommu/generic_pt, dated October 2026 β like, the version stamp is literally part of the lore, periodt π pt_upper_range(9) forever, mwah π
π¦ 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