[PATCH v5 07/16] kexec: add Kexec HandOver (KHO) generation helpers
Jason Gunthorpe
jgg at nvidia.com
Fri Mar 21 06:34:47 PDT 2025
On Wed, Mar 19, 2025 at 06:55:42PM -0700, Changyuan Lyu wrote:
> From: Alexander Graf <graf at amazon.com>
>
> Add the core infrastructure to generate Kexec HandOver metadata. Kexec
> HandOver is a mechanism that allows Linux to preserve state - arbitrary
> properties as well as memory locations - across kexec.
>
> It does so using 2 concepts:
>
> 1) State Tree - Every KHO kexec carries a state tree that describes the
> state of the system. The state tree is represented as hash-tables.
> Device drivers can add/remove their data into/from the state tree at
> system runtime. On kexec, the tree is converted to FDT (flattened
> device tree).
Why are we changing this? I much prefered the idea of having recursive
FDTs than this notion copying eveything into tables then out into FDT?
Now that we have the preserved pages mechanism there is a pretty
direct path to doing recursive FDT.
I feel like this patch is premature, it should come later in the
project along with a stronger justification for this approach.
IHMO keep things simple for this series, just the very basics.
> +int register_kho_notifier(struct notifier_block *nb)
> +{
> + return blocking_notifier_chain_register(&kho_out.chain_head, nb);
> +}
> +EXPORT_SYMBOL_GPL(register_kho_notifier);
And another different set of notifiers? :(
> +static int kho_finalize(void)
> +{
> + int err = 0;
> + void *fdt;
> +
> + fdt = kvmalloc(kho_out.fdt_max, GFP_KERNEL);
> + if (!fdt)
> + return -ENOMEM;
We go to all the trouble of keeping track of stuff in dynamic hashes
but still can't automatically size the fdt and keep the dumb uapi to
have the user say? :( :(
Jason
More information about the linux-arm-kernel
mailing list