Blob Blame History Raw
From d665fa8c7cb6fa6713bad2633b9cccbad98245bc Mon Sep 17 00:00:00 2001
Message-Id: <d665fa8c7cb6fa6713bad2633b9cccbad98245bc.1431592766.git.panand@redhat.com>
In-Reply-To: <1fb6841aa15407dbf371589d7abca7bc2d35815c.1431592766.git.panand@redhat.com>
References: <1fb6841aa15407dbf371589d7abca7bc2d35815c.1431592766.git.panand@redhat.com>
From: Geoff Levand <geoff@infradead.org>
Date: Fri, 17 Apr 2015 10:54:55 -0700
Subject: [PATCH 04/17] arm64: Add support for kexec --lite option

WARNING: This implementation uses kernel feature not yet merged upstream.  In
the future I may convert this to use a minimal purgatory that is just a
trampoline.
---
 kexec/arch/arm64/include/arch/options.h | 2 +-
 kexec/arch/arm64/kexec-arm64.c          | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/kexec/arch/arm64/include/arch/options.h b/kexec/arch/arm64/include/arch/options.h
index 903b4a1fbd7f..afe3e9827ff3 100644
--- a/kexec/arch/arm64/include/arch/options.h
+++ b/kexec/arch/arm64/include/arch/options.h
@@ -29,7 +29,7 @@ static const char arm64_opts_usage[] __attribute__ ((unused)) =
 "     --command-line=STRING Set the kernel command line to STRING.\n"
 "     --dtb=FILE            Use FILE as the device tree blob.\n"
 "     --initrd=FILE         Use FILE as the kernel initial ramdisk.\n"
-"     --lite                Fast reboot, no memory integrity checks - currently NOT SUPPORTED.\n");
+"     --lite                Fast reboot, no memory integrity checks.\n"
 "     --port=ADDRESS        Purgatory output to port ADDRESS.\n"
 "     --ramdisk=FILE        Use FILE as the kernel initial ramdisk.\n"
 "     --reuse-cmdline       Use command line arg of primary kernel.\n";
diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
index 22d70244f8db..6398e55fe575 100644
--- a/kexec/arch/arm64/kexec-arm64.c
+++ b/kexec/arch/arm64/kexec-arm64.c
@@ -96,7 +96,6 @@ int arch_process_options(int argc, char **argv)
 			break;
 		case OPT_LITE:
 			arm64_opts.lite = 1;
-			fprintf(stderr, "kexec: --lite option currently NOT SUPPORTED.\n");
 			break;
 		case OPT_PORT:
 			arm64_opts.port = strtoull(optarg, NULL, 0);
@@ -702,10 +701,9 @@ int arm64_load_other_segments(struct kexec_info *info,
 		add_segment_phys_virt(info, initrd_buf, initrd_size,
 				initrd_base, initrd_size, 0);
 
-	if (arm64_opts.lite) {
-		fprintf(stderr, "kexec: --lite option currently NOT SUPPORTED.\n");
-		return -ENOSYS;
-	} else {
+	if (arm64_opts.lite)
+		info->entry = (void *)kernel_entry;
+	else {
 		result = build_elf_rel_info(purgatory, purgatory_size, &ehdr,
 			0);
 
-- 
2.1.0