iommufd_device_replace(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… iommufd_device_replace(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” this one's from the iommufd girlies and it's lowkey iconic. no cap.


✨ NAME ✨

iommufd_device_replace β€” change the device/pasid's iommu_domain, that's it, that's the vibe πŸ¦‹


🌸 SYNOPSIS 🌸

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

πŸŽ€ ARGUMENTS πŸŽ€

  • idev β€” the device you wanna change, bestie. main character of this call fr.
  • pasid β€” the pasid you're changing. yes, that one. 🫢
  • pt_id β€” okay this one's a two-way street, pay attention: input an IOMMUFD_OBJ_IOAS, or IOMMUFD_OBJ_HWPT_PAGING. and then it outputs the IOMMUFD_OBJ_HWPT_PAGING ID. in and out, she contains multitudes πŸ’…

🌈 DESCRIPTION 🌈

so this is literally the same as doing this:

iommufd_device_detach;
iommufd_device_attach;

but, like, smarter. and if it fails? no change is made to the attachment. zero. nothing. the attachment stays exactly as it was, no crumbs left behind πŸ™ˆ

the iommu driver may implement it this way so there's no disruption in translation β€” the way that translations just keep flowing uninterrupted is honestly so slay ✨

⚠️ important caveat bestie: this can only be called if iommufd_device_attach has already succeeded. like, that's a prerequisite, not a suggestion, fr fr.

and pasid is IOMMU_NO_PASID for no pasid usage. iykyk πŸ’€


πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./drivers/iommu/iommufd/device.c β€” and the whole friend group:


okay that's the whole page, you ate that πŸ“ this masterpiece lives in ./drivers/iommu/iommufd and it's dated October 2026 β€” mark your calendars babes, mwah πŸ’–πŸ‘‘

πŸ“¦ where this page comes from