|
|
a6d77e |
From 249821e20306fbafff9094a4e02c82b189ea0676 Mon Sep 17 00:00:00 2001
|
|
|
a6d77e |
Message-Id: <249821e20306fbafff9094a4e02c82b189ea0676.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: Pratyush Anand <panand@redhat.com>
|
|
|
a6d77e |
Date: Tue, 21 Apr 2015 18:23:38 +0530
|
|
|
a6d77e |
Subject: [PATCH 14/17] arm64: kdump: Add support for binary image
|
|
|
a6d77e |
|
|
|
a6d77e |
This patch adds support to use binary image ie arch/arm64/boot/Image
|
|
|
a6d77e |
with kdump.
|
|
|
a6d77e |
|
|
|
a6d77e |
Signed-off-by: Pratyush Anand <panand@redhat.com>
|
|
|
a6d77e |
---
|
|
|
a6d77e |
kexec/arch/arm64/kexec-image-arm64.c | 24 ++++++++++++++++++------
|
|
|
a6d77e |
1 file changed, 18 insertions(+), 6 deletions(-)
|
|
|
a6d77e |
|
|
|
a6d77e |
diff --git a/kexec/arch/arm64/kexec-image-arm64.c b/kexec/arch/arm64/kexec-image-arm64.c
|
|
|
a6d77e |
index c577b96d5e31..6f8a6590639a 100644
|
|
|
a6d77e |
--- a/kexec/arch/arm64/kexec-image-arm64.c
|
|
|
a6d77e |
+++ b/kexec/arch/arm64/kexec-image-arm64.c
|
|
|
a6d77e |
@@ -10,6 +10,7 @@
|
|
|
a6d77e |
#include <libfdt.h>
|
|
|
a6d77e |
#include <stdlib.h>
|
|
|
a6d77e |
|
|
|
a6d77e |
+#include "crashdump-arm64.h"
|
|
|
a6d77e |
#include "dt-ops.h"
|
|
|
a6d77e |
#include "image-header.h"
|
|
|
a6d77e |
#include "kexec-arm64.h"
|
|
|
a6d77e |
@@ -97,13 +98,23 @@ int image_arm64_load(int argc, char **argv, const char *kernel_buf,
|
|
|
a6d77e |
|
|
|
a6d77e |
arm64_mem.page_offset = get_kernel_page_offset();
|
|
|
a6d77e |
|
|
|
a6d77e |
- result = parse_iomem_single("Kernel code\n", &start, NULL);
|
|
|
a6d77e |
+ if (info->kexec_flags & KEXEC_ON_CRASH) {
|
|
|
a6d77e |
+ result = load_crashdump_segments(info, &header_option);
|
|
|
a6d77e |
|
|
|
a6d77e |
- if (result) {
|
|
|
a6d77e |
- fprintf(stderr, "kexec: Could not get kernel code address.\n");
|
|
|
a6d77e |
- return -1;
|
|
|
a6d77e |
+ if (result) {
|
|
|
a6d77e |
+ fprintf(stderr, "kexec: load crashdump segments failed.\n");
|
|
|
a6d77e |
+ return -1;
|
|
|
a6d77e |
+ }
|
|
|
a6d77e |
+ start = crash_reserved_mem.start;
|
|
|
a6d77e |
+ } else {
|
|
|
a6d77e |
+ result = parse_iomem_single("Kernel code\n", &start, NULL);
|
|
|
a6d77e |
+
|
|
|
a6d77e |
+ if (result) {
|
|
|
a6d77e |
+ fprintf(stderr, "kexec: Could not get kernel code address.\n");
|
|
|
a6d77e |
+ return -1;
|
|
|
a6d77e |
+ }
|
|
|
a6d77e |
+ start -= arm64_mem.text_offset;
|
|
|
a6d77e |
}
|
|
|
a6d77e |
- start -= arm64_mem.text_offset;
|
|
|
a6d77e |
|
|
|
a6d77e |
/* Add kernel */
|
|
|
a6d77e |
add_segment_phys_virt(info, kernel_buf, kernel_size,
|
|
|
a6d77e |
@@ -112,7 +123,8 @@ int image_arm64_load(int argc, char **argv, const char *kernel_buf,
|
|
|
a6d77e |
|
|
|
a6d77e |
info->entry = (void *)start + arm64_mem.text_offset;
|
|
|
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 |
|
|
|
a6d77e |
if (header_option)
|
|
|
a6d77e |
free(header_option);
|
|
|
a6d77e |
--
|
|
|
a6d77e |
2.1.0
|
|
|
a6d77e |
|