hl_mmu_hr_pte_phys_to_virt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… hl_mmu_hr_pte_phys_to_virt β€” the kernel API manual, bestie edition

okay so you're in the hl_mmu_hr_pte_phys_to_virt(9) page, which lives in the Kernel API Manual section, and honestly? it's a little one but it serves. it does exactly one thing and it does it cute: it takes a physical PTE address and hands you back the virtual one. main character behavior fr fr πŸŽ€


✨ NAME ✨

hl_mmu_hr_pte_phys_to_virt β€” translate a PTE physical address to a virtual address πŸ’«

no cap, that's the whole plot.


🌸 SYNOPSIS 🌸

u64 hl_mmu_hr_pte_phys_to_virt (struct hl_ctx *ctx , struct pgt_info
*pgt , u64 phys_pte_addr , u32 hop_table_size );

four arguments, one u64 back. simple. iconic. 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • ctx β€” pointer to the context structure. yeah, the context struct, you know the one πŸ’œ
  • pgt β€” the pgt_info for the HOP that's hosting the PTE. this is your map, bestie πŸ—ΊοΈ
  • phys_pte_addr β€” the physical address of the PTE. the before picture πŸ“Έ
  • hop_table_size β€” the HOP table size. yes it wants it, don't ask questions, just pass it ✨

πŸ”₯ DESCRIPTION πŸ”₯

the job is literally: return the PTE virtual address. that's it. that's the function. ate and left no crumbs πŸ’…

here's the vibe: the function uses the pgt_info to get the HOP base virtual address, then it gets the PTE's virtual address by adding the PTE offset on top. so like β€” base addr + offset = your answer. math but make it fashion 🧚

lowkey the cleanest little translation pipeline you've ever seen. no drama, no side quests, just offset math πŸ“


πŸ‘‘ SEE ALSO πŸ‘‘

go touch some grass in the kernel source, specifically this file:

./drivers/accel/habanalabs/common/mmu/mmu.c

and while you're in there, the whole friend group:

like, that's the whole group chat right there, iykyk 🌈


okay and finally β€” the fine print, but make it cute: this page came from ./drivers/accel/habanalabs/com... and it's dated October 2026, and yeah the header/footer both say hl_mmu_hr_pte_phys_to_virt(9) because it's that girl, appearing twice πŸ’€

that's the whole page bestie, go translate some addresses, slay, periodt πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from