dma_unmap_host_va(9)
π dma_unmap_host_va (9) β Kernel API Manual π
okay bestie, so this is a page from the Kernel API Manual, and it's about a lil function called dma_unmap_host_va β the one that does the DMA unmapping of the host virtual address you hand it. yes, the "put it back" side of the story. literally the cleanup era. no cap. π§Ήβ¨
πΈ NAME πΈ
dma_unmap_host_va β DMA unmapping of the given host virtual address. that's it, that's the whole vibe. π
β¨ SYNOPSIS β¨
void dma_unmap_host_va (struct hl_device *hdev , struct hl_userptr
*userptr );
look at her go β returns void, so nothing comes back. she just does the thing and dips. π«Ά
π ARGUMENTS π
hdevβ the habanalabs device structure. that's your device baddie, the main character of the hardware world. πuserptrβ theuserptrto free. yep, this is the one getting released. say bye bestie π¦
π DESCRIPTION π
so what does this function actually do? here's the rundown:
- Unpins the physical pages. π the pages were pinned, and now they are not, because we're being responsible and giving them back.
- Frees the
userptrstructure. π that struct is free now. literally free. it's giving liberation.
that's it! two steps, both iconic, both necessary. don't skip them. π
π SEE ALSO π
kernel file: ./drivers/accel/habanalabs/common/memory.c
and the whole friend group, in this exact order (yes, all of them, I'm not dropping a single one of my girls):
dma_map_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, that's a whole group chat right there. iykyk. ππ
live from./drivers/accel/habanalabs/common, dated October 2026, and this page isdma_unmap_host_va(9)β sending you off with a group-chat mwah and a reminder that unpinning pages is self-care. mwah πππΈ
π¦ 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