Re: [PATCH v7 01/12] PCI: liveupdate: Set up FLB handler for the PCI core

From: David Matlack

Date: Mon Jul 27 2026 - 13:46:19 EST


On Thu, Jul 23, 2026 at 3:21 PM Bjorn Helgaas <helgaas@xxxxxxxxxx> wrote:
>
> On Fri, Jul 10, 2026 at 09:26:04PM +0000, David Matlack wrote:
> > Set up a File-Lifecycle-Bound (FLB) handler for the PCI core to enable
> > it to participate in the preservation of PCI devices across Live Update.
> > Essentially, this commit enables the PCI core to allocate a struct
> > (struct pci_ser) and preserve it across a Live Update whenever at least
> > one device is preserved.
> > ...
>
> > +#define pr_fmt(fmt) "PCI: " KBUILD_BASENAME ": " fmt
>
> Is KBUILD_BASENAME buying us something important here? Just from
> code-reading perspective, it's more work because without some digging
> I don't know what it will end up looking like in a dmesg log.
>
> > +static void pci_flb_unpreserve(struct liveupdate_flb_op_args *args)
> > +{
> > + struct pci_flb_outgoing *outgoing = args->obj;
> > +
> > + WARN_ON(outgoing->ser->nr_devices);
> > + kho_block_set_destroy(&outgoing->block_set);
> > + kho_unpreserve_free(outgoing->ser);
> > + kfree(outgoing);
> > + pr_debug("Unpreserved struct pci_ser\n");
>
> If this pr_debug() is useful, maybe it should include an address and
> there should be a corresponding pr_debug() on the preserve side so we
> could find things in a crashdump?
>
> > +int pci_liveupdate_register_flb(struct liveupdate_file_handler *fh)
> > +{
> > + pr_debug("Registering file handler \"%s\"\n", fh->compatible);
>
> Is fh->compatible enough to identify a driver?

Not necessarily. VFIO could theoretically have one file handler that
handles all the vfio-pci variant drivers. But I suspect we'll end up
with 1 fh per driver in practice.

Are you thinking about how we can ensure devices are bound to
compatible drivers after Live Update?

BTW, thank you for feedback on the rest of the series. I am addressing
all your comments in v8.