[PATCH RFC 2/3] x86/e820: Allow memmap= in a kdump kernel in confidential guests
From: Pankaj Gupta
Date: Tue Nov 24 2026 - 08:32:58 EST
A kdump kernel can get memmap= on its command line, e.g. from kexec_load,
to restrict the memory it may use to its reserved region. Ignoring it
would let the kdump kernel use the memory of the crashed kernel.
Do not ignore memmap= when elfcorehdr= is on the command line, which marks
a kdump kernel.
Signed-off-by: Pankaj Gupta <pankaj.gupta@xxxxxxx>
---
arch/x86/kernel/e820.c | 7 +++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 142657be690d..9c206ad4369c 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -17,6 +17,7 @@
#include <linux/kvm_types.h>
#include <linux/cc_platform.h>
+#include <asm/cmdline.h>
#include <asm/e820/api.h>
#include <asm/setup.h>
@@ -908,9 +909,14 @@ __initdata static int userdef;
__init static bool cc_ignore_cmdline_mem(const char *opt)
{
+ char buf[32];
+
if (!cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT))
return false;
+ if (cmdline_find_option(boot_command_line, "elfcorehdr", buf, sizeof(buf)) >= 0)
+ return false;
+
pr_warn("%s= is not supported in confidential guests, ignoring\n", opt);
return true;
}
--
2.34.1