mirror of https://lore.kernel.org/lkml/
 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
  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 ` [RFC PATCH 2/2] memblock: don't allocate reserve_mem regions from KHO bootmem Jose A. Perez de Azpillaga
  0 siblings, 2 replies; 3+ 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, Guilherme G. Piccoli, linux-mm, linux-kernel,
	Pratyush Yadav, Pasha Tatashin, kexec,
	Jose A. Perez de Azpillaga

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] 3+ messages in thread

end of thread, other threads:[~2026-10-21 21:11 UTC | newest]

Thread overview: 3+ 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 ` [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 ` [RFC PATCH 2/2] memblock: don't allocate reserve_mem regions from KHO bootmem Jose A. Perez de Azpillaga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®