pt_clear_entries(9)
π pt_clear_entries β a Kernel API Manual moment
okay so bestie, we're in the kernel API manual, and today's main character is pt_clear_entries(9). she's a void function, she returns nothing, and she's here to hand you a freshly emptied run of page-table entries. no cap. β¨
πΈ NAME πΈ
pt_clear_entries β makes entries empty (non-present). literally just yeets the contents and leaves you with a blank slate, iykyk π«Ά
π SYNOPSIS π
void pt_clear_entries (struct pt_state *pts , unsigned int
num_contig_lg2 );
bestie look at her. void return, two args, no notes. π
π¦ ARGUMENTS π¦
ptsβ the starting table index π like, where the clearing begins. that's the vibe.num_contig_lg2β the number of contiguous items to clear π (yes it's log2-flavored, the name is telling you that itself, we love a self-documenting parameter).
π§ DESCRIPTION π§
so what does she actually do? she clears a run of entries. that's it, that's the whole gig. π₯
here's the part that matters though β a cleared entry will load back as PT_ENTRY_EMPTY, and it does not have any effect on table walking. so the walker just strolls right past it like it's not even there. iconic behavior honestly. π
β οΈ okay this is the important bit, don't skip it: the starting index must be aligned to num_contig_lg2. like, that's a hard requirement, not a suggestion. misaligned starting index? that's a you problem, bestie. π
β SEE ALSO β
the kernel file lives at ./drivers/iommu/generic_pt/pt_common.h β that's the whole squad's hangout spot π
and here's the full friend group, go say hi:
pt_attr_from_entry(9)pt_can_have_leaf(9)pt_can_have_table(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_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)
and that's the page, bestie π this whole thing ships out of ./drivers/iommu/generic_pt and it's dated October 2026 β so yeah, she's from the future, we stan a forward-thinking queen. periodt. π
β¨
π¦ 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