Re: [PATCH v4 05/19] kho: Add feature header for fine-grained ABI compatibility

From: David Matlack

Date: Tue Nov 24 2026 - 14:02:21 EST


On Tue Nov 24, 2026 at 7:25 AM PST, Pratyush Yadav wrote:
> I don't think it buys us any functionality. It just hides the problem in
> some lucky cases.

Following up on our offline discussion: I think it's worth keeping
support for optional features, both before and after the spec changes
land.

Before the spec lands, optional features are the only way to enable new
features at all. For example, the PCI follow-up series [1] preserves
BARs and bridge windows using an optional flag. It's purely additive: a
kernel that doesn't understand it keeps behaving the way it does today.
With optional features it can be enabled as soon as it lands, and Live
Update keeps working in both directions, including rollback. If every
feature is required, there is no way to enable it until the outgoing
kernel can learn what its target supports.

After the spec lands, optional features are still useful, and at worst
harmless:

- Kernels that predate the spec mechanism can't provide a spec. As long
as one of them is a possible target (e.g. for rollback), optional
features are still the only features the outgoing kernel can use.

- The outgoing kernel doesn't need to consult the spec for optional
features at all (less complexity), since by definition the target can
ignore them. It can always produce the same payload, and only
required features need to be gated on what the target supports.

- Nothing prevents an outgoing kernel that has a spec from choosing not
to set optional bits its target doesn't understand, if we ever want
that.

The cost of keeping them is negligible in the current design: the same
number of bits in the header, and one range check on the incoming side.

The one rule we need is that optional really means safe to ignore, e.g.
optional data must not reference preserved memory or carry restrictions
that the next kernel has to act on. Anything like that must be a
required feature.

[1] https://lore.kernel.org/linux-pci/20261019213054.3157159-5-dmatlack@xxxxxxxxxx/