From patchwork Sat Jan 17 00:23:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 5650981 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4AD799F3A0 for ; Sat, 17 Jan 2015 00:26:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 795E7203EB for ; Sat, 17 Jan 2015 00:26:38 +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 ACC4F203F1 for ; Sat, 17 Jan 2015 00:26:37 +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 1YCHBm-0000xk-Ca; Sat, 17 Jan 2015 00:24:30 +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 1YCHAu-0000bF-BG; Sat, 17 Jan 2015 00:23:36 +0000 Received: from geoff by merlin.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1YCHAs-0007mr-K4; Sat, 17 Jan 2015 00:23:34 +0000 Message-Id: In-Reply-To: References: From: Geoff Levand Patch-Date: Thu, 20 Nov 2014 13:18:14 -0800 Subject: [PATCH 7/8] arm64/kexec: Add checks for KVM To: Catalin Marinas , Will Deacon Date: Sat, 17 Jan 2015 00:23:34 +0000 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: , 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 kernel support. These checks should be removed when the KVM problems are resolved fixed. Signed-off-by: Geoff Levand --- arch/arm64/kernel/machine_kexec.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index 3d84759..a36459d 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -16,6 +16,9 @@ #include #include +/* TODO: Remove this include when KVM 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 +103,13 @@ 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; + } + return 0; }