From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1eyJcq-0006qt-Mh for kexec@lists.infradead.org; Tue, 20 Mar 2018 15:56:38 +0000 From: Michal Suchanek Subject: [PATCH v5 2/5] kexec: Fix option checks to take KEXEC_FILE_LOAD into account Date: Tue, 20 Mar 2018 16:56:17 +0100 Message-Id: <74aedcfeb3eaea91c8565e1e4993a0dffcf3b176.1521561315.git.msuchanek@suse.de> In-Reply-To: References: <20180316114714.4tmf4gr3d6boowi5@verge.net.au> In-Reply-To: <20180302091706.GA15374@dhcp-128-65.nay.redhat.com> References: <20180302091706.GA15374@dhcp-128-65.nay.redhat.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: kexec@lists.infradead.org Cc: Tony Jones , Dave Young , Michal Suchanek , Petr Tesarik , horms@verge.net.au 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 --- kexec/kexec.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kexec/kexec.c b/kexec/kexec.c index ab8cff7fe083..b793f31ea501 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(); -- 2.13.6 _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec