From patchwork Fri Nov 14 21:08:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 5309451 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 87F5A9F440 for ; Fri, 14 Nov 2014 21:10:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7FCAC20131 for ; Fri, 14 Nov 2014 21:10:42 +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 A64522012E for ; Fri, 14 Nov 2014 21:10:41 +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 1XpO70-0005Iy-Rj; Fri, 14 Nov 2014 21:08:58 +0000 Received: from 107-1-141-74-ip-static.hfc.comcastbusiness.net ([107.1.141.74] helo=[192.168.252.189]) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1XpO6v-00057M-3w; Fri, 14 Nov 2014 21:08:53 +0000 Message-ID: <1415999327.15847.123.camel@smoke> Subject: Re: [PATCH v3 7/8] arm64/kexec: Add checks for KVM and EFI From: Geoff Levand To: Catalin Marinas , Will Deacon Date: Fri, 14 Nov 2014 13:08:47 -0800 In-Reply-To: References: X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Cc: marc.zyngier@arm.com, Grant Likely , 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_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 runtime checks that fail the arm64 kexec syscall for situations that would result in system instability do to problems in the KVM and EFI kernel support. These checks should be removed when the KVM and EFI problems are fixed. Signed-off-by: Geoff Levand --- v2: Typo fixes. v3: Format fixes. arch/arm64/kernel/machine_kexec.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index 3d84759..e7f036e 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -16,6 +16,12 @@ #include #include +/* TODO: Remove this include when KVM can support a kexec reboot. */ +#include + +/* TODO: Remove this include when EFI can support a kexec reboot. */ +#include + /* Global variables for the relocate_kernel routine. */ extern const unsigned char relocate_new_kernel[]; extern const unsigned long relocate_new_kernel_size; @@ -100,6 +106,20 @@ int machine_kexec_prepare(struct kimage *image) kexec_image_info(image); + /* TODO: Remove this message when KVM can support a kexec reboot. */ + if (IS_ENABLED(CONFIG_KVM) && is_hyp_mode_available()) { + pr_err("%s: Your kernel is configured with KVM support (CONFIG_KVM=y) which currently does not allow for kexec re-boot.\n", + __func__); + return -ENOSYS; + } + + /* TODO: Remove this message when EFI can support a kexec reboot. */ + if (efi_enabled(EFI_BOOT)) { + pr_err("%s: Your kernel is using the Extensible Firmware Interface (EFI) which currently does not allow for kexec re-boot.\n", + __func__); + return -ENOSYS; + } + return 0; }