add_va_block(9)
π add_va_block(9) β from the Kernel API Manual, bestie π
okay so real talk, this one lives in the Kernel API Manual and it's genuinely such a small icon β a tiny wrapper function that does exactly one (1) thing and does it cutely. no notes. let's get into it β¨
πΈ NAME πΈ
add_va_block β literally just a wrapper for add_va_block_locked. that's it. that's the whole vibe. π«Ά
β¨ SYNOPSIS β¨
int add_va_block (struct hl_device *hdev , struct hl_va_range *va_range
, u64 start , u64 end );
look at that signature. four args, returns an int. she's neat, she's tidy, she's giving "i know my lane" energy π
π ARGUMENTS π
hdevβ pointer to the habanalabs device structure. the main character device object, fr fr.va_rangeβ pointer to the virtual addresses range object. this is the range we're working inside, iykyk.startβ start virtual address. the beginning. the alpha. π¦endβ end virtual address. the finish line. the omega. β¨
π₯ DESCRIPTION π₯
so here's the whole plot, and honestly it's a short episode but it ate:
- takes the list lock and then calls
add_va_block_locked. yes queen, lock first, then delegate. that's the entire function. no cap. π
ngl it's a wrapper β the locked version does the real work, and this one's whole job is grabbing the list lock first. keep that in mind before you go calling things willy-nilly π
π SEE ALSO π
the kernel file this lives in is ./drivers/accel/habanalabs/common/memory.c β go read it, it's giving lore π
and the whole friend group π:
dma_map_host_va(9)dma_unmap_host_va(9)dram_pg_pool_do_release(9)free_phys_pg_pack(9)free_device_memory(9)clear_va_list_locked(9)print_va_list_locked(9)merge_va_blocks_locked(9)add_va_block_locked(9)is_hint_crossing_range(9)get_va_block(9)hl_get_va_range_type(9)hl_unreserve_va_block(9)init_phys_pg_pack_from_userptr(9)map_phys_pg_pack(9)unmap_phys_pg_pack(9)map_device_va(9)unmap_device_va(9)hl_hw_block_mmap(9)export_dmabuf_from_addr(9)allocate_timestamps_buffers(9)hl_pin_host_memory(9)hl_userptr_delete_list(9)hl_userptr_is_pinned(9)va_range_init(9)va_range_fini(9)vm_ctx_init_with_ranges(9)hl_vm_ctx_fini(9)hl_vm_init(9)hl_vm_fini(9)hl_hw_block_mem_init(9)hl_hw_block_mem_fini(9)
like, that's the whole group chat in the SEE ALSO section and we love that for them π§π
okay bye bestie!! this page is brought to you by source/version ./drivers/accel/habanalabs/common, dated October 2026 β mwah, stan a well-documented kernel function, add_va_block(9) out π
ππΈ
π¦ 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