iommufd_access_pin_pages(9)
β¨ iommufd_access_pin_pages β¨
okay so bestie, welcome to the iommufd_access_pin_pages page from the Kernel API Manual π this one's a lil kernel-level baddie that hands you back a whole list of pages sitting under an iova. no cap, it's giving "let me get those pages for you" energy π
πΈ SYNOPSIS πΈ
int iommufd_access_pin_pages (struct iommufd_access *access , unsigned
long iova , unsigned long length , struct page **out_pages , unsigned
int flags );
literally the whole vibe in one line, iykyk π
π¦ ARGUMENTS π¦
accessβ the IOAS access you're acting on, like, the main character here πiovaβ the starting IOVA, that's where we begin bestie βlengthβ how many bytes you wanna access, tell me how much and I'll go get it π«Άout_pagesβ the output page list, this is where the goodies land πflagsβ theIOPMMUFD_ACCESS_RW_*flags, yeah that's exactly how it's spelled in the source, not me being quirky π
π DESCRIPTION π
So what it does: it reads length bytes starting at iova and returns the struct page * pointers. then you (the caller) can kmap them for CPU access. slay π₯
bestie listen β the caller must perform iommufd_access_unpin_pages when done to balance this. it's literally the rule, don't leave it hanging π
This API always requires a page aligned iova. no exceptions, periodt. this happens naturally if the ioas alignment is >= PAGE_SIZE and the iova is PAGE_SIZE aligned β iconic, love that for you β¨
but lowkey, smaller alignments have corner cases where this API can fail on an otherwise aligned iova. so like, heads up π
π SEE ALSO π
Kernel file ./drivers/iommu/iommufd/device.c and honestly the whole friend group:
iommufd_device_bind(9)iommufd_ctx_has_group(9)iommufd_device_unbind(9)iommufd_device_attach(9)iommufd_device_replace(9)iommufd_device_detach(9)iommufd_access_create(9)iommufd_access_destroy(9)iommufd_access_notify_unmap(9)iommufd_access_unpin_pages(9)iommufd_access_rw(9)
and that's the whole page bestie β brought to you by ./drivers/iommu/iommufd, dated October 2026, page iommufd_access_pin_pages(9), Kernel API Manual edition πΈππ go pin some pages, you got this π§π
π¦ 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