Re: [PATCH v2 14/16] iommufd: Add APIs to preserve/unpreserve a vfio cdev

From: Pranjal Shrivastava

Date: Tue May 19 2026 - 20:47:24 EST


On Mon, Apr 27, 2026 at 05:56:31PM +0000, Samiullah Khawaja wrote:
> Add APIs that can be used to preserve and unpreserve a vfio cdev. Use
> the APIs exported by the IOMMU core to preserve/unpreserve device.
>
> The LUO token of the preserved iommufd is fetched and returned back to
> the caller as that can be used during restore to get the restored
> iommufd. Handle to the preserved state of the device is also returned to
> reassociate with the restored state after live update kexec.
>
> Signed-off-by: Samiullah Khawaja <skhawaja@xxxxxxxxxx>
> ---
> drivers/iommu/iommufd/device.c | 102 ++++++++++++++++++++++++
> drivers/iommu/iommufd/iommufd_private.h | 3 +
> include/linux/iommufd.h | 29 +++++++
> 3 files changed, 134 insertions(+)
>

The iommufd_device_replace() is ONLY reachable by VFIO which is blocked
by PATCH 15. LGTM.

Reviewed-by: Pranjal Shrivastava <praan@xxxxxxxxxx>

Thanks,
Praan