[PATCH] x86/kexec: Warn when E820 table is truncated in boot_params
From: Adriano Vero
Date: Mon Apr 06 2026 - 02:48:52 EST
setup_e820_entries() silently truncated the E820 memory map to
E820_MAX_ENTRIES_ZEROPAGE (128) entries when the kexec table exceeded
that limit, with no indication to the user that entries were dropped.
Add a pr_warn() when truncation occurs so that operators are aware
that memory regions beyond the 128-entry limit are not passed to the
kexec kernel via boot_params.
The underlying limitation (boot_params.e820_table is fixed at 128
entries by the x86 boot protocol) remains; this change only makes
the truncation visible.
Signed-off-by: Adriano Vero <litaliano00.contact@xxxxxxxxx>
---
arch/x86/kernel/kexec-bzimage64.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c
index 5630c7dca..27a7a9e82 100644
--- a/arch/x86/kernel/kexec-bzimage64.c
+++ b/arch/x86/kernel/kexec-bzimage64.c
@@ -109,9 +109,11 @@ static int setup_e820_entries(struct boot_params *params)
nr_e820_entries = e820_table_kexec->nr_entries;
- /* TODO: Pass entries more than E820_MAX_ENTRIES_ZEROPAGE in bootparams setup data */
- if (nr_e820_entries > E820_MAX_ENTRIES_ZEROPAGE)
+ if (nr_e820_entries > E820_MAX_ENTRIES_ZEROPAGE) {
+ pr_warn("E820 table has %u entries, truncating to %u supported by boot_params\n",
+ nr_e820_entries, E820_MAX_ENTRIES_ZEROPAGE);
nr_e820_entries = E820_MAX_ENTRIES_ZEROPAGE;
+ }
params->e820_entries = nr_e820_entries;
memcpy(¶ms->e820_table, &e820_table_kexec->entries, nr_e820_entries*sizeof(struct e820_entry));
--
2.53.0