xe_pt_zap_ptes(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:


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