From patchwork Tue Sep 9 22:49:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 4873241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0EFE29F32E for ; Tue, 9 Sep 2014 22:53:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 33B53201BB for ; Tue, 9 Sep 2014 22:53:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 29C552017E for ; Tue, 9 Sep 2014 22:53:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XRUFT-0007S7-Ud; Tue, 09 Sep 2014 22:50:55 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XRUDi-0004cl-Q4; Tue, 09 Sep 2014 22:49:06 +0000 Received: from geoff by merlin.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1XRUDh-0007Sm-RT; Tue, 09 Sep 2014 22:49:05 +0000 Message-Id: <99f09410a26c001efd06c270aa2e348d6cac6b01.1410302383.git.geoff@infradead.org> In-Reply-To: References: From: Geoff Levand Patch-Date: Tue, 9 Sep 2014 12:35:14 -0700 Subject: [PATCH 13/13] arm64/kexec: Add kexec_ignore_compat_check param To: Catalin Marinas , Will Deacon Date: Tue, 09 Sep 2014 22:49:05 +0000 Cc: marc.zyngier@arm.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, christoffer.dall@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add the new kernel command line parameter kexec_ignore_compat_check which specifies whether or not to ignore arm64 kexec compatibility checks. For some systems the compatibility checks may be too restrictive, and setting this parameter could allow those systems to kexec to kernel images that would not pass the compatibility checks. Signed-off-by: Geoff Levand --- Documentation/kernel-parameters.txt | 13 +++++++++++++ arch/arm64/kernel/machine_kexec.c | 19 +++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 5ae8608..c70f4b8 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1529,6 +1529,19 @@ bytes respectively. Such letter suffixes can also be entirely omitted. use the HighMem zone if it exists, and the Normal zone if it does not. + kexec_ignore_compat_check [KEXEC,ARM64] + This parameter specifies whether or not to ignore arm64 + kexec compatibility checks. The default is to honor the + checks. Set this parameter to ignore all kexec + compatibility checks on arm64 systems. Setting this + could cause the system to become unstable after a kexec + re-boot. If unsure, do not set. + + For some systems the compatibility checks may be too + restrictive, and setting this parameter could allow + those systems to kexec to kernel images that would not + pass the compatibility checks. + kgdbdbgp= [KGDB,HW] kgdb over EHCI usb debug port. Format: [,poll interval] The controller # is the number of the ehci usb debug diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index 043a3bc..45c2db2 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -36,6 +36,20 @@ extern unsigned long kexec_dtb_addr; extern unsigned long kexec_kimage_head; extern unsigned long kexec_kimage_start; +/* + * kexec_ignore_compat_check - Set to ignore kexec compatibility checks. + */ + +static int __read_mostly kexec_ignore_compat_check; + +static int __init setup_kexec_ignore_compat_check(char *__unused) +{ + kexec_ignore_compat_check = 1; + return 1; +} + +__setup("kexec_ignore_compat_check", setup_kexec_ignore_compat_check); + /** * struct kexec_boot_info - Boot info needed by the local kexec routines. */ @@ -410,7 +424,8 @@ static int kexec_compat_check(const struct kexec_ctx *ctx) if (cp_1->hwid != cp_2->hwid) continue; - if (!kexec_cpu_check(cp_1, cp_2)) + if (!kexec_cpu_check(cp_1, cp_2) && + !kexec_ignore_compat_check) return -EINVAL; to_process--; @@ -506,7 +521,7 @@ int machine_kexec_prepare(struct kimage *image) result = kexec_compat_check(ctx); - if (result) + if (result && !kexec_ignore_compat_check) goto on_error; kexec_dtb_addr = dtb_seg->mem;