From mboxrd@z Thu Jan 1 00:00:00 1970 From: geoff@infradead.org (Geoff Levand) Date: Mon, 26 Jan 2015 12:58:25 -0800 Subject: [PATCH 7/8] arm64/kexec: Add checks for KVM In-Reply-To: References: <20150126191942.GQ23313@leverpostej> Message-ID: <1422305905.21823.12.camel@infradead.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Mon, 2015-01-26 at 21:39 +0100, Christoffer Dall wrote: > On Mon, Jan 26, 2015 at 8:19 PM, Mark Rutland wrote: > > On Sat, Jan 17, 2015 at 12:23:34AM +0000, Geoff Levand wrote: > >> 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; > >> + } > > > > If you really don't want to implement KVM teardown, surely this should > > be at the start of the series, so we don't have a point in the middle > > where things may explode in this case? > > > So this caters to support systems that don't support KVM (don't boot > in EL2) but is configured with both KVM and KEXEC? > > Why not just make the kexec config dependent on !KVM ? Sure, that would work. I put it this way so we can get build testing of kexec since the arm64 defconfig has KVM set. -Geoff