xe_migrate_access_memory(9)
π 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 π
0if 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
- 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