Re: [PATCH v2 02/22] PCI: Add API to track PCI devices preserved across Live Update

Yanjun.Zhu
2026-02-04T00:10:16Z

On 2/2/26 10:14 AM, David Matlack wrote:
> On Sat, Jan 31, 2026 at 10:38 PM Zhu Yanjun <yanjun.zhu@linux.dev> wrote:
>> 在 2026/1/29 13:24, David Matlack 写道:
>>> Add an API to enable the PCI subsystem to track all devices that are
>>> preserved across a Live Update, including both incoming devices (passed
>>> from the previous kernel) and outgoing devices (passed to the next
>>> kernel).
>>>
>>> Use PCI segment number and BDF to keep track of devices across Live
>>> Update. This means the kernel must keep both identifiers constant across
>>> a Live Update for any preserved device. VFs are not supported for now,
>>> since that requires preserving SR-IOV state on the device to ensure the
>>> same number of VFs appear after kexec and with the same BDFs.
>>>
>>> Drivers that preserve devices across Live Update can now register their
>>> struct liveupdate_file_handler with the PCI subsystem so that the PCI
>>> subsystem can allocate and manage File-Lifecycle-Bound (FLB) global data
>>> to track the list of incoming and outgoing preserved devices.
>>>
>>> pci_liveupdate_register_fh(driver_fh)
>>> pci_liveupdate_unregister_fh(driver_fh)
>> Can the above 2 functions support the virtual devices? For example,
>> bonding, veth, iSWAP and RXE.
>>
>> These virtual devices do not have BDF. As such, I am not sure if your
>> patches take these virtual devices in to account.
> No this patch series only supports PCI devices, since those are the
> only devices so far we've needed to support.
>
> I am not familiar with any of the devices that you mentioned. If they
> are virtual then does that mean it's all just software? In that case I
> would be curious to know what problem is solved by preserving them in
> the kernel, vs. tearing them down and rebuilding them across a Live
> Udpate.

Bonding, veth, rxe, and siw can be used in KVM environments.

Although these are software-only virtual devices with no associated
hardware,

they may maintain state that is observable by userspace.

As a result, Live Update should preserve their state across the update.

Zhu Yanjun