All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] memblock: keep reserve_mem regions out of KHO bootmem
@ 2026-10-21 21:10 ` Jose A. Perez de Azpillaga
  0 siblings, 0 replies; 12+ messages in thread
From: Jose A. Perez de Azpillaga @ 2026-10-21 21:10 UTC (permalink / raw)
  To: Mike Rapoport, Andrew Morton, Kees Cook, Alexander Graf,
	Changyuan Lyu
  Cc: Tony Luck, Pasha Tatashin, linux-mm, kexec, linux-kernel,
	Jose A. Perez de Azpillaga, Pratyush Yadav

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



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-10-22 20:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-21 21:10 [RFC PATCH 0/2] memblock: keep reserve_mem regions out of KHO bootmem Jose A. Perez de Azpillaga
2026-10-21 21:10 ` Jose A. Perez de Azpillaga
2026-10-21 21:10 ` [RFC PATCH 1/2] memblock: factor out the KHO bootmem check from memblock_alloc_hugetlb() Jose A. Perez de Azpillaga
2026-10-21 21:10   ` Jose A. Perez de Azpillaga
2026-10-21 21:20   ` sashiko-bot
2026-10-21 21:10 ` [RFC PATCH 2/2] memblock: don't allocate reserve_mem regions from KHO bootmem Jose A. Perez de Azpillaga
2026-10-21 21:10   ` Jose A. Perez de Azpillaga
2026-10-21 21:20   ` sashiko-bot
2026-10-22 13:37 ` [RFC PATCH 0/2] memblock: keep reserve_mem regions out of " Pratyush Yadav
2026-10-22 13:37   ` Pratyush Yadav
2026-10-22 20:16   ` Jose A. Perez de Azpillaga
2026-10-22 20:16     ` Jose A. Perez de Azpillaga

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.