dma_map_host_va(9)
π dma_map_host_va(9) β like, the whole kernel API manual vibe π
okay bestie, welcome to the dma_map_host_va page from the Kernel API Manual β yes that's the manual name, we're being official today π
this one is short and sweet and honestly kind of iconic: it's the girl that takes a host virtual address and makes it DMA-mappable. slay.
β¨ NAME β¨
dma_map_host_va β DMA mapping of the given host virtual address. that's it, that's the whole personality π
πΈ SYNOPSIS πΈ
int dma_map_host_va (struct hl_device *hdev , u64 addr , u64 size ,
struct hl_userptr **p_userptr );
no cap, that's the exact signature β don't come for me about the spacing, it's verbatim π
π¦ ARGUMENTS π¦
hdevβ the habanalabs device structure. like, the device we're doing all this for π«Άaddrβ the host virtual address of the memory area. the starting point of the vibe β¨sizeβ the size of the memory area. how much memory we're talking about, bestie πp_userptrβ pointer to result userptr structure. this is where the answer lands when we're done π
π DESCRIPTION π
so here's the tea β this function does the following, in order, no skipping:
- Allocate userptr structure. π§
- Pin the given host memory using the userptr structure. π
- Perform DMA mapping to have the DMA addresses of the pages. π₯
three steps, three vibes, one function. it's giving "small but mighty" and honestly? obsessed. π
π SEE ALSO π
if you liked this one, the whole friend group is right here β literally all of them:
- Kernel file
./drivers/accel/habanalabs/common/memory.cπ 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),add_va_block(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, the entire extended cast. iykyk π
and that's the page, bestie π«Ά this little manual lives in ./drivers/accel/habanalabs/common, stamped October 2026 β that's the source and date, noted with love, not copy-pasted, periodt. ππ·β
π¦ 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