Blame SOURCES/kexec-tools-2.0.8-arm64-Add-support-for-kexec-lite-option.patch

a6d77e
From d665fa8c7cb6fa6713bad2633b9cccbad98245bc Mon Sep 17 00:00:00 2001
a6d77e
Message-Id: <d665fa8c7cb6fa6713bad2633b9cccbad98245bc.1431592766.git.panand@redhat.com>
a6d77e
In-Reply-To: <1fb6841aa15407dbf371589d7abca7bc2d35815c.1431592766.git.panand@redhat.com>
a6d77e
References: <1fb6841aa15407dbf371589d7abca7bc2d35815c.1431592766.git.panand@redhat.com>
a6d77e
From: Geoff Levand <geoff@infradead.org>
a6d77e
Date: Fri, 17 Apr 2015 10:54:55 -0700
a6d77e
Subject: [PATCH 04/17] arm64: Add support for kexec --lite option
a6d77e
a6d77e
WARNING: This implementation uses kernel feature not yet merged upstream.  In
a6d77e
the future I may convert this to use a minimal purgatory that is just a
a6d77e
trampoline.
a6d77e
---
a6d77e
 kexec/arch/arm64/include/arch/options.h | 2 +-
a6d77e
 kexec/arch/arm64/kexec-arm64.c          | 8 +++-----
a6d77e
 2 files changed, 4 insertions(+), 6 deletions(-)
a6d77e
a6d77e
diff --git a/kexec/arch/arm64/include/arch/options.h b/kexec/arch/arm64/include/arch/options.h
a6d77e
index 903b4a1fbd7f..afe3e9827ff3 100644
a6d77e
--- a/kexec/arch/arm64/include/arch/options.h
a6d77e
+++ b/kexec/arch/arm64/include/arch/options.h
a6d77e
@@ -29,7 +29,7 @@ static const char arm64_opts_usage[] __attribute__ ((unused)) =
a6d77e
 "     --command-line=STRING Set the kernel command line to STRING.\n"
a6d77e
 "     --dtb=FILE            Use FILE as the device tree blob.\n"
a6d77e
 "     --initrd=FILE         Use FILE as the kernel initial ramdisk.\n"
a6d77e
-"     --lite                Fast reboot, no memory integrity checks - currently NOT SUPPORTED.\n");
a6d77e
+"     --lite                Fast reboot, no memory integrity checks.\n"
a6d77e
 "     --port=ADDRESS        Purgatory output to port ADDRESS.\n"
a6d77e
 "     --ramdisk=FILE        Use FILE as the kernel initial ramdisk.\n"
a6d77e
 "     --reuse-cmdline       Use command line arg of primary kernel.\n";
a6d77e
diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
a6d77e
index 22d70244f8db..6398e55fe575 100644
a6d77e
--- a/kexec/arch/arm64/kexec-arm64.c
a6d77e
+++ b/kexec/arch/arm64/kexec-arm64.c
a6d77e
@@ -96,7 +96,6 @@ int arch_process_options(int argc, char **argv)
a6d77e
 			break;
a6d77e
 		case OPT_LITE:
a6d77e
 			arm64_opts.lite = 1;
a6d77e
-			fprintf(stderr, "kexec: --lite option currently NOT SUPPORTED.\n");
a6d77e
 			break;
a6d77e
 		case OPT_PORT:
a6d77e
 			arm64_opts.port = strtoull(optarg, NULL, 0);
a6d77e
@@ -702,10 +701,9 @@ int arm64_load_other_segments(struct kexec_info *info,
a6d77e
 		add_segment_phys_virt(info, initrd_buf, initrd_size,
a6d77e
 				initrd_base, initrd_size, 0);
a6d77e
 
a6d77e
-	if (arm64_opts.lite) {
a6d77e
-		fprintf(stderr, "kexec: --lite option currently NOT SUPPORTED.\n");
a6d77e
-		return -ENOSYS;
a6d77e
-	} else {
a6d77e
+	if (arm64_opts.lite)
a6d77e
+		info->entry = (void *)kernel_entry;
a6d77e
+	else {
a6d77e
 		result = build_elf_rel_info(purgatory, purgatory_size, &ehdr,
a6d77e
 			0);
a6d77e
 
a6d77e
-- 
a6d77e
2.1.0
a6d77e