hl_mmu_hr_ge...loc_next_hop(9)
π hl_mmu_hr_get_alloc_next_hop(9) β like, the actual kernel API manual, bestie β¨
okay so you're in the Kernel API Manual and this page is about one very specific little function, and honestly? it's giving "small but crucial." let's get into it π
πΈ NAME πΈ
hl_mmu_hr_get_alloc_next_hop β get the next HOP, and allocate it if it does not exist. yes bestie, it does both. multitasking icon behavior fr fr π
β¨ SYNOPSIS β¨
struct pgt_info * hl_mmu_hr_get_alloc_next_hop (struct hl_ctx *ctx ,
struct hl_mmu_hr_priv *hr_priv , struct hl_hr_mmu_funcs *hr_func ,
struct hl_mmu_properties *mmu_prop , u64 curr_pte , bool *is_new_hop );
like, copy it exactly, don't @ me π
π¦ ARGUMENTS π¦
ctxβ pointer to the context structure. the main character of the whole situation, lowkey.hr_privβ host resident private info structure. its private info, we don't pry πhr_funcβ host resident functions. the toolbox π§°mmu_propβ MMU properties. the vibes/settings, basically.curr_pteβ current PTE value. it's au64, so likeβ¦ a big number. respect it.is_new_hopβ set totrueif the HOP is new. and no cap: it is the caller's responsibility to set it tofalse. don't forget, or it's gonna be a whole thing π
π DESCRIPTION π
so basically: on success it returns the pgt_info structure associated with the allocated HOP. and if it doesn't succeed? it returns NULL. that's it. that's the whole deal. short and iconic, periodt π
π SEE ALSO π
Kernel file ./drivers/accel/habanalabs/common/mmu/mmu.c β that's where the magic lives, iykyk ποΈ
and then the whole friend group, in this exact order, mwah π
hl_mmu_get_funcs(9)hl_mmu_init(9)hl_mmu_fini(9)hl_mmu_ctx_init(9)hl_mmu_scramble_addr(9)hl_mmu_descramble_addr(9)hl_mmu_get_hop_pte_phys_addr(9)hl_mmu_hr_pool_destroy(9)hl_mmu_hr_init(9)hl_mmu_hr_fini(9)hl_mmu_hr_free_hop_remove_pgt(9)hl_mmu_hr_pte_phys_to_virt(9)hl_mmu_hr_write_pte(9)hl_mmu_hr_clear_pte(9)hl_mmu_hr_put_pte(9)hl_mmu_hr_get_pte(9)hl_mmu_hr_get_next_hop_pgt_info(9)hl_mmu_hr_alloc_hop(9)hl_mmu_hr_get_tlb_info(9)
and that's the page, bestie π«Ά this iconic lil doc came from ./drivers/accel/habanalabs/com... and it's stamped October 2026, so go forth and allocate responsibly. mwah, love u, bye πβ¨
π¦ 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