alloc_iova(9)
π alloc_iova β the Kernel API Manual tea ββ¨
okay bestie, welcome to the alloc_iova(9) page, brought to you by the Kernel API Manual, and honestly? it's giving "small function, big responsibilities." let's get into it π«Ά
β¨ NAME β¨
alloc_iova β literally just allocates an iova. that's the whole vibe. no cap. π
πΈ SYNOPSIS πΈ
struct iova * alloc_iova (struct iova_domain *iovad , unsigned long size
, unsigned long limit_pfn , bool size_aligned );
like, copy that exactly, bestie, don't freestyle it π
π¦ ARGUMENTS π¦
iovadβ the iova domain in question. yes, that one. the domain we're doing all this in πsizeβ how many page frames you wanna allocate. the size. the amount. you get it β¨limit_pfnβ the max limit address. the ceiling. the "don't go past this" line π₯size_alignedβ set this if you need asize_alignedaddress range, iykyk
and here's the lore, bestie π β this function allocates an iova in the range iovad->start_pfn to limit_pfn, searching top-down from limit_pfn to iovad->start_pfn. top-down, not bottom-up, don't get it twisted π
and if the size_aligned flag is set, then the allocated address iova->pfn_lo will be naturally aligned on roundup_power_of_two(size). naturally aligned!! we love a tidy address πβ
π SEE ALSO π
- Kernel file
./drivers/iommu/iova.c find_iova(9)__free_iova(9)free_iova(9)alloc_iova_fast(9)free_iova_fast(9)put_iova_domain(9)reserve_iova(9)
go read them, they're all in the group chat too, fr fr π
lowkey reminder: size_aligned only does its alignment thing when you actually set it, so set it if you need it, bestie. the flag isn't decorative π
and that's the page!! sign-off time: this one's from ./drivers/iommu, dated October 2026 β put it in your calendar, screenshot it, whatever ππ mwah, slay, go allocate responsibly π§ββοΈπ
π¦ 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