Skip to content

Commit 3db3eb2

Browse files
Petr TesarikKAGA-KOKO
authored andcommitted
x86/setup: Do not reserve a crash kernel region if booted on Xen PV
Xen PV domains cannot shut down and start a crash kernel. Instead, the crashing kernel makes a SCHEDOP_shutdown hypercall with the reason code SHUTDOWN_crash, cf. xen_crash_shutdown() machine op in arch/x86/xen/enlighten_pv.c. A crash kernel reservation is merely a waste of RAM in this case. It may also confuse users of kexec_load(2) and/or kexec_file_load(2). When flags include KEXEC_ON_CRASH or KEXEC_FILE_ON_CRASH, respectively, these syscalls return success, which is technically correct, but the crash kexec image will never be actually used. Signed-off-by: Petr Tesarik <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Cc: Tom Lendacky <[email protected]> Cc: Dou Liyang <[email protected]> Cc: Mikulas Patocka <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: [email protected] Cc: Boris Ostrovsky <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Jean Delvare <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent b837913 commit 3db3eb2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/x86/kernel/setup.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include <linux/init_ohci1394_dma.h>
5151
#include <linux/kvm_para.h>
5252
#include <linux/dma-contiguous.h>
53+
#include <xen/xen.h>
5354

5455
#include <linux/errno.h>
5556
#include <linux/kernel.h>
@@ -534,6 +535,11 @@ static void __init reserve_crashkernel(void)
534535
high = true;
535536
}
536537

538+
if (xen_pv_domain()) {
539+
pr_info("Ignoring crashkernel for a Xen PV domain\n");
540+
return;
541+
}
542+
537543
/* 0 means: find the address automatically */
538544
if (crash_base <= 0) {
539545
/*

0 commit comments

Comments
 (0)