From 6259b12f5cc80fb90a20da36b6a232a493c6a3f8 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 28 Mar 2018 15:15:15 +0200 Subject: kexec: Fix option checks to take KEXEC_FILE_LOAD into account When kexec_file_load support was added some sanity checks were not updated. Some options are set only in the kexec_load flags so cannot be supported wiht kexec_file_load. On the other hand, reserved memory is needed for kdump with both kexec_load and kexec_file_load. Signed-off-by: Michal Suchanek Signed-off-by: Simon Horman --- kexec/kexec.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kexec/kexec.c b/kexec/kexec.c index ab8cff7..b793f31 100644 --- a/kexec/kexec.c +++ b/kexec/kexec.c @@ -1415,7 +1415,9 @@ int main(int argc, char *argv[]) do_load_jump_back_helper = 0; } - if (do_load && (kexec_flags & KEXEC_ON_CRASH) && + if (do_load && + ((kexec_flags & KEXEC_ON_CRASH) || + (kexec_file_flags & KEXEC_FILE_ON_CRASH)) && !is_crashkernel_mem_reserved()) { die("Memory for crashkernel is not reserved\n" "Please reserve memory by passing" @@ -1447,6 +1449,12 @@ int main(int argc, char *argv[]) } } } + if (do_kexec_file_syscall) { + if (do_load_jump_back_helper) + die("--load-jump-back-helper not supported with kexec_file_load\n"); + if (kexec_flags & KEXEC_PRESERVE_CONTEXT) + die("--load-preserve-context not supported with kexec_file_load\n"); + } if (do_reuse_initrd){ check_reuse_initrd(); -- cgit