Re: [PATCH v6 11/27] vfio/pci: Retrieve preserved device files after Live Update
From: David Matlack
Date: Thu Nov 19 2026 - 19:16:28 EST
On Tue Nov 17, 2026 at 11:51 PM PST, Vipin Sharma wrote:
> On Fri, Nov 06, 2026 at 05:19:28PM +0000, David Matlack wrote:
>> On Mon Nov 2, 2026 at 3:36 PM UTC, Vipin Sharma wrote:
>> > * Open and return an anonymous VFIO cdev file via
>> > vfio_device_liveupdate_cdev_open().
>>
>> Here's an idea for how the device file could be created on retrieve,
>> which I'd like to hear your thoughts on.
>>
>> The patches from Pasha at [1] lets userspace pass a
>> file-handler-specific argument to LIVEUPDATE_SESSION_RETRIEVE_FD. In the
>> next version of the tmpfs series, I'm planning to use that to have
>> userspace create the file and pass it in the argument, and the kernel
>> then restores the preserved file into it.
>>
>> I wonder if VFIO should work the same way, e.g.:
>>
>> struct liveupdate_vfio_retrieve_arg {
>> __u32 size;
>> __s32 fd;
>> };
>>
>> Userspace would open /dev/vfio/devices/noiommu-vfioX itself and pass
>> the fd. retrieve() would check that it's an unbound vfio-pci cdev file
>> for the preserved device (domain/BDF, noiommu, incoming, cfg_size),
>> attach the incoming state to that file, and LUO would track that file
>> as the retrieved file. VFIO_DEVICE_BIND_IOMMUFD would then take over the
>> device as it does now. Since VFIO preservation is new, the argument
>> could simply be required.
>>
>> What do you think?
>
> Overall, I agree with the strategy. I think VFIO cdev retrieval should
> happen as the flow you mentioned above. I want to hightlight two things:
>
> 1. This will lead to lot of code changes happening in vfio core. This
> means VFIO PCI live update code change will spill in vfio core.
> Should I create a config VFIO_LIVEUPDATE for VFIO core code. It will
> not be visible menuconfig option but selected when
> VFIO_PCI_LIVEUPDATE is enabled.
> 2. List of other inflight series that this series will depend on is
> increasing. It will be 3 (reset function, pci saved state, and
> restore into fd).
>
> For '2', should I send v7 without changes you are recommending in this
> patch and future version of this series can transition to the approach
> you are suggesting after LUO changes are landed. VFIO liveupdate series
> will go through more iterations, so we will have opportunity to make the
> change. WDYT?
Sounds good. I am not 100% convinced yet we should switch to a
retrieve-into approach. But let's keep discussing it VFIO and IOMMUFD.