diff options
| author | Petr Tesarik <ptesarik@suse.cz> | 2018-04-25 06:08:35 -0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2018-04-27 11:06:28 -0400 |
| commit | 3db3eb285259ac129f7aec6b814b3e9f6c1b372b (patch) | |
| tree | 4d5bc5058ead6a13380ac4ecbf64f54b7b6347e0 | |
| parent | b837913fc2d9061bf9b8c0dd6bf2d24e2f98b84a (diff) | |
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 <ptesarik@suse.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Juergen Gross <jgross@suse.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: xen-devel@lists.xenproject.org
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Jean Delvare <jdelvare@suse.de>
Link: https://lkml.kernel.org/r/20180425120835.23cef60c@ezekiel.suse.cz
| -rw-r--r-- | arch/x86/kernel/setup.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 6285697b6e56..5c623dfe39d1 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
| @@ -50,6 +50,7 @@ | |||
| 50 | #include <linux/init_ohci1394_dma.h> | 50 | #include <linux/init_ohci1394_dma.h> |
| 51 | #include <linux/kvm_para.h> | 51 | #include <linux/kvm_para.h> |
| 52 | #include <linux/dma-contiguous.h> | 52 | #include <linux/dma-contiguous.h> |
| 53 | #include <xen/xen.h> | ||
| 53 | 54 | ||
| 54 | #include <linux/errno.h> | 55 | #include <linux/errno.h> |
| 55 | #include <linux/kernel.h> | 56 | #include <linux/kernel.h> |
| @@ -534,6 +535,11 @@ static void __init reserve_crashkernel(void) | |||
| 534 | high = true; | 535 | high = true; |
| 535 | } | 536 | } |
| 536 | 537 | ||
| 538 | if (xen_pv_domain()) { | ||
| 539 | pr_info("Ignoring crashkernel for a Xen PV domain\n"); | ||
| 540 | return; | ||
| 541 | } | ||
| 542 | |||
| 537 | /* 0 means: find the address automatically */ | 543 | /* 0 means: find the address automatically */ |
| 538 | if (crash_base <= 0) { | 544 | if (crash_base <= 0) { |
| 539 | /* | 545 | /* |
