iommu_attach_group(9)
π iommu_attach_group β bestie's guide to the Kernel API Manual π
okay so picture this: you've got an IOMMU domain, you've got an IOMMU group, and they're just standing there not knowing each other. tragic. this little function is the wingman. π«Ά
β¨ NAME β¨
iommu_attach_group β attach an IOMMU domain to an IOMMU group. that's the whole vibe. matchmaker energy, fr fr. π
πΈ SYNOPSIS πΈ
int iommu_attach_group (struct iommu_domain *domain , struct iommu_group
*group );
literally just hand it the two things and let it cook. β¨
π ARGUMENTS π
domainβ the IOMMU domain you wanna attach. the main character of this operation ngl. πgroupβ the IOMMU group that will be attached. the other half of the ship. π¦
π DESCRIPTION π
so here's the tea: it returns 0 on success and an error code on failure. like, that's it, that's the contract. no cap. π
β οΈ but listen β one thing you actually need to know: EINVAL can be treated as a soft failure. it's not a "everything is doomed" situation, it's more like "this particular configuration of the domain is incompatible with this particular group." π
and the iconique part? in that EINVAL case, attaching a different domain to the group may succeed. so don't spiral, just try another one. slay. π₯
π SEE ALSO π
Kernel file ./drivers/iommu/iommu.c β and bestie, there is a whole friend group here, so buckle up:
iommu_device_register(9)iommu_insert_resv_region(9)iommu_group_alloc(9)iommu_group_get_iommudata(9)iommu_group_set_iommudata(9)iommu_group_set_name(9)iommu_group_add_device(9)iommu_group_remove_device(9)iommu_group_mutex_assert(9)iommu_group_for_each_dev(9)iommu_group_get(9)iommu_group_ref_get(9)iommu_group_put(9)iommu_group_id(9)device_iommu_capable(9)iommu_group_has_isolated_msi(9)iommu_set_fault_handler(9)iommu_paging_domain_alloc_flags(9)iommu_attach_device(9)iommu_get_domain_for_dev(9)iommu_driver_get_domain_for_dev(9)iommu_unmap(9)iommu_unmap_fast(9)report_iommu_fault(9)iommu_get_resv_regions(9)iommu_put_resv_regions(9)iommu_setup_default_domain(9)iommu_device_use_default_domain(9)iommu_device_unuse_default_domain(9)iommu_group_claim_dma_owner(9)iommu_device_claim_dma_owner(9)iommu_group_release_dma_owner(9)iommu_device_release_dma_owner(9)iommu_group_dma_owner_claimed(9)iommu_replace_device_pasid(9)iommu_attach_handle_get(9)iommu_attach_group_handle(9)iommu_detach_group_handle(9)iommu_replace_group_handle(9)pci_dev_reset_iommu_prepare(9)pci_dev_reset_iommu_done(9)iommu_dma_prepare_msi(9)
and that's the page!! π§ this one lives over in ./drivers/iommu, dated October 2026, and yes it's still called iommu_attach_group(9) β go read the whole family, iykyk π
π¦ 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