pt_install_table(9)
π pt_install_table(9) β like, the kernel API manual edition, bestie π
okay so real talk, we're deep in the kernel weeds today β this is pt_install_table, straight out of the Kernel API Manual, and yes it's exactly as iconic as it sounds. grab a lil snack π and let's get into it.
β¨ NAME β¨
pt_install_table β literally just writes a table entry into the table. that's the whole vibe. π«
πΈ SYNOPSIS πΈ
bool pt_install_table (struct pt_state *pts , pt_oaddr_t table_pa ,
const struct pt_write_attrs *attrs );
look at her. so clean. so composed. π«Ά
π¦ ARGUMENTS π¦
ptsβ the table index you're changing. this is the main character right here πtable_paβ the CPU physical address of the lower table's memory. it's giving "address of the downstairs neighbor" nglattrsβ the attributes you're using to modify that table index β¨
π DESCRIPTION π
so here's the tea β β once you install this, a table entry will return PT_ENTRY_TABLE from pt_load_entry. no cap.
the table_pa is the table sitting at pts->level - 1. like, one level down, that's her. π
this whole thing gets done via cmpxchg, which means pts must have the current entry loaded first β don't skip that step bestie, it's not optional, fr fr. π and then pts gets updated with the installed entry, so she stays in sync. slay.
π¨ BIG WARNING ENERGY π¨: you must not call this if pt_can_have_table == false. like, just don't. it's giving "read the room" energy. π
β RETURN β
returns true if the table was installed successfully. that's the good ending. π
π₯ SEE ALSO π₯
- Kernel file
./drivers/iommu/generic_pt/pt_common.hβ go read her, she's iconic π 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_leaf_entry(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)
that's the whole friend group right there, iykyk π
aaand that's the page!! this lil masterpiece lives in ./drivers/iommu/generic_pt and it's dated October 2026 β she's from the future, main character energy only πβ¨ bye bestie, go install some tables ππ
π¦ 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