xe_pt_zap_ptes(9)
π xe_pt_zap_ptes β Kernel API Manual β¨
okay so bestie, welcome to xe_pt_zap_ptes, a kernel API manual page straight out of the group chat of GPU memory management. it lives in the Kernel API Manual, section 9. strap in, we're zapping ptes. π«Ά
β¨ NAME β¨
xe_pt_zap_ptes β zap (zero) gpu ptes of an address range. literally zeroing them. gone. poof. π
πΈ SYNOPSIS πΈ
bool xe_pt_zap_ptes (struct xe_tile *tile , struct xe_vma *vma );
π¦ ARGUMENTS π¦
tileβ the tile we're zapping for. yes, that tile. the one you're working on. main character tile energy. πvmaβ the GPU VMA detailing address range, aka the vibe check on exactly which addresses we're about to zap.
π DESCRIPTION π
so here's the situation. Eviction and Userptr invalidation need to be able to zap the gpu ptes of a given address range in pagefaulting mode. that's the whole assignment, no cap.
and for that to actually work, the function needs access to the shared page-table entries so it can either clear the leaf PTEs or clear the pointers to lower-level page-tables. both options on the table. iconic flexibility. β¨
β οΈ okay but fr fr, the caller is required to hold the necessary locks. not optional, not "I'll do it later", not "it's probably fine". the caller must hold the locks so that neither the page-table connectivity nor the page-table entries of the range get updated from under us. if you skip the locks, you're not being brave, you're just causing a race condition. bestie. please. π
π RETURN π
returns whether ptes were actually updated and a TLB invalidation is required. so likeβ¦ a true here isn't just a mood, it means go invalidate the TLB. don't leave it on read. π
π SEE ALSO π
the whole friend group, honestly. the kernel file ./drivers/gpu/drm/xe/xe_pt.c, plus:
xe_pt_create(9)xe_pt_populate_empty(9)xe_pt_shift(9)xe_pt_destroy(9)xe_pt_clear(9)Pagetable building(9)struct xe_pt_stage_bind_walk(9)xe_pt_stage_bind(9)xe_pt_nonshared_offsets(9)xe_pt_zap_ptes_range(9)xe_pt_stage_unbind(9)xe_pt_update_ops_prepare(9)xe_pt_update_ops_run(9)xe_pt_update_ops_fini(9)xe_pt_update_ops_abort(9)
and that's the page!! mwah π this lil masterpiece comes from ./drivers/gpu/drm/xe, dated October 2026 β she's giving established, she's giving documented, she's giving slay. go zap some ptes responsibly, bestie. βπ§π
π¦ 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