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

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