iommufd_device_bind(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

iommufd_device_bind(9) πŸ’–

okay so welcome to the Kernel API Manual page for iommufd_device_bind(9) β€” the routine that binds a physical device to an iommu fd. bestie, this is your ownership handshake, and it's lowkey important 🫢

✨ NAME ✨

iommufd_device_bind β€” bind a physical device to an iommu fd. that's the whole vibe πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

       struct iommufd_device * iommufd_device_bind (struct iommufd_ctx *ictx ,
       struct device *dev , u32 *id );

πŸ’… ARGUMENTS πŸ’…

  • ictx β€” the iommufd file descriptor. yes, the fd in question.
  • dev β€” pointer to a physical device struct. the actual device bestie.
  • id β€” output ID number to return to userspace for this device. it's giving "here's your ID, userspace" πŸŽ€

🌸 DESCRIPTION 🌸

when the bind succeeds, it establishes ownership over the device and gives you back a struct iommufd_device pointer. if it doesn't succeed? you get an error pointer instead. no in-between 😭

🚨 important: a driver using this API must set driver_managed_dma and must not touch the device until this routine succeeds and establishes ownership. like, do not poke the device before ownership is actually yours, periodt πŸ’€

binding a PCI device places the entire RID under iommufd control. the whole RID. not a slice, not a snack β€” the entire thing πŸ‘‘

and listen: the caller must undo this with iommufd_device_unbind. no leaving it bound and ghosting it, bestie πŸ’…

πŸ”₯ SEE ALSO πŸ”₯

the kernel file is ./drivers/iommu/iommufd/device.c β€” go peek if you're nosy πŸ‘€

xoxo, your kernel bestie πŸ’… β€” source/version: ./drivers/iommu/iommufd Β· date: October 2026 Β· page: iommufd_device_bind(9) ✨

πŸ“¦ where this page comes from