x86: Do not reserve a crash kernel region if booted on Xen PV
PATCH 1/1 x86: 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.
--- arch/x86/kernel/setup.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/x86/kernel/setup.c +6 -0
@@ -50,6 +50,7 @@#include <linux/init_ohci1394_dma.h> #include <linux/kvm_para.h> #include <linux/dma-contiguous.h> +#include <xen/xen.h> #include <linux/errno.h> #include <linux/kernel.h>
@@ -534,6 +535,11 @@ static void __init reserve_crashkernel(void) high = true; } +if (xen_pv_domain ()) { +pr_info ("Ignoring crashkernel for a Xen PV domain\n" ); +return ; + } +/* 0 means: find the address automatically */ if (crash_base <=0 ) {/*
Signature · 1 line
2.13.6
Quoted 5 lines · Petr Tesarik
Xen PV domains cannot shut down and start a crash kernel. Instead, the crashing kernel makes a
SCHEDOP_shutdownhypercall with the reason codeSHUTDOWN_crash, cf.xen_crash_shutdown()machine op inarch/x86/xen/enlighten_pv.c.
Quoted 7 lines
A crash kernel reservation is merely a waste of RAM in this case. It may also confuse users of
kexec_load(2)and/orkexec_file_load(2). When flags includeKEXEC_ON_CRASHorKEXEC_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]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 5 lines · Petr Tesarik
Xen PV domains cannot shut down and start a crash kernel. Instead, the crashing kernel makes a
SCHEDOP_shutdownhypercall with the reason codeSHUTDOWN_crash, cf.xen_crash_shutdown()machine op inarch/x86/xen/enlighten_pv.c.
Quoted 7 lines
A crash kernel reservation is merely a waste of RAM in this case. It may also confuse users of
kexec_load(2)and/orkexec_file_load(2). When flags includeKEXEC_ON_CRASHorKEXEC_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]>
Juergen
tip-bot for Petr Tesarik
merge bot[tip:x86/urgent] x86/setup: Do not reserve a crash kernel region if booted on Xen PV
In reply to Petr Tesarikx86/setup: Do not reserve a crash kernel region if booted on Xen PV
Commit-ID: 3db3eb285259ac129f7aec6b814b3e9f6c1b372b Gitweb: https://git.kernel.org/tip/3db3eb285259ac129f7aec6b814b3e9f6c1b372b Author: Petr Tesarik <[email protected]> AuthorDate: Wed, 25 Apr 2018 12:08:35 +0200 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 27 Apr 2018 17:06:28 +0200
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.
--- arch/x86/kernel/setup.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/x86/kernel/setup.c +6 -0
@@ -50,6 +50,7 @@#include <linux/init_ohci1394_dma.h> #include <linux/kvm_para.h> #include <linux/dma-contiguous.h> +#include <xen/xen.h> #include <linux/errno.h> #include <linux/kernel.h>
@@ -534,6 +535,11 @@ static void __init reserve_crashkernel(void) high = true; } +if (xen_pv_domain ()) { +pr_info ("Ignoring crashkernel for a Xen PV domain\n" ); +return ; + } +/* 0 means: find the address automatically */ if (crash_base <=0 ) {/*