xe_migrate_c...w_copy_clear(9)
π xe_migrate_ccs_rw_copy_clear β a Kernel API Manual moment (section 9, bestie)
okay so real talk, this page lives in the Kernel API Manual, section 9, and it's here to explain xe_migrate_ccs_rw_copy_clear β a function whose whole personality is clearing out the CCS read/write batch buffer content. no cap, that's the whole vibe. π
β¨ NAME β¨
xe_migrate_ccs_rw_copy_clear β literally clears the CCS read/write batch buffer content. that's it, that's the job. π§Ήπ
β¨ SYNOPSIS β¨
void xe_migrate_ccs_rw_copy_clear (struct xe_bo *src_bo , enum
xe_sriov_vf_ccs_rw_ctxs read_write , bool bound );
three args, one void, zero crumbs. slay. π₯
β¨ ARGUMENTS β¨
src_boβ the buffer object that src is currently bound to. like, that's its whole thing rn. π«Άread_writeβ of typeenum xe_sriov_vf_ccs_rw_ctxs, and it's the one that decides whether we're making BB commands for a CCS read or a CCS write. iykyk. πboundβ aboolthat says whether the device is bound. yes or no, iconic either way. β
β¨ DESCRIPTION β¨
okay so bestie, here's the tea. if you just clear the BB directly, you get no atomicity, and that's a problem β because if the vCPU gets halted mid-operation while the clearing is happening, you can land in undefined behavior. ππ like, genuinely undefined. not cute.
so instead, we use a shadow buffer object approach. the glow-up plan is:
- swap the SA BO address with the shadow BO first π
- perform the clearing operation on the BB π§½
- update the shadow BO in the ring buffer π«
- sync the shadow and the actual buffer so they stay consistent, because consistency is main character energy β¨
that's the whole choreography. no skipped steps, no shortcuts, periodt. π
β¨ RETURN β¨
None. β nothing comes back. it simply does the thing and leaves. π¦
β¨ SEE ALSO β¨
go read these next, bestie, they're all in the 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_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_access_memory(9)xe_migrate_job_lock(9)xe_migrate_job_unlock(9)xe_migrate_job_lock_assert(9)
like a whole friend group of migrate functions. obsessed. ππ
ngl, the shadow BO dance exists specifically so you don't get that halted-mid-operation undefined behavior. treat it with respect, it's doing a lot of work for you. π
and that's the page, diva π
β¨ β brought to you by ./drivers/gpu/drm/xe, dated October 2026, from the xe_migrate_c...w_copy_clear(9) manual. mwah, go clear some batch buffers responsibly. πππ§
π¦ 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