iommufd_device_replace(9)
π 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 anIOMMUFD_OBJ_IOAS, orIOMMUFD_OBJ_HWPT_PAGING. and then it outputs theIOMMUFD_OBJ_HWPT_PAGINGID. 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:
iommufd_device_bind(9)iommufd_ctx_has_group(9)iommufd_device_unbind(9)iommufd_device_attach(9)iommufd_device_detach(9)iommufd_access_create(9)iommufd_access_destroy(9)iommufd_access_notify_unmap(9)iommufd_access_unpin_pages(9)iommufd_access_pin_pages(9)iommufd_access_rw(9)
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
- 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