* [PATCH v2 0/4] kho: rename "scratch" to "bootmem"
@ 2026-09-08 15:56 Pratyush Yadav
2026-09-08 15:56 ` [PATCH v2 1/4] memblock: get rid of CONFIG_MEMBLOCK_KHO_SCRATCH Pratyush Yadav
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Pratyush Yadav @ 2026-09-08 15:56 UTC (permalink / raw)
To: Jonathan Corbet, Shuah Khan, Mike Rapoport, Pasha Tatashin,
Pratyush Yadav, Alexander Graf, Andrew Morton, David Hildenbrand,
Lorenzo Stoakes, Liam R. Howlett, Vlastimil Babka,
Suren Baghdasaryan, Michal Hocko, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, H. Peter Anvin, Ard Biesheuvel,
Ilias Apalodimas, Rob Herring, Saravana Kannan, Arnd Bergmann,
Baoquan He
Cc: x86, linux-doc, linux-kernel, kexec, linux-mm, linux-efi,
devicetree, linux-arch
From: "Pratyush Yadav (Google)" <pratyush@kernel.org>
The term "KHO scratch" is vague and overloaded. It does not accurately
describe what the memory is for. This was discussed previously at [0].
The conclusion was to rename "KHO scratch" to "KHO bootmem", since this
is memory passed by the previous kernel for early boot allocations.
In addition, memblock does not care about the provenance of the memory.
It cares more about how it should use it. Use MEMBLOCK_KHO_NOPRSRV,
instead of MEMBLOCK_KHO_SCRATCH, to describe this memory to memblock.
This series does the renames. It also gets rid of a redundant Kconfig.
While the diffstat is big and scary, most of the changes are mechanical.
The most interesting functional change is in patch 4.
This series touches a lot of files across a lot of trees. But since all
of that is purely KHO-related code, I would like to collect ACKs from
the maintainers and take it via the liveupdate tree.
Ideally we should queue it in liveupdate/next early in the v7.4 cycle
since it will cause a lot of conflicts with other patches throughout the
KHO tree.
[0] https://lore.kernel.org/kexec/agHGOxSnP_VraH1M@kernel.org/T/#u
Changes in v2:
- Rebase on latest liveupdate/next.
Pratyush Yadav (Google) (4):
memblock: get rid of CONFIG_MEMBLOCK_KHO_SCRATCH
memblock: rename KHO_SCRATCH to KHO_NOPRSRV
kho: rename KHO scratch to KHO bootmem
kho: rename kho_scratch= commandline parameter to kho_bootmem=
.../admin-guide/kernel-parameters.txt | 15 +-
Documentation/admin-guide/mm/kho.rst | 18 +-
Documentation/core-api/kho/index.rst | 36 +-
arch/x86/boot/compressed/kaslr.c | 12 +-
arch/x86/include/uapi/asm/setup_data.h | 4 +-
arch/x86/kernel/e820.c | 2 +-
arch/x86/kernel/kexec-bzimage64.c | 6 +-
arch/x86/kernel/setup.c | 2 +-
arch/x86/realmode/init.c | 2 +-
drivers/firmware/efi/efi-init.c | 6 +-
drivers/of/kexec.c | 16 +-
include/asm-generic/kexec_handover.h | 2 +-
include/linux/kexec.h | 2 +-
include/linux/kexec_handover.h | 16 +-
include/linux/memblock.h | 30 +-
kernel/liveupdate/Kconfig | 1 -
kernel/liveupdate/kexec_handover.c | 340 +++++++++---------
kernel/liveupdate/kexec_handover_debugfs.c | 24 +-
kernel/liveupdate/kexec_handover_internal.h | 4 +-
mm/Kconfig | 4 -
mm/memblock.c | 56 +--
mm/mm_init.c | 6 +-
tools/testing/memblock/internal.h | 2 +-
23 files changed, 302 insertions(+), 304 deletions(-)
base-commit: c65687600ed075d237a204755d99ad538db34b47
--
2.55.0.979.g7e5102b832-goog
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/4] memblock: get rid of CONFIG_MEMBLOCK_KHO_SCRATCH
2026-09-08 15:56 [PATCH v2 0/4] kho: rename "scratch" to "bootmem" Pratyush Yadav
@ 2026-09-08 15:56 ` Pratyush Yadav
2026-09-08 15:56 ` [PATCH v2 2/4] memblock: rename KHO_SCRATCH to KHO_NOPRSRV Pratyush Yadav
2026-09-08 15:56 ` [PATCH v2 4/4] kho: rename kho_scratch= commandline parameter to kho_bootmem= Pratyush Yadav
2 siblings, 0 replies; 4+ messages in thread
From: Pratyush Yadav @ 2026-09-08 15:56 UTC (permalink / raw)
To: Jonathan Corbet, Shuah Khan, Mike Rapoport, Pasha Tatashin,
Pratyush Yadav, Alexander Graf, Andrew Morton, David Hildenbrand,
Lorenzo Stoakes, Liam R. Howlett, Vlastimil Babka,
Suren Baghdasaryan, Michal Hocko, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, H. Peter Anvin, Ard Biesheuvel,
Ilias Apalodimas, Rob Herring, Saravana Kannan, Arnd Bergmann,
Baoquan He
Cc: x86, linux-doc, linux-kernel, kexec, linux-mm, linux-efi,
devicetree, linux-arch
From: "Pratyush Yadav (Google)" <pratyush@kernel.org>
This config is only a proxy for CONFIG_KEXEC_HANDOVER. It is only
enabled by KHO. No point in the indirection. Use CONFIG_KEXEC_HANDOVER
directly.
Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
---
include/linux/memblock.h | 2 +-
kernel/liveupdate/Kconfig | 1 -
mm/Kconfig | 4 ----
mm/memblock.c | 4 ++--
4 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index d62db9e776cf..db3b106c6335 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -614,7 +614,7 @@ static inline void early_memtest(phys_addr_t start, phys_addr_t end) { }
static inline void memtest_report_meminfo(struct seq_file *m) { }
#endif
-#ifdef CONFIG_MEMBLOCK_KHO_SCRATCH
+#ifdef CONFIG_KEXEC_HANDOVER
void memblock_set_kho_scratch_only(void);
void memblock_clear_kho_scratch_only(void);
#else
diff --git a/kernel/liveupdate/Kconfig b/kernel/liveupdate/Kconfig
index c13af38ba23a..f50daee8eff0 100644
--- a/kernel/liveupdate/Kconfig
+++ b/kernel/liveupdate/Kconfig
@@ -5,7 +5,6 @@ menu "Live Update and Kexec HandOver"
config KEXEC_HANDOVER
bool "kexec handover"
depends on ARCH_SUPPORTS_KEXEC_HANDOVER && ARCH_SUPPORTS_KEXEC_FILE
- select MEMBLOCK_KHO_SCRATCH
select KEXEC_FILE
select LIBFDT
select CMA
diff --git a/mm/Kconfig b/mm/Kconfig
index 604c58199acb..631a410eaee9 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -483,10 +483,6 @@ config HAVE_GUP_FAST
depends on MMU
bool
-# Enable memblock support for scratch memory which is needed for kexec handover
-config MEMBLOCK_KHO_SCRATCH
- bool
-
# Don't discard allocated memory used to track "memory" and "reserved" memblocks
# after early boot, so it can still be used to test for validity of memory.
# Also, memblocks are updated with memory hot(un)plug.
diff --git a/mm/memblock.c b/mm/memblock.c
index 9ce86349a29f..197d854c18d5 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -113,7 +113,7 @@ unsigned long min_low_pfn;
unsigned long max_pfn;
unsigned long long max_possible_pfn;
-#ifdef CONFIG_MEMBLOCK_KHO_SCRATCH
+#ifdef CONFIG_KEXEC_HANDOVER
/* When set to true, only allocate from MEMBLOCK_KHO_SCRATCH ranges */
static bool kho_scratch_only;
#else
@@ -2596,7 +2596,7 @@ int reserve_mem_release_by_name(const char *name)
return 1;
}
-#ifdef CONFIG_MEMBLOCK_KHO_SCRATCH
+#ifdef CONFIG_KEXEC_HANDOVER
__init void memblock_set_kho_scratch_only(void)
{
kho_scratch_only = true;
--
2.55.0.979.g7e5102b832-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/4] memblock: rename KHO_SCRATCH to KHO_NOPRSRV
2026-09-08 15:56 [PATCH v2 0/4] kho: rename "scratch" to "bootmem" Pratyush Yadav
2026-09-08 15:56 ` [PATCH v2 1/4] memblock: get rid of CONFIG_MEMBLOCK_KHO_SCRATCH Pratyush Yadav
@ 2026-09-08 15:56 ` Pratyush Yadav
2026-09-08 15:56 ` [PATCH v2 4/4] kho: rename kho_scratch= commandline parameter to kho_bootmem= Pratyush Yadav
2 siblings, 0 replies; 4+ messages in thread
From: Pratyush Yadav @ 2026-09-08 15:56 UTC (permalink / raw)
To: Jonathan Corbet, Shuah Khan, Mike Rapoport, Pasha Tatashin,
Pratyush Yadav, Alexander Graf, Andrew Morton, David Hildenbrand,
Lorenzo Stoakes, Liam R. Howlett, Vlastimil Babka,
Suren Baghdasaryan, Michal Hocko, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, H. Peter Anvin, Ard Biesheuvel,
Ilias Apalodimas, Rob Herring, Saravana Kannan, Arnd Bergmann,
Baoquan He
Cc: x86, linux-doc, linux-kernel, kexec, linux-mm, linux-efi,
devicetree, linux-arch
From: "Pratyush Yadav (Google)" <pratyush@kernel.org>
The term "KHO scratch" is vague. It does not accurately describe what
the memory is for. Generally, scratch is for things that don't contain
anything useful. This is not true.
For memblock, KHO_SCRATCH is the _only_ useful memory during a KHO boot.
It is memory passed by the previous kernel that is guaranteed to have no
preserved pages, and so is the only thing safe to allocate from early in
boot.
In addition, KHO now has the ability to discover other "scratch" areas.
These aren't directly passed by the previous kernel. Instead, they are
found by searching the KHO preserved memory map.
Memblock does not care about the difference between the two. From
memblock's perspective, both are memory areas with no preservations and
so they are safe to allocate from before KHO fully initializes.
Rename MEMBLOCK_KHO_SCRATCH to MEMBLOCK_KHO_NOPRSRV. This name clearly
shows what the memory is for from memblock's perspective. Update
memblock functions and comments that refer to scratch to use noprsrv.
There are no functional changes apart from the flag name change in
debugfs.
Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
---
arch/x86/kernel/e820.c | 2 +-
arch/x86/realmode/init.c | 2 +-
drivers/firmware/efi/efi-init.c | 2 +-
include/linux/memblock.h | 28 +++++++++----------
kernel/liveupdate/kexec_handover.c | 8 +++---
mm/memblock.c | 44 +++++++++++++++---------------
6 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index eb72537bc0b1..2a6e19f95251 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1363,7 +1363,7 @@ __init void e820__memblock_setup(void)
* After real mode trampoline is allocated, we clear that scratch
* marking.
*/
- memblock_mark_kho_scratch(0, SZ_1M);
+ memblock_mark_kho_noprsrv(0, SZ_1M);
/*
* 32-bit systems are limited to 4BG of memory even with HIGHMEM and
diff --git a/arch/x86/realmode/init.c b/arch/x86/realmode/init.c
index 694d80a5c68e..65110b2ee1a1 100644
--- a/arch/x86/realmode/init.c
+++ b/arch/x86/realmode/init.c
@@ -66,7 +66,7 @@ void __init reserve_real_mode(void)
*/
memblock_reserve(0, SZ_1M);
- memblock_clear_kho_scratch(0, SZ_1M);
+ memblock_clear_kho_noprsrv(0, SZ_1M);
}
static void __init sme_sev_setup_real_mode(struct trampoline_header *th)
diff --git a/drivers/firmware/efi/efi-init.c b/drivers/firmware/efi/efi-init.c
index 6103b1a082d2..a2edaf3766eb 100644
--- a/drivers/firmware/efi/efi-init.c
+++ b/drivers/firmware/efi/efi-init.c
@@ -178,7 +178,7 @@ static __init void reserve_regions(void)
/* Remove all non-KHO regions */
for_each_mem_region(r) {
- if (!memblock_is_kho_scratch(r)) {
+ if (!memblock_is_kho_noprsrv(r)) {
memblock_remove(r->base, r->size);
r--;
}
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index db3b106c6335..186b965cfc89 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -46,11 +46,11 @@ extern unsigned long long max_possible_pfn;
* @MEMBLOCK_RSRV_KERN: memory region that is reserved for kernel use,
* either explictitly with memblock_reserve_kern() or via memblock
* allocation APIs. All memblock allocations set this flag.
- * @MEMBLOCK_KHO_SCRATCH: memory region that kexec can pass to the next
- * kernel in handover mode. During early boot, we do not know about all
- * memory reservations yet, so we get scratch memory from the previous
- * kernel that we know is good to use. It is the only memory that
- * allocations may happen from in this phase.
+ * @MEMBLOCK_KHO_NOPRSRV: memory region with no preservation from kexec
+ * handover. During early boot, we do not know about all memory preservations
+ * yet, so we get memory with no preservations from the previous kernel that we
+ * know is good to use. It is the only memory that allocations may happen from
+ * in this phase.
* @MEMBLOCK_RSRV_HUGETLB: memory is reserved for hugetlb pages
*/
enum memblock_flags {
@@ -61,7 +61,7 @@ enum memblock_flags {
MEMBLOCK_DRIVER_MANAGED = 0x8, /* always detected via a driver */
MEMBLOCK_RSRV_NOINIT = 0x10, /* don't initialize struct pages */
MEMBLOCK_RSRV_KERN = 0x20, /* memory reserved for kernel use */
- MEMBLOCK_KHO_SCRATCH = 0x40, /* scratch memory for kexec handover */
+ MEMBLOCK_KHO_NOPRSRV = 0x40, /* memory with no KHO preservations */
MEMBLOCK_RSRV_HUGETLB = 0x80, /* memory reserved for hugetlb pages */
};
@@ -158,8 +158,8 @@ int memblock_mark_nomap(phys_addr_t base, phys_addr_t size);
int memblock_clear_nomap(phys_addr_t base, phys_addr_t size);
int memblock_reserved_mark_noinit(phys_addr_t base, phys_addr_t size);
int memblock_reserved_mark_kern(phys_addr_t base, phys_addr_t size);
-int memblock_mark_kho_scratch(phys_addr_t base, phys_addr_t size);
-int memblock_clear_kho_scratch(phys_addr_t base, phys_addr_t size);
+int memblock_mark_kho_noprsrv(phys_addr_t base, phys_addr_t size);
+int memblock_clear_kho_noprsrv(phys_addr_t base, phys_addr_t size);
void memblock_free(void *ptr, size_t size);
void reset_all_zones_managed_pages(void);
@@ -301,9 +301,9 @@ static inline bool memblock_is_driver_managed(struct memblock_region *m)
return m->flags & MEMBLOCK_DRIVER_MANAGED;
}
-static inline bool memblock_is_kho_scratch(struct memblock_region *m)
+static inline bool memblock_is_kho_noprsrv(struct memblock_region *m)
{
- return m->flags & MEMBLOCK_KHO_SCRATCH;
+ return m->flags & MEMBLOCK_KHO_NOPRSRV;
}
int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn,
@@ -615,11 +615,11 @@ static inline void memtest_report_meminfo(struct seq_file *m) { }
#endif
#ifdef CONFIG_KEXEC_HANDOVER
-void memblock_set_kho_scratch_only(void);
-void memblock_clear_kho_scratch_only(void);
+void memblock_set_kho_noprsrv_only(void);
+void memblock_clear_kho_noprsrv_only(void);
#else
-static inline void memblock_set_kho_scratch_only(void) { }
-static inline void memblock_clear_kho_scratch_only(void) { }
+static inline void memblock_set_kho_noprsev_only(void) { }
+static inline void memblock_clear_kho_noprsrv_only(void) { }
#endif
#endif /* _LINUX_MEMBLOCK_H */
diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c
index 3c87c2a3d6f0..7f45cecf2c2c 100644
--- a/kernel/liveupdate/kexec_handover.c
+++ b/kernel/liveupdate/kexec_handover.c
@@ -958,7 +958,7 @@ static int __init kho_ext_mark_scratch(unsigned long key, void *data)
int err;
if (start > *prev_end) {
- err = memblock_mark_kho_scratch(*prev_end, start - *prev_end);
+ err = memblock_mark_kho_noprsrv(*prev_end, start - *prev_end);
if (err)
return err;
}
@@ -1031,7 +1031,7 @@ static void __init kho_extend_scratch(void)
/* Mark everything from last busy block to end of DRAM. */
if (prev_end < memblock_end_of_DRAM())
- err = memblock_mark_kho_scratch(prev_end, memblock_end_of_DRAM() - prev_end);
+ err = memblock_mark_kho_noprsrv(prev_end, memblock_end_of_DRAM() - prev_end);
/* fallthrough */
out:
@@ -2002,7 +2002,7 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len,
u64 size = area->size;
memblock_add(area->addr, size);
- err = memblock_mark_kho_scratch(area->addr, size);
+ err = memblock_mark_kho_noprsrv(area->addr, size);
if (err) {
pr_warn("failed to mark the scratch region 0x%pa+0x%pa: %pe",
&area->addr, &size, ERR_PTR(err));
@@ -2020,7 +2020,7 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len,
* we initialize the page tables which we will need to ingest all
* memory reservations from the previous kernel.
*/
- memblock_set_kho_scratch_only();
+ memblock_set_kho_noprsrv_only();
kho_in.fdt_phys = fdt_phys;
kho_in.scratch_phys = scratch_phys;
diff --git a/mm/memblock.c b/mm/memblock.c
index 197d854c18d5..947d8767d7ec 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -114,10 +114,10 @@ unsigned long max_pfn;
unsigned long long max_possible_pfn;
#ifdef CONFIG_KEXEC_HANDOVER
-/* When set to true, only allocate from MEMBLOCK_KHO_SCRATCH ranges */
-static bool kho_scratch_only;
+/* When set to true, only allocate from MEMBLOCK_KHO_NOPRSRV ranges */
+static bool kho_noprsrv_only;
#else
-#define kho_scratch_only false
+#define kho_noprsrv_only false
#endif
static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_MEMORY_REGIONS] __initdata_memblock;
@@ -179,9 +179,9 @@ bool __init_memblock memblock_has_mirror(void)
static enum memblock_flags __init_memblock choose_memblock_flags(void)
{
- /* skip non-scratch memory for kho early boot allocations */
- if (kho_scratch_only)
- return MEMBLOCK_KHO_SCRATCH;
+ /* only use KHO_NOPRSRV memory for kho early boot allocations */
+ if (kho_noprsrv_only)
+ return MEMBLOCK_KHO_NOPRSRV;
return system_has_some_mirror ? MEMBLOCK_MIRROR : MEMBLOCK_NONE;
}
@@ -1175,33 +1175,33 @@ int __init_memblock memblock_reserved_mark_kern(phys_addr_t base, phys_addr_t si
}
/**
- * memblock_mark_kho_scratch - Mark a memory region as MEMBLOCK_KHO_SCRATCH.
+ * memblock_mark_kho_noprsrv - Mark a memory region as MEMBLOCK_KHO_NOPRSRV.
* @base: the base phys addr of the region
* @size: the size of the region
*
- * Only memory regions marked with %MEMBLOCK_KHO_SCRATCH will be considered
+ * Only memory regions marked with %MEMBLOCK_KHO_NOPRSRV will be considered
* for allocations during early boot with kexec handover.
*
* Return: 0 on success, -errno on failure.
*/
-__init int memblock_mark_kho_scratch(phys_addr_t base, phys_addr_t size)
+__init int memblock_mark_kho_noprsrv(phys_addr_t base, phys_addr_t size)
{
return memblock_setclr_flag(&memblock.memory, base, size, 1,
- MEMBLOCK_KHO_SCRATCH);
+ MEMBLOCK_KHO_NOPRSRV);
}
/**
- * memblock_clear_kho_scratch - Clear MEMBLOCK_KHO_SCRATCH flag for a
+ * memblock_clear_kho_noprsrv - Clear MEMBLOCK_KHO_NOPRSRV flag for a
* specified region.
* @base: the base phys addr of the region
* @size: the size of the region
*
* Return: 0 on success, -errno on failure.
*/
-__init int memblock_clear_kho_scratch(phys_addr_t base, phys_addr_t size)
+__init int memblock_clear_kho_noprsrv(phys_addr_t base, phys_addr_t size)
{
return memblock_setclr_flag(&memblock.memory, base, size, 0,
- MEMBLOCK_KHO_SCRATCH);
+ MEMBLOCK_KHO_NOPRSRV);
}
static bool should_skip_region(struct memblock_type *type,
@@ -1237,9 +1237,9 @@ static bool should_skip_region(struct memblock_type *type,
/*
* In early alloc during kexec handover, we can only consider
- * MEMBLOCK_KHO_SCRATCH regions for the allocations
+ * MEMBLOCK_KHO_NOPRSRV regions for the allocations
*/
- if ((flags & MEMBLOCK_KHO_SCRATCH) && !memblock_is_kho_scratch(m))
+ if ((flags & MEMBLOCK_KHO_NOPRSRV) && !memblock_is_kho_noprsrv(m))
return true;
return false;
@@ -2498,7 +2498,7 @@ void __init memblock_free_all(void)
free_unused_memmap();
reset_all_zones_managed_pages();
- memblock_clear_kho_scratch_only();
+ memblock_clear_kho_noprsrv_only();
pages = free_low_memory_core_early();
totalram_pages_add(pages);
}
@@ -2597,14 +2597,14 @@ int reserve_mem_release_by_name(const char *name)
}
#ifdef CONFIG_KEXEC_HANDOVER
-__init void memblock_set_kho_scratch_only(void)
+__init void memblock_set_kho_noprsrv_only(void)
{
- kho_scratch_only = true;
+ kho_noprsrv_only = true;
}
-__init void memblock_clear_kho_scratch_only(void)
+__init void memblock_clear_kho_noprsrv_only(void)
{
- kho_scratch_only = false;
+ kho_noprsrv_only = false;
}
#endif
@@ -2860,7 +2860,7 @@ static int __init reserve_mem(char *p)
if (reserve_mem_kho_revive(name, size, align))
return 1;
- /* TODO: Allocation must be outside of scratch region */
+ /* TODO: Allocation must be outside of KHO_NOPRSRV region */
start = memblock_phys_alloc(size, align);
if (!start) {
pr_err("reserve_mem: memblock allocation failed\n");
@@ -2885,7 +2885,7 @@ static const char * const flagname[] = {
[ilog2(MEMBLOCK_DRIVER_MANAGED)] = "DRV_MNG",
[ilog2(MEMBLOCK_RSRV_NOINIT)] = "RSV_NIT",
[ilog2(MEMBLOCK_RSRV_KERN)] = "RSV_KERN",
- [ilog2(MEMBLOCK_KHO_SCRATCH)] = "KHO_SCRATCH",
+ [ilog2(MEMBLOCK_KHO_NOPRSRV)] = "KHO_NOPRSRV",
};
static int memblock_debug_show(struct seq_file *m, void *private)
--
2.55.0.979.g7e5102b832-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 4/4] kho: rename kho_scratch= commandline parameter to kho_bootmem=
2026-09-08 15:56 [PATCH v2 0/4] kho: rename "scratch" to "bootmem" Pratyush Yadav
2026-09-08 15:56 ` [PATCH v2 1/4] memblock: get rid of CONFIG_MEMBLOCK_KHO_SCRATCH Pratyush Yadav
2026-09-08 15:56 ` [PATCH v2 2/4] memblock: rename KHO_SCRATCH to KHO_NOPRSRV Pratyush Yadav
@ 2026-09-08 15:56 ` Pratyush Yadav
2 siblings, 0 replies; 4+ messages in thread
From: Pratyush Yadav @ 2026-09-08 15:56 UTC (permalink / raw)
To: Jonathan Corbet, Shuah Khan, Mike Rapoport, Pasha Tatashin,
Pratyush Yadav, Alexander Graf, Andrew Morton, David Hildenbrand,
Lorenzo Stoakes, Liam R. Howlett, Vlastimil Babka,
Suren Baghdasaryan, Michal Hocko, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, H. Peter Anvin, Ard Biesheuvel,
Ilias Apalodimas, Rob Herring, Saravana Kannan, Arnd Bergmann,
Baoquan He
Cc: x86, linux-doc, linux-kernel, kexec, linux-mm, linux-efi,
devicetree, linux-arch
From: "Pratyush Yadav (Google)" <pratyush@kernel.org>
KHO now no longer uses "scratch" to describe the memory areas passed by
previous kernel. Instead, it calls them boot memory, or bootmem in
short. Rename the kho_scratch= commandline parameter to reflect this
terminology change.
Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
---
Documentation/admin-guide/kernel-parameters.txt | 2 +-
Documentation/admin-guide/mm/kho.rst | 4 ++--
kernel/liveupdate/kexec_handover.c | 6 +++---
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 6132fa73382a..8a42a924f133 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3031,7 +3031,7 @@ Kernel parameters
"0" | "off" | "n" - kexec handover is disabled
"1" | "on" | "y" - kexec handover is enabled
- kho_scratch= [KEXEC,EARLY]
+ kho_bootmem= [KEXEC,EARLY]
Format: ll[KMG],mm[KMG],nn[KMG] | nn%
Defines the size of the KHO boot memory region. The
diff --git a/Documentation/admin-guide/mm/kho.rst b/Documentation/admin-guide/mm/kho.rst
index 4fae09096038..f14c8d9ad6a4 100644
--- a/Documentation/admin-guide/mm/kho.rst
+++ b/Documentation/admin-guide/mm/kho.rst
@@ -20,8 +20,8 @@ need to enable if you would like to preserve their respective state across
kexec.
To use KHO, please boot the kernel with the ``kho=on`` command line
-parameter. You may use ``kho_scratch`` parameter to define size of the
-boot memory regions. For example ``kho_scratch=16M,512M,256M`` will reserve a
+parameter. You may use ``kho_bootmem`` parameter to define size of the
+boot memory regions. For example ``kho_bootmem=16M,512M,256M`` will reserve a
16 MiB low memory bootmem area, a 512 MiB global bootmem region, and 256 MiB
per NUMA node bootmem regions on boot.
diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c
index fe4b76ff5a2c..7018e25e4eda 100644
--- a/kernel/liveupdate/kexec_handover.c
+++ b/kernel/liveupdate/kexec_handover.c
@@ -671,12 +671,12 @@ unsigned int kho_bootmem_cnt;
* The bootmem areas are scaled by default as percent of memory allocated from
* memblock. A user can override the scale with command line parameter:
*
- * kho_scratch=N%
+ * kho_bootmem=N%
*
* It is also possible to explicitly define size for a lowmem, a global and
* per-node bootmem areas:
*
- * kho_scratch=l[KMG],n[KMG],m[KMG]
+ * kho_bootmem=l[KMG],n[KMG],m[KMG]
*
* The explicit size definition takes precedence over scale definition.
*/
@@ -751,7 +751,7 @@ static int __init kho_parse_bootmem_size(char *p)
return 0;
}
-early_param("kho_scratch", kho_parse_bootmem_size);
+early_param("kho_bootmem", kho_parse_bootmem_size);
static void __init bootmem_size_update(void)
{
--
2.55.0.979.g7e5102b832-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-08 15:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-08 15:56 [PATCH v2 0/4] kho: rename "scratch" to "bootmem" Pratyush Yadav
2026-09-08 15:56 ` [PATCH v2 1/4] memblock: get rid of CONFIG_MEMBLOCK_KHO_SCRATCH Pratyush Yadav
2026-09-08 15:56 ` [PATCH v2 2/4] memblock: rename KHO_SCRATCH to KHO_NOPRSRV Pratyush Yadav
2026-09-08 15:56 ` [PATCH v2 4/4] kho: rename kho_scratch= commandline parameter to kho_bootmem= Pratyush Yadav
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).