iommu_sva_bind_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

iommu_sva_bind_device β€” bind a process address space to a device πŸ’…

Okay so welcome to a Kernel API Manual classic, bestie: we're binding a process address space to a device, and it's lowkey iconic.

πŸŽ€ SYNOPSIS πŸŽ€

struct iommu_sva * iommu_sva_bind_device (struct device *dev , struct mm_struct *mm );

🌸 ARGUMENTS 🌸

  • dev β€” the device. That's the whole vibe for this argument πŸ’–
  • mm β€” the mm to bind, and the caller must hold a reference to mm_users. Not optional, not negotiable, no cap 🫢

πŸ’– DESCRIPTION πŸ’–

So this function creates a bond between dev and the address space, allowing the device to access the mm using the PASID returned by iommu_sva_get_pasid. It's giving matchmaker energy for devices and address spaces πŸ”₯

If a bond already exists between dev and mm, an additional internal reference is taken. Cute, right? But bestie, the caller must call iommu_sva_unbind_device to release each reference β€” every single one, periodt πŸ’…

On error, it returns an ERR_PTR value. So yeah, keep an eye out for that 😭

πŸ”₯ SEE ALSO πŸ”₯


okay bye bestie πŸ’– β€” cute sign-off from your ./drivers/iommu source/version, dated October 2026, page iommu_sva_bind_device(9) βœ¨πŸŽ€

πŸ“¦ where this page comes from