linux/kernel/liveupdate
Pratyush Yadav (Google) 9a6a70aefe kho: do not reserve empty per-node bootmem areas
Some nodes do not allocate any early boot memory. An example is
hotpluggable nodes with movable_node enabled. So the bootmem size for
them ends up being zero.

Zero size allocations normally don't play well with memblock. Memblock
returns an address, but then doesn't actually reserve anything. This
address ends up being recorded in kho_bootmem with a size of 0. In case
of hotpluggable nodes with movable_nodes, the allocation on the node
actually fails because memblock refuses to allocate there, and so KHO
fails to initialize.

Skip bootmem reservation for such nodes entirely.

To keep the code more robust, avoid overloading kho_bootmem_cnt. use
max_nr_bootmem to store the size of kho_bootmem array. This ensures that
the location of kho_bootmem_cnt assignment does not affect the cleanup
paths.

Fixes: 3dc92c3114 ("kexec: add Kexec HandOver (KHO) generation helpers")
Reported-by: Bing Jiao <bingjiao@google.com>
Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Link: https://patch.msgid.link/20261014131547.259138-1-pratyush@kernel.org
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
2026-10-15 11:37:32 +03:00
..
Kconfig memblock: get rid of CONFIG_MEMBLOCK_KHO_SCRATCH 2026-10-09 18:13:27 +02:00
kexec_handover_debugfs.c kho: rename KHO scratch to KHO bootmem 2026-10-09 18:13:27 +02:00
kexec_handover_internal.h kho: rename KHO scratch to KHO bootmem 2026-10-09 18:13:27 +02:00
kexec_handover.c kho: do not reserve empty per-node bootmem areas 2026-10-15 11:37:32 +03:00
kho_block.c kho: add support for linked-block serialization 2026-06-03 21:15:46 +03:00
luo_core.c liveupdate: defer session block allocation and physical address setting 2026-06-03 21:15:46 +03:00
luo_file.c liveupdate: Remove limit on the number of files per session 2026-06-03 21:15:46 +03:00
luo_flb.c liveupdate: Remember FLB retrieve() status 2026-07-25 15:26:30 +03:00
luo_internal.h liveupdate: Remove limit on the number of files per session 2026-06-03 21:15:46 +03:00
luo_session.c Merge branch 'misc' into next 2026-08-04 10:51:49 +03:00
Makefile kho: expose kho_scratch_overlap() to kexec_handover.h 2026-08-04 09:23:05 +03:00