Re: [PATCH v4 14/19] liveupdate: Add feature header to struct luo_flb_ser

From: tarunsahu

Date: Thu Dec 03 2026 - 13:27:02 EST


Chris Down <chris@xxxxxxxxxxxxxx> writes:

> Hi Tarun,
>
> Tarun Sahu writes:
>>+ for (u64 i = 0; i < fh->header_ser->count;
>>+ i++, fhdr = (void *)fhdr + fhdr->size) {
>>+ struct luo_flb_ser *ser;
>>+
>>+ err = kho_ser_validate(fhdr, luo_flb_ser);
>>+ if (err)
>>+ return err;
>
> I think there's a problem with returning this error as it is. For an
> unknown required feature kho_ser_validate() returns -EOPNOTSUPP, but
> callers of liveupdate_flb_get_incoming() already take -EOPNOTSUPP to mean
> that live update is disabled. pci_liveupdate_flb_get_incoming() returns
> NULL for it, so instead of panicking, PCI carries on as if nothing was
> preserved, even though those devices may still be doing DMA.

That's good point. After looking at the error tabe, Does -EPROTO sounds
good when kho_ser_validate fails?

>
> From a quick test with an outgoing kernel hacked to set an unknown
> required bit on its luo_flb_ser entries, that is what happens after the
> kexec, in that the PCI FLB is never retrieved and boot carries on.
>
> Could you validate the entries once in luo_flb_setup_incoming() instead?
> They are all written with the same header by luo_flb_serialize(), so
> there's no need to check them on every lookup. Going by the code, a
> failure there would panic through luo_restore_fail(), like a bad
> luo_flb_header_ser already does. If the per-entry headers end up going
> away as David suggested, then this check goes away with them, of course.
>
As per the recent decision, collection entries will not have their own
header instead they will rely on their parents header. And this
validation per entry will be dropped.

Thanks
Tarun

> Thanks!
>
> Chris