From: geoff@infradead.org (Geoff Levand)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 7/8] arm64/kexec: Add checks for KVM and EFI
Date: Fri, 14 Nov 2014 10:28:39 -0800 [thread overview]
Message-ID: <1415989719.15847.121.camel@smoke> (raw)
In-Reply-To: <546614D7.8080401@cogentembedded.com>
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 <geoff@infradead.org>
---
v2: Typo fixes.
arch/arm64/kernel/machine_kexec.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c
index 775bcc3..faeb4f1 100644
--- a/arch/arm64/kernel/machine_kexec.c
+++ b/arch/arm64/kernel/machine_kexec.c
@@ -16,6 +16,12 @@
#include <asm/cacheflush.h>
#include <asm/system_misc.h>
+/* TODO: Remove this include when KVM can support a kexec reboot. */
+#include <asm/virt.h>
+
+/* TODO: Remove this include when EFI can support a kexec reboot. */
+#include <linux/efi.h>
+
/* Global variables for the relocate_kernel routine. */
extern const unsigned char relocate_new_kernel[];
extern const unsigned long relocate_new_kernel_size;
@@ -101,6 +107,22 @@ 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;
}
--
1.9.1
next prev parent reply other threads:[~2014-11-14 18:28 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-14 1:22 [PATCH 0/8] arm64 kexec kernel patches V6 Geoff Levand
2014-11-14 1:22 ` [PATCH 2/8] arm64: Add new hcall HVC_CALL_FUNC Geoff Levand
2014-11-14 1:22 ` [PATCH 1/8] arm64: Convert hcalls to use ISS field Geoff Levand
2014-11-14 1:22 ` [PATCH 3/8] arm64: Add EL2 switch to soft_restart Geoff Levand
2014-11-14 1:22 ` [PATCH 6/8] arm64/kexec: Add pr_devel output Geoff Levand
2014-11-14 21:12 ` [PATCH v2 " Geoff Levand
2014-11-14 1:22 ` [PATCH 5/8] arm64/kexec: Add core kexec support Geoff Levand
2014-11-14 1:22 ` [PATCH 7/8] arm64/kexec: Add checks for KVM and EFI Geoff Levand
2014-11-14 14:42 ` Sergei Shtylyov
2014-11-14 18:28 ` Geoff Levand [this message]
2014-11-14 18:40 ` [PATCH v2 " Sergei Shtylyov
2014-11-14 21:08 ` [PATCH v3 " Geoff Levand
2014-11-14 1:22 ` [PATCH 8/8] arm64/kexec: Enable kexec in the arm64 defconfig Geoff Levand
2014-11-14 1:22 ` [PATCH 4/8] arm64: Move proc-macros.S to include/asm Geoff Levand
2014-11-27 6:19 ` [PATCH 0/8] arm64 kexec kernel patches V6 Dave Young
2014-11-28 6:56 ` Dave Young
2014-12-02 20:26 ` Geoff Levand
2014-12-02 20:22 ` Geoff Levand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1415989719.15847.121.camel@smoke \
--to=geoff@infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox