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 --- 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 #include +#include #include #include @@ -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