xe_migrate_access_memory(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xe_migrate_access_memory β€” bestie, we're touching a BO's memory through the GPU ✨

Okay so this whole page is from the kernel API manual, and the function we're obsessing over is xe_migrate_access_memory. It's giving "let the GPU do the memory poking for you" and honestly? Iconic.


πŸŽ€ NAME πŸŽ€

xe_migrate_access_memory β€” Access memory of a BO via GPU 🫢


✨ SYNOPSIS ✨

int xe_migrate_access_memory (struct xe_migrate *m , struct xe_bo *bo ,
       unsigned long offset , void *buf , int len , int write );

Like, that's the whole summoning circle. Six things go in, an int comes out. Slay.


🌸 ARGUMENTS 🌸

Okay so here's who's invited to the function party πŸ’–

  • m β€” The migration context. That's the vibe-setter, the main character of the migration world.
  • bo β€” buffer object. The actual thing we're reaching into, no cap.
  • offset β€” access offset into buffer object. Like, where inside the BO we start, bestie.
  • buf β€” pointer to caller memory to read into or write from. Your memory, your rules.
  • len β€” length of access. How many bytes we're doing this to. Keep it real.
  • write β€” write access. This one's the switch: are we reading or writing? πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

So the whole point: access memory of a BO via GPU, either reading in or writing from a passed in pointer πŸ’…

The way that this works is genuinely so cool β€” the pointer gets dma mapped for GPU access, and then GPU commands are issued to read to or write from that pointer. That's it. That's the whole thing. The GPU is doing the heavy lifting and your pointer is just... there, being dma mapped, living its best life ✨

No CPU copy era, we love to see it.


πŸ’€ RETURN πŸ’€

  • 0 if successful 😌
  • negative error code on failure 😭

That's the whole return contract, fr fr. Zero means we ate. Negative means something went sideways.


πŸ”₯ SEE ALSO πŸ”₯

Okay bestie, this is the long part, so buckle up β€” here's the whole friend group πŸ‘‘

Kernel file ./drivers/gpu/drm/xe/xe_migrate.c, struct xe_migrate(9), xe_migrate_alloc(9), xe_migrate_init(9), xe_migrate_copy(9), xe_migrate_resolve(9), xe_migrate_lrc(9), xe_migrate_ccs_rw_copy(9), xe_migrate_ccs_rw_copy_clear(9), xe_migrate_exec_queue(9), xe_migrate_vram_copy_chunk(9), xe_migrate_clear(9), xe_migrate_update_pgtables(9), xe_migrate_wait(9), xe_migrate_to_vram(9), xe_migrate_from_vram(9), xe_migrate_job_lock(9), xe_migrate_job_unlock(9), xe_migrate_job_lock_assert(9)

Like, that's an entire group chat right there. Go say hi to all of them 🫢


And that's the page, bestie! This little gem lives under ./drivers/gpu/drm/xe and it's dated October 2026 β€” so go forth, dma map responsibly, and remember: the GPU was always the main character πŸ’œπŸ†
πŸ“¦ where this page comes from