[RFC PATCH 0/2] memblock: keep reserve_mem regions out of KHO bootmem

From: Jose A. Perez de Azpillaga

Date: Wed Oct 21 2026 - 17:15:20 EST


On a KHO boot, a reserve_mem= region that can't be revived (new name,
size or alignment) can be allocated from KHO bootmem, which the next
kernel boots out of. With CONFIG_KEXEC_HANDOVER_DEBUG preserving it
fails; without it, the next kernel's memmap ends up on top of it.

Patch 1 factors the bootmem check out of memblock_alloc_hugetlb(), and
patch 2 uses it for reserve_mem. That also drops the TODO in
reserve_mem(), which asks for the allocation to be outside KHO_NOPRSRV,
though it's bootmem it has to stay out of.

Questions:

- If kho_discover_noprsrv() fails, only bootmem is NOPRSRV, and
reserve_mem() now fails with -ENOMEM instead of using it. Is that the
right thing to do?

- Should reserve_mem skip mirrored memory like HugeTLB does, rather
than keep the fallback?

No Cc: stable, since patch 2 relies on 14773e2aa4c5 ("kho: extend
scratch") for room outside bootmem.

Based on next-20261021, as it needs the KHO bootmem rename from
liveupdate-7.4 and touches code changed in memblock for-next.

Tested on x86_64 in QEMU.

Jose A. Perez de Azpillaga (2):
memblock: factor out the KHO bootmem check from
memblock_alloc_hugetlb()
memblock: don't allocate reserve_mem regions from KHO bootmem

mm/memblock.c | 100 ++++++++++++++++++++++++++++++++------------------
1 file changed, 64 insertions(+), 36 deletions(-)


base-commit: 9a482184d910775cf648863148944945b74e2815
--
2.55.0