pt_install_leaf_entry(9)
๐ pt_install_leaf_entry โ the kernel API manual, bestie edition ๐
okay so this is the page for pt_install_leaf_entry(9), straight out of the Kernel API Manual, and we're gonna get you fully caught up. no gatekeeping, no cap. โจ
โจ NAME โจ
pt_install_leaf_entry โ write a leaf entry to the table. that's it, that's the whole vibe. ๐ฆ
๐ธ SYNOPSIS ๐ธ
void pt_install_leaf_entry (struct pt_state *pts , pt_oaddr_t oa ,
unsigned int oasz_lg2 , const struct pt_write_attrs *attrs );
it returns void btw, so likeโฆ no return value to obsess over. she just does the thing. ๐
๐ซถ ARGUMENTS ๐ซถ
ptsโ the table index you're changing. main character of this call, fr.oaโ the Output Address this leaf is for.oasz_lg2โ the size, in VA/OA, that this leaf covers.attrsโ the attributes you want applied to the entry.
๐ DESCRIPTION ๐
so a leaf OA entry is literally the one that returns PT_ENTRY_OA from pt_load_entry. she translates the VA that pts points at into the oa you handed her. that's the whole job and she ate. ๐
for a single item, non-contiguous entry, oasz_lg2 is pt_table_item_lg2sz. for a contiguous one, it's pt_table_item_lg2sz + num_contig_lg2. do the math, bestie, it's giving very demure arithmetic. ๐งฎ
โ ๏ธ okay this part matters: do NOT call this ifpt_can_have_leaf == false. that's a vibe check you will fail. and contiguous sizes that aren't indicated bypt_possible_sizesmust not be specified either. periodt. ๐
๐ฆ SEE ALSO ๐ฆ
Kernel file ./drivers/iommu/generic_pt/pt_common.h โ go read her, she's iconic.
then the whole friend group, in order, no one left out: pt_attr_from_entry(9), pt_can_have_leaf(9), pt_can_have_table(9), pt_clear_entries(9), pt_entry_make_write_dirty(9), pt_entry_make_write_clean(9), pt_entry_is_write_dirty(9), pt_dirty_supported(9), pt_entry_num_contig_lg2(9), pt_entry_oa(9), pt_entry_oa_lg2sz(9), pt_entry_oa_exact(9), pt_full_va_prefix(9), pt_has_system_page_size(9), pt_install_table(9), pt_item_oa(9), pt_load_entry_raw(9), pt_max_oa_lg2(9), pt_num_items_lg2(9), pt_pgsz_lg2_to_level(9), pt_possible_sizes(9), pt_table_item_lg2sz(9), pt_table_oa_lg2sz(9), pt_table_pa(9), pt_table_ptr(9), pt_max_sw_bit(9), pt_test_sw_bit_acquire(9), pt_set_sw_bit_release(9), pt_load_entry(9).
anyway that's the page!! sourced from ./drivers/iommu/generic_pt, dated October 2026, and yeah we're still calling it pt_install_leaf_entry(9). k bye love u, go install some leaf entries responsibly ๐๐โญ
๐ฆ 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