iommufd_hwpt_paging_alloc(9)
π iommufd_hwpt_paging_alloc(9) β from the Kernel API Manual, bestie
okay so real talk, this one is a function, and it lives in section 9 of the kernel API manual. yes, the fancy one. get comfy π
β¨ NAME β¨
iommufd_hwpt_paging_alloc β bestie, this is how you get a PAGING iommu_domain for a device. like, that's its whole job. iconic of it honestly π
πΈ SYNOPSIS πΈ
struct iommufd_hwpt_paging * iommufd_hwpt_paging_alloc (struct
iommufd_ctx *ictx , struct iommufd_ioas *ioas , struct iommufd_device
*idev , ioasid_t pasid , u32 flags , bool immediate_attach , const
struct iommu_user_data *user_data );
look at all those parameters. she has range π
π¦ ARGUMENTS π¦
ictxβ the iommufd context. the mothership, if you will πΈioasβ the IOAS you're linking this domain up with. it's giving "we're official now" π«Άidevβ the device you're grabbing aniommu_domainfor. main character device energy π₯pasidβ the PASID you're grabbing aniommu_domainfor. yes, per-PASID, no capflagsβ flags coming straight from userspace. whatever they handed you π₯immediate_attachβtrueifidevshould get attached to the hwpt. like, right away. no waiting around β‘user_dataβ the user-provided, driver-specific data describing the domain you're about to create. it's the blueprint, basically π
π§ DESCRIPTION π§
So you want a new iommu_domain? Say less. This function allocates one and hands it back to you as a hw_pagetable. The HWPT gets linked to the ioas you passed in, and by the time you get your grubby little hands back on it, the underlying iommu_domain is fully populated β like, entirely. done. finished. slay π
β οΈ okay this part is important, bestie, don't skip it: the caller must hold theioas->mutexuntil afteriommufd_object_abort_and_destroyoriommufd_object_finalizehas been called on the returned hwpt. that'siommufd_object_abort_and_destroyoriommufd_object_finalizeβ pick whichever one fits, but the mutex stays held through it. no early letting go. hold it. π
π SEE ALSO π
- Kernel file
./drivers/iommu/iommufd/hw_pagetable.cβ go read the source, it's right there π iommufd_hwpt_nested_alloc(9)β the nested sibling π―iommufd_viommu_alloc_hwpt_nested(9)β and the viommu nested one too π¦
kk that's the whole page!! π this came out of ./drivers/iommu/iommufd, dated October 2026, and the page itself is iommufd_hwpt_paging_alloc(9) β remember the mutex thing, and drink some water. 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