xe_vm_find_c...or_vma_range(9)
π xe_vm_find_cpu_addr_mirror_vma_range(9)
okay so bestie, welcome to the kernel API manual for xe_vm_find_cpu_addr_mirror_vma_range β yes that name is a whole mouthful, no I will not be shortening it, and yes it is iconic. this is a real function in the kernel's 9 section and we're gonna get you fluent in it. π
β¨ NAME β¨
xe_vm_find_cpu_addr_mirror_vma_range β the glow-up function that extends a VMA range to include adjacent CPU-mirrored VMAs. literally its whole job. periodt. π
πΈ SYNOPSIS πΈ
void xe_vm_find_cpu_addr_mirror_vma_range (struct xe_vm *vm , u64 *start
, u64 *end );
like, that's the signature, copy it exactly, don't be weird about it. β¨
π¦ ARGUMENTS π¦
vmβ the VM you're searching inside. this is your main character struct, the whole search happens in here. πstartβ an input/output pointer to the starting address of the range. yeah, in and out β it goes in with a value and can come back changed. πendβ an input/output pointer to the end address of the range. same deal, it's a two-way street bestie. π
π DESCRIPTION π
okay so here's the vibe, and it's actually kind of elegant ngl:
given a range defined by start and range, this function checks the VMAs immediately before and immediately after the range. just the two neighbors, mind you β it's not out here scanning the whole world. π§
if those neighboring VMAs are CPU-address-mirrored and have default memory attributes, then β and this is the slay part β the function updates start and range to include them. so the range grows to swallow its cute little neighbors. π
this extended range can then be used for merging or other operations that require a unified VMA. it's giving "prep work" energy and honestly? we respect it. π«Ά
β οΈ important caveat bestie: the function does not perform the merge itself β it only computes the mergeable boundaries. it's setting the table, not eating the meal. do not come for this function expecting the merge to already be done. π
π₯ SEE ALSO π₯
the source of all this magic lives in the kernel file ./drivers/gpu/drm/xe/xe_vm.c, and here's the full squad of related functions β every single one, no gatekeeping:
xe_vm_drm_exec_lock(9)xe_vm_remove_compute_exec_queue(9)xe_vm_kill(9)xe_vm_validate_rebind(9)xe_vm_bump_lru(9)xe_vm_resume_rebind_worker(9)xe_vm_add_fault_entry_pf(9)xe_vm_range_rebind(9)xe_vm_range_unbind(9)xe_vma_mem_attr_copy(9)xe_vm_lock_vma(9)xe_vm_create_scratch(9)xe_vm_find_vma_by_addr(9)xe_vma_has_default_mem_attrs(9)struct xe_vma_lock_and_validate_flags(9)xe_vm_bind_kernel_bo(9)xe_vm_lock(9)xe_vm_unlock(9)xe_vm_invalidate_vma_submit(9)xe_vm_invalidate_vma(9)xe_vma_need_vram_for_atomic(9)xe_vm_alloc_madvise_vma(9)xe_vm_alloc_cpu_addr_mirror_vma(9)xe_vm_add_exec_queue(9)xe_vm_remove_exec_queue(9)
like, that's the whole friend group. go say hi. iykyk. π«Άβ¨
π SIGN-OFF π
and that's the tea! this page ships out of ./drivers/gpu/drm/xe, dated October 2026, and is filed under xe_vm_find_c...or_vma_range(9) β yes the header truncates it, no that's not a typo on my end, that's just how it's printed. π
go extend those ranges bestie, you've got this. π¦πΈπ
π¦ 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