a6d77e
From dd86e7cedfc0509df5dd7f824611d59cf7e9f007 Mon Sep 17 00:00:00 2001
a6d77e
Message-Id: <dd86e7cedfc0509df5dd7f824611d59cf7e9f007.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: AKASHI Takahiro <takahiro.akashi@linaro.org>
a6d77e
Date: Tue, 24 Feb 2015 16:46:35 +0900
a6d77e
Subject: [PATCH 09/17] arm64: kdump: append kdump-specific parameter to
a6d77e
 command line
a6d77e
a6d77e
---
a6d77e
 kexec/arch/arm64/kexec-arm64.c     | 9 +++++++--
a6d77e
 kexec/arch/arm64/kexec-arm64.h     | 2 +-
a6d77e
 kexec/arch/arm64/kexec-elf-arm64.c | 3 ++-
a6d77e
 3 files changed, 10 insertions(+), 4 deletions(-)
a6d77e
a6d77e
diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
a6d77e
index e83e83bdd6db..173631c66951 100644
a6d77e
--- a/kexec/arch/arm64/kexec-arm64.c
a6d77e
+++ b/kexec/arch/arm64/kexec-arm64.c
a6d77e
@@ -586,7 +586,7 @@ static uint64_t read_sink(const char *command_line)
a6d77e
  */
a6d77e
 
a6d77e
 int arm64_load_other_segments(struct kexec_info *info,
a6d77e
-	unsigned long kernel_entry)
a6d77e
+	unsigned long kernel_entry, char *option)
a6d77e
 {
a6d77e
 	int result;
a6d77e
 	struct mem_ehdr ehdr;
a6d77e
@@ -599,14 +599,19 @@ int arm64_load_other_segments(struct kexec_info *info,
a6d77e
 	struct dtb dtb_2 = {.name = "dtb_2"};
a6d77e
 	char command_line[COMMAND_LINE_SIZE] = "";
a6d77e
 
a6d77e
+	dbgprintf("%s:%d: add '%s' to command line\n", __func__, __LINE__,
a6d77e
+		option);
a6d77e
+
a6d77e
 	if (arm64_opts.command_line) {
a6d77e
 		strncpy(command_line, arm64_opts.command_line,
a6d77e
 			sizeof(command_line));
a6d77e
 		command_line[sizeof(command_line) - 1] = 0;
a6d77e
 	}
a6d77e
 
a6d77e
-	purgatory_sink = read_sink(command_line);
a6d77e
+	if (option && option[0])
a6d77e
+		strcat(command_line, option);
a6d77e
 
a6d77e
+	purgatory_sink = read_sink(command_line);
a6d77e
 	dbgprintf("%s:%d: purgatory sink: 0x%" PRIx64 "\n", __func__, __LINE__,
a6d77e
 		purgatory_sink);
a6d77e
 
a6d77e
diff --git a/kexec/arch/arm64/kexec-arm64.h b/kexec/arch/arm64/kexec-arm64.h
a6d77e
index 7f0ca13fec11..7e4d0568bd01 100644
a6d77e
--- a/kexec/arch/arm64/kexec-arm64.h
a6d77e
+++ b/kexec/arch/arm64/kexec-arm64.h
a6d77e
@@ -48,6 +48,6 @@ extern struct arm64_mem arm64_mem;
a6d77e
 
a6d77e
 int arm64_process_image_header(const struct arm64_image_header *h);
a6d77e
 int arm64_load_other_segments(struct kexec_info *info,
a6d77e
-	unsigned long kernel_entry);
a6d77e
+	unsigned long kernel_entry, char *option);
a6d77e
 
a6d77e
 #endif
a6d77e
diff --git a/kexec/arch/arm64/kexec-elf-arm64.c b/kexec/arch/arm64/kexec-elf-arm64.c
a6d77e
index 903602985eb4..f5ecda825278 100644
a6d77e
--- a/kexec/arch/arm64/kexec-elf-arm64.c
a6d77e
+++ b/kexec/arch/arm64/kexec-elf-arm64.c
a6d77e
@@ -123,7 +123,8 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
a6d77e
 	dbgprintf("%s: e_entry:     %016llx -> %016lx\n", __func__,
a6d77e
 		ehdr.e_entry, virt_to_phys(ehdr.e_entry));
a6d77e
 
a6d77e
-	result = arm64_load_other_segments(info, (unsigned long)info->entry);
a6d77e
+	result = arm64_load_other_segments(info, (unsigned long)info->entry,
a6d77e
+		header_option);
a6d77e
 exit:
a6d77e
 	free_elf_info(&ehdr);
a6d77e
 	if (header_option)
a6d77e
-- 
a6d77e
2.1.0
a6d77e