From: Mike Rapoport <rppt@kernel.org>
To: David Matlack <dmatlack@google.com>
Cc: sashiko-reviews@lists.linux.dev, linux-pci@vger.kernel.org,
Pasha Tatashin <tatashin@google.com>,
Pratyush Yadav <prty@google.com>,
Alexander Graf <graf@amazon.com>
Subject: Re: [PATCH v6 01/12] PCI: liveupdate: Set up FLB handler for the PCI core
Date: Sat, 23 May 2026 14:17:02 +0300 [thread overview]
Message-ID: <ahGMrrU0wCUdWgsN@kernel.org> (raw)
In-Reply-To: <CALzav=cZsFx5dpbELx1cMHUa1+4+uv7cYEWAWAtZkXeB2d9mMw@mail.gmail.com>
On Fri, May 22, 2026 at 02:37:28PM -0700, David Matlack wrote:
> On Fri, May 22, 2026 at 1:44 PM <sashiko-bot@kernel.org> wrote:
> >
> > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> > - [Medium] Missing `kho_is_enabled()` check before calling KHO preservation APIs in PCI Live Update FLB operations.
> > --
> >
> > commit b0cb2fb154fba1aa85d63570fe0186e243353fb7
> > Author: David Matlack <dmatlack@google.com>
> >
> > PCI: liveupdate: Set up FLB handler for the PCI core
> >
> > This commit sets up a File-Lifecycle-Bound (FLB) handler for the PCI core
> > to participate in the preservation of PCI devices across Live Update. It
> > allocates and preserves a pci_ser structure using KHO when the first PCI
> > device file is preserved.
> >
> > > diff --git a/drivers/pci/liveupdate.c b/drivers/pci/liveupdate.c
> > > new file mode 100644
> > > --- /dev/null
> > > +++ b/drivers/pci/liveupdate.c
> >
> > [ ... ]
> >
> > > +static int pci_flb_preserve(struct liveupdate_flb_op_args *args)
> > > +{
> > > + struct pci_dev *dev = NULL;
> > > + u32 max_nr_devices = 0;
> > > + struct pci_ser *ser;
> > > + unsigned long size;
> > > +
> > > + /*
> > > + * Allocate enough space to preserve all devices that are currently
> > > + * present on the system. Extra padding can be added to this in the
> > > + * future to increase the chances that there is enough room to preserve
> > > + * devices that are not yet present on the system (e.g. VFs, hot-plugged
> > > + * devices).
> > > + */
> > > + for_each_pci_dev(dev)
> > > + max_nr_devices++;
> > > +
> > > + size = struct_size_t(struct pci_ser, devices, max_nr_devices);
> > > +
> > > + ser = kho_alloc_preserve(size);
> >
> > [Severity: Medium]
> > Should this code verify kho_is_enabled() before calling kho_alloc_preserve()?
> >
> > The commit message states:
> > "Note: There is no reason to check for kho_is_enabled() since it can be
> > assumed to return true. If KHO was not enabled then Live Update would
> > not be enabled and these routines would never run."
> >
> > Does this assumption conflict with the Kexec Handover subsystem guidelines?
> >
> > The guidelines mandate that all callers of serialization APIs must explicitly
> > gate their usage with kho_is_enabled().
> >
> > Calling preservation APIs like kho_alloc_preserve() without the check can
> > silently add tracking state that will never be used if the subsystem is
> > unexpectedly inactive.
>
> Sashiko keeps leaving this comment. It seems like a false positive to
> me. KHO maintainers, perhaps the KHO documentation needs adjustment?
TBH, I don't remember such guidelines, but patches are welcome ;-)
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2026-05-23 11:17 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 20:23 [PATCH v6 00/12] PCI: liveupdate: PCI core support for Live Update David Matlack
2026-05-22 20:23 ` [PATCH v6 01/12] PCI: liveupdate: Set up FLB handler for the PCI core David Matlack
2026-05-22 20:43 ` sashiko-bot
2026-05-22 21:37 ` David Matlack
2026-05-23 11:17 ` Mike Rapoport [this message]
2026-05-25 16:50 ` Pratyush Yadav
2026-06-05 5:41 ` Pranjal Shrivastava
2026-05-22 20:24 ` [PATCH v6 02/12] PCI: liveupdate: Track outgoing preserved PCI devices David Matlack
2026-05-22 20:54 ` sashiko-bot
2026-05-22 21:28 ` David Matlack
2026-06-05 6:26 ` Pranjal Shrivastava
2026-06-05 6:11 ` Pranjal Shrivastava
2026-05-22 20:24 ` [PATCH v6 03/12] PCI: liveupdate: Track incoming " David Matlack
2026-05-22 21:13 ` sashiko-bot
2026-05-22 21:34 ` David Matlack
2026-06-06 10:08 ` Pranjal Shrivastava
2026-05-22 20:24 ` [PATCH v6 04/12] PCI: liveupdate: Document driver binding responsibilities David Matlack
2026-05-25 15:35 ` Pratyush Yadav
2026-06-06 10:20 ` Pranjal Shrivastava
2026-05-22 20:24 ` [PATCH v6 05/12] PCI: liveupdate: Keep bus numbers constant during Live Update David Matlack
2026-05-22 21:08 ` sashiko-bot
2026-05-22 21:31 ` David Matlack
2026-06-06 11:10 ` Pranjal Shrivastava
2026-05-22 20:24 ` [PATCH v6 06/12] PCI: liveupdate: Auto-preserve upstream bridges across " David Matlack
2026-05-22 20:24 ` [PATCH v6 07/12] PCI: Refactor matching logic for pci_dev_acs_ops David Matlack
2026-05-22 20:24 ` [PATCH v6 08/12] PCI: liveupdate: Inherit ACS flags in incoming preserved devices David Matlack
2026-05-22 20:24 ` [PATCH v6 09/12] PCI: liveupdate: Inherit ARI Forwarding Enable on preserved bridges David Matlack
2026-05-22 21:51 ` sashiko-bot
2026-05-22 20:24 ` [PATCH v6 10/12] PCI: liveupdate: Freeze preservation status during shutdown David Matlack
2026-05-22 20:24 ` [PATCH v6 11/12] PCI: liveupdate: Do not disable bus mastering on preserved devices during kexec David Matlack
2026-05-22 20:24 ` [PATCH v6 12/12] Documentation: PCI: Add documentation for Live Update David Matlack
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ahGMrrU0wCUdWgsN@kernel.org \
--to=rppt@kernel.org \
--cc=dmatlack@google.com \
--cc=graf@amazon.com \
--cc=linux-pci@vger.kernel.org \
--cc=prty@google.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tatashin@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.