iommufd_device_attach(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, welcome to iommufd_device_attach(9) from the Kernel API Manual β€” this is the function that connects a device/pasid to an iommu_domain, and it's giving main-character kernel energy πŸ’…βœ¨

πŸŽ€ NAME πŸŽ€

iommufd_device_attach β€” Connect a device/pasid to an iommu_domain. No cap, that's the whole vibe 🫢

🌸 SYNOPSIS 🌸

int iommufd_device_attach (struct iommufd_device *idev , ioasid_t pasid , u32 *pt_id );

πŸ’– ARGUMENTS πŸ’–

  • idev β€” the device to attach, bestie. This is the device side of the glow-up πŸ’«
  • pasid β€” the pasid to attach. Yes, literally that pasid πŸŽ€
  • pt_id β€” input an IOMMUFD_OBJ_IOAS, or IOMMUFD_OBJ_HWPT_PAGING; output the IOMMUFD_OBJ_HWPT_PAGING ID. This pointer is doing double duty, iykyk πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

This connects the device/pasid to an iommu_domain, either automatically or manually selected. Once this completes, the device could do DMA with pasid. pasid is IOMMU_NO_PASID if this attach is for no pasid usage.

The caller should return the resulting pt_id back to userspace. This function is undone by calling iommufd_device_detach. So yeah, remember the undo button, bestie 😭🫢

🌈 SEE ALSO 🌈

Kernel file ./drivers/iommu/iommufd/device.c β€” and the whole squad is right here:


mwah πŸ’‹ this lil page is from source/version ./drivers/iommu/iommufd, dated October 2026, and it's all about iommufd_device_attach(9), periodt πŸ’œ

πŸ“¦ where this page comes from