pt_install_leaf_entry(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… 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 if pt_can_have_leaf == false. that's a vibe check you will fail. and contiguous sizes that aren't indicated by pt_possible_sizes must 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