summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorPratyush Yadav (Google) <pratyush@kernel.org>2026-09-22 06:13:14 +0200
committerMike Rapoport <rppt@kernel.org>2026-10-09 18:13:27 +0200
commit48edec475144a9acb9515d37475bda4752912727 (patch)
treeecbc1e3a05d83eb12219bf6fafae2ef42e2dbeb8 /kernel
parent22626c347d250797fa76616feeb55ba9f6c0192c (diff)
memblock: rename KHO_SCRATCH to KHO_NOPRSRV
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> Link: https://patch.msgid.link/20260922041321.233986-3-pratyush@kernel.org Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/liveupdate/kexec_handover.c8
1 files changed, 4 insertions, 4 deletions
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;