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

David Matlack
2026-04-06T16:06:46Z

On Sun, Apr 5, 2026 at 9:56 AM Zhu Yanjun <yanjun.zhu@linux.dev> wrote:
> 在 2026/4/3 14:58, David Matlack 写道:
> > On Thu, Apr 2, 2026 at 2:29 PM Yanjun.Zhu <yanjun.zhu@linux.dev> wrote:
> >> On 3/23/26 4:57 PM, David Matlack wrote:
> >>> +config PCI_LIVEUPDATE
> >>> + bool "PCI Live Update Support (EXPERIMENTAL)"
> >>> + depends on PCI && LIVEUPDATE
> >>> + help
> >>> + Support for preserving PCI devices across a Live Update. This option
> >>> + should only be enabled by developers working on implementing this
> >>> + support. Once enough support as landed in the kernel, this option
> >>> + will no longer be marked EXPERIMENTAL.
> >>> +
> >>> + If unsure, say N.
> >> Currently, it only supports 'n' or 'y'. Is it possible to add 'm'
> >> (modular support)?
> >>
> >> This would allow the feature to be built as a kernel module. For
> >> development
> >>
> >> purposes, modularization means we only need to recompile a single module
> >>
> >> for testing, rather than rebuilding the entire kernel. Compiling a
> >> module should
> >>
> >> be significantly faster than a full kernel build.
> > I don't think it is possible for CONFIG_PCI_LIVEUPDATE to support 'm'.
> > pci_setup_device() (which is under CONFIG_PCI) needs to call
> > pci_liveupdate_setup_device(), and CONFIG_PCI cannot be built as a
> > module. This call is necessary so the PCI core knows whether a device
> > being enumerated was preserved across a previous Live Update.
>
> After the following changes, the liveupdate.ko can be generated
> successfully.

Sure but you've broken the feature. Now devices can be probed before
liveupdate.ko is loaded and the PCI core will have an incorrect view
of which devices were preserved by the previous kernel.