All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 00/10] (kexec-tools) arm64: add kdump support
@ 2017-05-17  5:51 AKASHI Takahiro
  2017-05-17  5:51 ` [PATCH v7 01/10] kexec: exntend the semantics of kexec_iomem_for_each_line AKASHI Takahiro
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: AKASHI Takahiro @ 2017-05-17  5:51 UTC (permalink / raw)
  To: horms; +Cc: geoff, panand, kexec, AKASHI Takahiro

My kernel patches of kdump support on arm64 were merged in v4.12-rc1.

This patchset is synced with them and provides necessary changes for
kexec-tools. It can be applied on top of kexec-tools master branch.

Patch #1 to #4 are preparatory patches for succeeding patches,
#5 to #9 are main part of kdump implementation for vmlinux support
and #10 is for Image support.

Changes for v7:
 - rebased on the latest master
 - fix incorrect return values on error (patch #4)
 - implement get_crash_kernel_load_range() (patch #5)
 - rename some variables/functions for better readability (patch #5/#9)
 - add/revise comments

Changes for v6:
 - use get_kernel_sym() from x86, not from arm (patch #2)
 - always take root node's "#address-cells" and "#size-cells" into account
   when adding "linux,usable-memory-range" and "linux,elfcorehdr"
   (patch #8)

Changes for v5:
 - remove "linux,crashkernel-base/size" handling aligned with a change
   on the kernel side

Changes for v4:
 - rebased on the master branch (including Geoff's v6)
 - revive "linux,usable-memory-range" DT property (from v2), dropping
   use of "reserved-memory" nodes introduced in v3 (patch #8)
 - extend the semantics of kexec_iomem_for_each_line() per Pratyush
   (patch #1)

Changes for v3:
 - rebased on Geoff's v5
 - fix a value of estimated PHYS_OFFSET
 - add a kernel code/data segment because they now reside out of linear
   mapping due to KASLR introduction
 - remove "linux,usable-memory-range" dependency, instead using
   "reserved-memory" node
 - add -mem-min/-mem-max support

Changes for v2:
 - trim a temoprary buffer in setup_2nd_dtb()
 - add patch#6("kexec: generalize and rename get_kernel_stext_sym()")
 - update patch#7 from Pratyush
   (re-worked by akashi)

AKASHI Takahiro (8):
  kexec: exntend the semantics of kexec_iomem_for_each_line
  arm64: identify PHYS_OFFSET correctly
  arm64: change return values on error to negative
  arm64: kdump: identify memory regions
  arm64: kdump: add elf core header segment
  arm64: kdump: set up kernel image segment
  arm64: kdump: set up other segments
  arm64: kdump: add DT properties to crash dump kernel's dtb

Pratyush Anand (2):
  kexec: generalize and rename get_kernel_stext_sym()
  arm64: kdump: Add support for binary image files

 kexec/Makefile                       |   1 +
 kexec/arch/arm/crashdump-arm.c       |  40 +-----
 kexec/arch/arm64/Makefile            |   3 +
 kexec/arch/arm64/crashdump-arm64.c   | 229 +++++++++++++++++++++++++++++-
 kexec/arch/arm64/crashdump-arm64.h   |  18 ++-
 kexec/arch/arm64/iomem.h             |  10 ++
 kexec/arch/arm64/kexec-arm64.c       | 263 +++++++++++++++++++++++++++++++----
 kexec/arch/arm64/kexec-elf-arm64.c   |  31 +++--
 kexec/arch/arm64/kexec-image-arm64.c |  17 ++-
 kexec/arch/i386/crashdump-x86.c      |  29 ----
 kexec/kexec-iomem.c                  |  15 +-
 kexec/kexec.h                        |   2 +
 kexec/symbols.c                      |  34 +++++
 13 files changed, 579 insertions(+), 113 deletions(-)
 create mode 100644 kexec/arch/arm64/iomem.h
 create mode 100644 kexec/symbols.c

-- 
2.11.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v7 01/10] kexec: exntend the semantics of kexec_iomem_for_each_line
  2017-05-17  5:51 [PATCH v7 00/10] (kexec-tools) arm64: add kdump support AKASHI Takahiro
@ 2017-05-17  5:51 ` AKASHI Takahiro
  2017-05-17 23:37   ` David Woodhouse
  2017-05-17  5:51 ` [PATCH v7 02/10] kexec: generalize and rename get_kernel_stext_sym() AKASHI Takahiro
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 15+ messages in thread
From: AKASHI Takahiro @ 2017-05-17  5:51 UTC (permalink / raw)
  To: horms; +Cc: geoff, panand, kexec, AKASHI Takahiro

The current kexec_iomem_for_each_line() counts up all the lines for which
a callback function returns zero(0) or positive, and otherwise it stops
further scanning.
This behavior is incovenient in some cases. For instance, on arm64, we want
to count up "System RAM" entries, but need to skip "reserved" entries.

So this patch extends the semantics so that we will continue to scan
succeeding entries but not count lines for which a callback function
returns positive.

The current users of kexec_iomem_for_each_line(), arm, sh and x86, will not
be affected by this change because
* arm
  The callback function only returns -1 or 0, and the return value of
  kexec_iomem_for_each_line() will never be used.
* sh, x86
  The callback function may return (-1 for sh,) 0 or 1, but always returns
  1 once we have reached the maximum number of entries allowed.
  Even so the current kexec_iomem_for_each_line() counts them up.
  This change actually fixes this bug.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 kexec/kexec-iomem.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/kexec/kexec-iomem.c b/kexec/kexec-iomem.c
index 7ec3853..b5b52b1 100644
--- a/kexec/kexec-iomem.c
+++ b/kexec/kexec-iomem.c
@@ -18,6 +18,9 @@
  * Iterate over each line in the file returned by proc_iomem(). If match is
  * NULL or if the line matches with our match-pattern then call the
  * callback if non-NULL.
+ * If match is NULL, callback should return a negative if error.
+ * Otherwise the interation goes on, incrementing nr but only if callback
+ * returns 0 (matched).
  *
  * Return the number of lines matched.
  */
@@ -37,7 +40,7 @@ int kexec_iomem_for_each_line(char *match,
 	char *str;
 	int consumed;
 	int count;
-	int nr = 0;
+	int nr = 0, ret;
 
 	fp = fopen(iomem, "r");
 	if (!fp)
@@ -50,11 +53,13 @@ int kexec_iomem_for_each_line(char *match,
 		str = line + consumed;
 		size = end - start + 1;
 		if (!match || memcmp(str, match, strlen(match)) == 0) {
-			if (callback
-			    && callback(data, nr, str, start, size) < 0) {
-				break;
+			if (callback) {
+				ret = callback(data, nr, str, start, size);
+				if (ret < 0)
+					break;
+				else if (ret == 0)
+					nr++;
 			}
-			nr++;
 		}
 	}
 
-- 
2.11.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v7 02/10] kexec: generalize and rename get_kernel_stext_sym()
  2017-05-17  5:51 [PATCH v7 00/10] (kexec-tools) arm64: add kdump support AKASHI Takahiro
  2017-05-17  5:51 ` [PATCH v7 01/10] kexec: exntend the semantics of kexec_iomem_for_each_line AKASHI Takahiro
@ 2017-05-17  5:51 ` AKASHI Takahiro
  2017-05-17  5:51 ` [PATCH v7 03/10] arm64: identify PHYS_OFFSET correctly AKASHI Takahiro
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: AKASHI Takahiro @ 2017-05-17  5:51 UTC (permalink / raw)
  To: horms; +Cc: geoff, panand, kexec, AKASHI Takahiro

From: Pratyush Anand <panand@redhat.com>

get_kernel_stext_sym() has been defined for both arm and i386. Other
architecture might need some other kernel symbol address. Therefore rewrite
this function as generic function to get any kernel symbol address.

More over, kallsyms is not arch specific representation, therefore have
common function for all arches.

Signed-off-by: Pratyush Anand <panand@redhat.com>
[created symbols.c]
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 kexec/Makefile                  |  1 +
 kexec/arch/arm/crashdump-arm.c  | 40 +---------------------------------------
 kexec/arch/i386/crashdump-x86.c | 29 -----------------------------
 kexec/kexec.h                   |  2 ++
 kexec/symbols.c                 | 34 ++++++++++++++++++++++++++++++++++
 5 files changed, 38 insertions(+), 68 deletions(-)
 create mode 100644 kexec/symbols.c

diff --git a/kexec/Makefile b/kexec/Makefile
index 39f365f..2b4fb3d 100644
--- a/kexec/Makefile
+++ b/kexec/Makefile
@@ -26,6 +26,7 @@ KEXEC_SRCS_base += kexec/kernel_version.c
 KEXEC_SRCS_base += kexec/lzma.c
 KEXEC_SRCS_base += kexec/zlib.c
 KEXEC_SRCS_base += kexec/kexec-xen.c
+KEXEC_SRCS_base += kexec/symbols.c
 
 KEXEC_GENERATED_SRCS += $(PURGATORY_HEX_C)
 
diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
index ac76e0a..daa4788 100644
--- a/kexec/arch/arm/crashdump-arm.c
+++ b/kexec/arch/arm/crashdump-arm.c
@@ -73,48 +73,10 @@ static struct crash_elf_info elf_info = {
 
 extern unsigned long long user_page_offset;
 
-/* Retrieve kernel _stext symbol virtual address from /proc/kallsyms */
-static unsigned long long get_kernel_stext_sym(void)
-{
-	const char *kallsyms = "/proc/kallsyms";
-	const char *stext = "_stext";
-	char sym[128];
-	char line[128];
-	FILE *fp;
-	unsigned long long vaddr = 0;
-	char type;
-
-	fp = fopen(kallsyms, "r");
-	if (!fp) {
-		fprintf(stderr, "Cannot open %s\n", kallsyms);
-		return 0;
-	}
-
-	while(fgets(line, sizeof(line), fp) != NULL) {
-		unsigned long long addr;
-
-		if (sscanf(line, "%Lx %c %s", &addr, &type, sym) != 3)
-			continue;
-
-		if (strcmp(sym, stext) == 0) {
-			dbgprintf("kernel symbol %s vaddr = %#llx\n", stext, addr);
-			vaddr = addr;
-			break;
-		}
-	}
-
-	fclose(fp);
-
-	if (vaddr == 0)
-		fprintf(stderr, "Cannot get kernel %s symbol address\n", stext);
-
-	return vaddr;
-}
-
 static int get_kernel_page_offset(struct kexec_info *info,
 		struct crash_elf_info *elf_info)
 {
-	unsigned long long stext_sym_addr = get_kernel_stext_sym();
+	unsigned long long stext_sym_addr = get_kernel_sym("_stext");
 	if (stext_sym_addr == 0) {
 		if (user_page_offset != (-1ULL)) {
 			elf_info->page_offset = user_page_offset;
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index 285dea9..69a063a 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -102,35 +102,6 @@ static int get_kernel_paddr(struct kexec_info *UNUSED(info),
 	return -1;
 }
 
-/* Retrieve kernel symbol virtual address from /proc/kallsyms */
-static unsigned long long get_kernel_sym(const char *symbol)
-{
-	const char *kallsyms = "/proc/kallsyms";
-	char sym[128];
-	char line[128];
-	FILE *fp;
-	unsigned long long vaddr;
-	char type;
-
-	fp = fopen(kallsyms, "r");
-	if (!fp) {
-		fprintf(stderr, "Cannot open %s\n", kallsyms);
-		return 0;
-	}
-
-	while(fgets(line, sizeof(line), fp) != NULL) {
-		if (sscanf(line, "%llx %c %s", &vaddr, &type, sym) != 3)
-			continue;
-		if (strcmp(sym, symbol) == 0) {
-			dbgprintf("kernel symbol %s vaddr = %16llx\n", symbol, vaddr);
-			return vaddr;
-		}
-	}
-
-	dbgprintf("Cannot get kernel %s symbol address\n", symbol);
-	return 0;
-}
-
 /* Retrieve info regarding virtual address kernel has been compiled for and
  * size of the kernel from /proc/kcore. Current /proc/kcore parsing from
  * from kexec-tools fails because of malformed elf notes. A kernel patch has
diff --git a/kexec/kexec.h b/kexec/kexec.h
index 52bef9b..26225d2 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -317,4 +317,6 @@ int xen_kexec_unload(uint64_t kexec_flags);
 void xen_kexec_exec(void);
 int xen_kexec_status(uint64_t kexec_flags);
 
+extern unsigned long long get_kernel_sym(const char *text);
+
 #endif /* KEXEC_H */
diff --git a/kexec/symbols.c b/kexec/symbols.c
new file mode 100644
index 0000000..e88f7f3
--- /dev/null
+++ b/kexec/symbols.c
@@ -0,0 +1,34 @@
+#include <stdio.h>
+#include <string.h>
+#include "kexec.h"
+
+/* Retrieve kernel symbol virtual address from /proc/kallsyms */
+unsigned long long get_kernel_sym(const char *symbol)
+{
+	const char *kallsyms = "/proc/kallsyms";
+	char sym[128];
+	char line[128];
+	FILE *fp;
+	unsigned long long vaddr;
+	char type;
+
+	fp = fopen(kallsyms, "r");
+	if (!fp) {
+		fprintf(stderr, "Cannot open %s\n", kallsyms);
+		return 0;
+	}
+
+	while (fgets(line, sizeof(line), fp) != NULL) {
+		if (sscanf(line, "%llx %c %s", &vaddr, &type, sym) != 3)
+			continue;
+		if (strcmp(sym, symbol) == 0) {
+			dbgprintf("kernel symbol %s vaddr = %16llx\n",
+					symbol, vaddr);
+			return vaddr;
+		}
+	}
+
+	dbgprintf("Cannot get kernel %s symbol address\n", symbol);
+
+	return 0;
+}
-- 
2.11.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v7 03/10] arm64: identify PHYS_OFFSET correctly
  2017-05-17  5:51 [PATCH v7 00/10] (kexec-tools) arm64: add kdump support AKASHI Takahiro
  2017-05-17  5:51 ` [PATCH v7 01/10] kexec: exntend the semantics of kexec_iomem_for_each_line AKASHI Takahiro
  2017-05-17  5:51 ` [PATCH v7 02/10] kexec: generalize and rename get_kernel_stext_sym() AKASHI Takahiro
@ 2017-05-17  5:51 ` AKASHI Takahiro
  2017-05-17  5:51 ` [PATCH v7 04/10] arm64: change return values on error to negative AKASHI Takahiro
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: AKASHI Takahiro @ 2017-05-17  5:51 UTC (permalink / raw)
  To: horms; +Cc: geoff, panand, kexec, AKASHI Takahiro

Due to the kernel patch, commit e7cd190385d1 ("arm64: mark reserved
memblock regions explicitly in iomem"), the current code will not be able
to identify the correct value of PHYS_OFFSET if some "reserved" memory
region, which is likely to be UEFI runtime services code/data, exists at
an address below the first "System RAM" regions.

This patch fixes this issue.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 kexec/arch/arm64/Makefile      |  1 +
 kexec/arch/arm64/iomem.h       |  7 +++++++
 kexec/arch/arm64/kexec-arm64.c | 12 ++++++++++--
 3 files changed, 18 insertions(+), 2 deletions(-)
 create mode 100644 kexec/arch/arm64/iomem.h

diff --git a/kexec/arch/arm64/Makefile b/kexec/arch/arm64/Makefile
index a931f0e..91f6388 100644
--- a/kexec/arch/arm64/Makefile
+++ b/kexec/arch/arm64/Makefile
@@ -26,6 +26,7 @@ dist += $(arm64_KEXEC_SRCS) \
 	kexec/arch/arm64/include/arch/options.h \
 	kexec/arch/arm64/crashdump-arm64.h \
 	kexec/arch/arm64/image-header.h \
+	kexec/arch/arm64/iomem.h \
 	kexec/arch/arm64/kexec-arm64.h \
 	kexec/arch/arm64/Makefile
 
diff --git a/kexec/arch/arm64/iomem.h b/kexec/arch/arm64/iomem.h
new file mode 100644
index 0000000..7fd66eb
--- /dev/null
+++ b/kexec/arch/arm64/iomem.h
@@ -0,0 +1,7 @@
+#ifndef IOMEM_H
+#define IOMEM_H
+
+#define SYSTEM_RAM		"System RAM\n"
+#define IOMEM_RESERVED		"reserved\n"
+
+#endif
diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
index c822939..7024f74 100644
--- a/kexec/arch/arm64/kexec-arm64.c
+++ b/kexec/arch/arm64/kexec-arm64.c
@@ -21,6 +21,7 @@
 #include "crashdump-arm64.h"
 #include "dt-ops.h"
 #include "fs2dt.h"
+#include "iomem.h"
 #include "kexec-syscall.h"
 #include "arch/options.h"
 
@@ -477,7 +478,14 @@ static int get_memory_ranges_iomem_cb(void *data, int nr, char *str,
 		return -1;
 
 	r = (struct memory_range *)data + nr;
-	r->type = RANGE_RAM;
+
+	if (!strncmp(str, SYSTEM_RAM, strlen(SYSTEM_RAM)))
+		r->type = RANGE_RAM;
+	else if (!strncmp(str, IOMEM_RESERVED, strlen(IOMEM_RESERVED)))
+		r->type = RANGE_RESERVED;
+	else
+		return 1;
+
 	r->start = base;
 	r->end = base + length - 1;
 
@@ -496,7 +504,7 @@ static int get_memory_ranges_iomem_cb(void *data, int nr, char *str,
 static int get_memory_ranges_iomem(struct memory_range *array,
 	unsigned int *count)
 {
-	*count = kexec_iomem_for_each_line("System RAM\n",
+	*count = kexec_iomem_for_each_line(NULL,
 		get_memory_ranges_iomem_cb, array);
 
 	if (!*count) {
-- 
2.11.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v7 04/10] arm64: change return values on error to negative
  2017-05-17  5:51 [PATCH v7 00/10] (kexec-tools) arm64: add kdump support AKASHI Takahiro
                   ` (2 preceding siblings ...)
  2017-05-17  5:51 ` [PATCH v7 03/10] arm64: identify PHYS_OFFSET correctly AKASHI Takahiro
@ 2017-05-17  5:51 ` AKASHI Takahiro
  2017-05-17  5:51 ` [PATCH v7 05/10] arm64: kdump: identify memory regions AKASHI Takahiro
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: AKASHI Takahiro @ 2017-05-17  5:51 UTC (permalink / raw)
  To: horms; +Cc: geoff, panand, kexec, AKASHI Takahiro

EFAILED is defined "-1" and so we don't need to negate it as a return value.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 kexec/arch/arm64/kexec-arm64.c       | 24 ++++++++++++------------
 kexec/arch/arm64/kexec-elf-arm64.c   |  6 +++---
 kexec/arch/arm64/kexec-image-arm64.c |  4 ++--
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
index 7024f74..153c96f 100644
--- a/kexec/arch/arm64/kexec-arm64.c
+++ b/kexec/arch/arm64/kexec-arm64.c
@@ -79,7 +79,7 @@ int arm64_process_image_header(const struct arm64_image_header *h)
 #endif
 
 	if (!arm64_header_check_magic(h))
-		return -EFAILED;
+		return EFAILED;
 
 	if (h->image_size) {
 		arm64_mem.text_offset = arm64_header_text_offset(h);
@@ -202,7 +202,7 @@ static int set_bootargs(struct dtb *dtb, const char *command_line)
 	if (result) {
 		fprintf(stderr,
 			"kexec: Set device tree bootargs failed.\n");
-		return -EFAILED;
+		return EFAILED;
 	}
 
 	return 0;
@@ -222,7 +222,7 @@ static int read_proc_dtb(struct dtb *dtb)
 
 	if (result) {
 		dbgprintf("%s: %s\n", __func__, strerror(errno));
-		return -EFAILED;
+		return EFAILED;
 	}
 
 	dtb->path = path;
@@ -245,7 +245,7 @@ static int read_sys_dtb(struct dtb *dtb)
 
 	if (result) {
 		dbgprintf("%s: %s\n", __func__, strerror(errno));
-		return -EFAILED;
+		return EFAILED;
 	}
 
 	dtb->path = path;
@@ -275,7 +275,7 @@ static int read_1st_dtb(struct dtb *dtb)
 		goto on_success;
 
 	dbgprintf("%s: not found\n", __func__);
-	return -EFAILED;
+	return EFAILED;
 
 on_success:
 	dbgprintf("%s: found %s\n", __func__, dtb->path);
@@ -294,7 +294,7 @@ static int setup_2nd_dtb(struct dtb *dtb, char *command_line)
 
 	if (result) {
 		fprintf(stderr, "kexec: Invalid 2nd device tree.\n");
-		return -EFAILED;
+		return EFAILED;
 	}
 
 	result = set_bootargs(dtb, command_line);
@@ -349,14 +349,14 @@ int arm64_load_other_segments(struct kexec_info *info,
 		if (result) {
 			fprintf(stderr,
 				"kexec: Error: No device tree available.\n");
-			return -EFAILED;
+			return EFAILED;
 		}
 	}
 
 	result = setup_2nd_dtb(&dtb, command_line);
 
 	if (result)
-		return -EFAILED;
+		return EFAILED;
 
 	/* Put the other segments after the image. */
 
@@ -384,7 +384,7 @@ int arm64_load_other_segments(struct kexec_info *info,
 
 			if (_ALIGN_UP(initrd_end, GiB(1)) - _ALIGN_DOWN(image_base, GiB(1)) > GiB(32)) {
 				fprintf(stderr, "kexec: Error: image + initrd too big.\n");
-				return -EFAILED;
+				return EFAILED;
 			}
 
 			dbgprintf("initrd: base %lx, size %lxh (%ld)\n",
@@ -395,7 +395,7 @@ int arm64_load_other_segments(struct kexec_info *info,
 				initrd_base + initrd_size);
 
 			if (result)
-				return -EFAILED;
+				return EFAILED;
 		}
 	}
 
@@ -403,7 +403,7 @@ int arm64_load_other_segments(struct kexec_info *info,
 
 	if (dtb.size > MiB(2)) {
 		fprintf(stderr, "kexec: Error: dtb too big.\n");
-		return -EFAILED;
+		return EFAILED;
 	}
 
 	dtb_base = add_buffer_phys_virt(info, dtb.buf, dtb.size, dtb.size,
@@ -509,7 +509,7 @@ static int get_memory_ranges_iomem(struct memory_range *array,
 
 	if (!*count) {
 		dbgprintf("%s: failed: No RAM found.\n", __func__);
-		return -EFAILED;
+		return EFAILED;
 	}
 
 	return 0;
diff --git a/kexec/arch/arm64/kexec-elf-arm64.c b/kexec/arch/arm64/kexec-elf-arm64.c
index daf8bf0..2b6c127 100644
--- a/kexec/arch/arm64/kexec-elf-arm64.c
+++ b/kexec/arch/arm64/kexec-elf-arm64.c
@@ -48,7 +48,7 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
 
 	if (info->kexec_flags & KEXEC_ON_CRASH) {
 		fprintf(stderr, "kexec: kdump not yet supported on arm64\n");
-		return -EFAILED;
+		return EFAILED;
 	}
 
 	result = build_elf_exec_info(kernel_buf, kernel_size, &ehdr, 0);
@@ -92,7 +92,7 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
 
 	if (i == ehdr.e_phnum) {
 		dbgprintf("%s: Valid arm64 header not found\n", __func__);
-		result = -EFAILED;
+		result = EFAILED;
 		goto exit;
 	}
 
@@ -100,7 +100,7 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
 
 	if (kernel_segment == ULONG_MAX) {
 		dbgprintf("%s: Kernel segment is not allocated\n", __func__);
-		result = -EFAILED;
+		result = EFAILED;
 		goto exit;
 	}
 
diff --git a/kexec/arch/arm64/kexec-image-arm64.c b/kexec/arch/arm64/kexec-image-arm64.c
index 960ed96..e5f2a9b 100644
--- a/kexec/arch/arm64/kexec-image-arm64.c
+++ b/kexec/arch/arm64/kexec-image-arm64.c
@@ -36,13 +36,13 @@ int image_arm64_load(int argc, char **argv, const char *kernel_buf,
 	header = (const struct arm64_image_header *)(kernel_buf);
 
 	if (arm64_process_image_header(header))
-		return -1;
+		return EFAILED;
 
         kernel_segment = arm64_locate_kernel_segment(info);
 
         if (kernel_segment == ULONG_MAX) {
                 dbgprintf("%s: Kernel segment is not allocated\n", __func__);
-                result = -EFAILED;
+		result = EFAILED;
                 goto exit;
         }
 
-- 
2.11.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v7 05/10] arm64: kdump: identify memory regions
  2017-05-17  5:51 [PATCH v7 00/10] (kexec-tools) arm64: add kdump support AKASHI Takahiro
                   ` (3 preceding siblings ...)
  2017-05-17  5:51 ` [PATCH v7 04/10] arm64: change return values on error to negative AKASHI Takahiro
@ 2017-05-17  5:51 ` AKASHI Takahiro
  2017-05-17  5:51 ` [PATCH v7 06/10] arm64: kdump: add elf core header segment AKASHI Takahiro
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: AKASHI Takahiro @ 2017-05-17  5:51 UTC (permalink / raw)
  To: horms; +Cc: geoff, panand, kexec, AKASHI Takahiro

The following regions need to be identified for later use:
 a) memory regions which belong to the 1st kernel
 b) usable memory reserved for crash dump kernel

We go through /proc/iomem to find out a) and b) which are marked
as "System RAM" and "Crash kernel", respectively.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 kexec/arch/arm64/Makefile          |   2 +
 kexec/arch/arm64/crashdump-arm64.c | 109 +++++++++++++++++++++++++++++++++++--
 kexec/arch/arm64/crashdump-arm64.h |  14 ++++-
 kexec/arch/arm64/iomem.h           |   1 +
 4 files changed, 120 insertions(+), 6 deletions(-)

diff --git a/kexec/arch/arm64/Makefile b/kexec/arch/arm64/Makefile
index 91f6388..9d9111c 100644
--- a/kexec/arch/arm64/Makefile
+++ b/kexec/arch/arm64/Makefile
@@ -6,6 +6,8 @@ arm64_FS2DT_INCLUDE += \
 
 arm64_DT_OPS += kexec/dt-ops.c
 
+arm64_MEM_REGIONS = kexec/mem_regions.c
+
 arm64_CPPFLAGS += -I $(srcdir)/kexec/
 
 arm64_KEXEC_SRCS += \
diff --git a/kexec/arch/arm64/crashdump-arm64.c b/kexec/arch/arm64/crashdump-arm64.c
index b0e4713..9267c9a 100644
--- a/kexec/arch/arm64/crashdump-arm64.c
+++ b/kexec/arch/arm64/crashdump-arm64.c
@@ -1,5 +1,13 @@
 /*
  * ARM64 crashdump.
+ *     partly derived from arm implementation
+ *
+ * Copyright (c) 2014-2017 Linaro Limited
+ * Author: AKASHI Takahiro <takahiro.akashi@linaro.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 
 #define _GNU_SOURCE
@@ -10,18 +18,111 @@
 #include "kexec.h"
 #include "crashdump.h"
 #include "crashdump-arm64.h"
+#include "iomem.h"
 #include "kexec-arm64.h"
 #include "kexec-elf.h"
+#include "mem_regions.h"
 
-struct memory_ranges usablemem_rgns = {};
+/* memory ranges on crashed kernel */
+static struct memory_range system_memory_ranges[CRASH_MAX_MEMORY_RANGES];
+static struct memory_ranges system_memory_rgns = {
+	.size = 0,
+	.max_size = CRASH_MAX_MEMORY_RANGES,
+	.ranges = system_memory_ranges,
+};
 
-int is_crashkernel_mem_reserved(void)
+/* memory range reserved for crashkernel */
+struct memory_range crash_reserved_mem;
+struct memory_ranges usablemem_rgns = {
+	.size = 0,
+	.max_size = 1,
+	.ranges = &crash_reserved_mem,
+};
+
+/*
+ * iomem_range_callback() - callback called for each iomem region
+ * @data: not used
+ * @nr: not used
+ * @str: name of the memory region
+ * @base: start address of the memory region
+ * @length: size of the memory region
+ *
+ * This function is called once for each memory region found in /proc/iomem.
+ * It locates system RAM and crashkernel reserved memory and places these to
+ * variables, respectively, system_memory_ranges and crash_reserved_mem.
+ */
+
+static int iomem_range_callback(void *UNUSED(data), int UNUSED(nr),
+				char *str, unsigned long long base,
+				unsigned long long length)
 {
+	if (strncmp(str, CRASH_KERNEL, strlen(CRASH_KERNEL)) == 0)
+		return mem_regions_add(&usablemem_rgns,
+				       base, length, RANGE_RAM);
+	else if (strncmp(str, SYSTEM_RAM, strlen(SYSTEM_RAM)) == 0)
+		return mem_regions_add(&system_memory_rgns,
+				       base, length, RANGE_RAM);
+
 	return 0;
 }
 
+int is_crashkernel_mem_reserved(void)
+{
+	if (!usablemem_rgns.size)
+		kexec_iomem_for_each_line(NULL, iomem_range_callback, NULL);
+
+	return crash_reserved_mem.start != crash_reserved_mem.end;
+}
+
+/*
+ * crash_get_memory_ranges() - read system physical memory
+ *
+ * Function reads through system physical memory and stores found memory
+ * regions in system_memory_ranges.
+ * Regions are sorted in ascending order.
+ *
+ * Returns 0 in case of success and a negative value otherwise.
+ */
+static int crash_get_memory_ranges(void)
+{
+	/*
+	 * First read all memory regions that can be considered as
+	 * system memory including the crash area.
+	 */
+	if (!usablemem_rgns.size)
+		kexec_iomem_for_each_line(NULL, iomem_range_callback, NULL);
+
+	/* allow only a single region for crash dump kernel */
+	if (usablemem_rgns.size != 1)
+		return -EINVAL;
+
+	dbgprint_mem_range("Reserved memory range", &crash_reserved_mem, 1);
+
+	if (mem_regions_exclude(&system_memory_rgns, &crash_reserved_mem)) {
+		fprintf(stderr,
+			"Error: Number of crash memory ranges excedeed the max limit\n");
+		return -ENOMEM;
+	}
+
+	/*
+	 * Make sure that the memory regions are sorted.
+	 */
+	mem_regions_sort(&system_memory_rgns);
+
+	dbgprint_mem_range("Coredump memory ranges",
+			   system_memory_rgns.ranges, system_memory_rgns.size);
+}
+
 int get_crash_kernel_load_range(uint64_t *start, uint64_t *end)
 {
-	/* Crash kernel region size is not exposed by the system */
-	return -1;
+	if (!usablemem_rgns.size)
+		kexec_iomem_for_each_line(NULL, iomem_range_callback, NULL);
+
+	if (!crash_reserved_mem.end)
+		return -1;
+
+	*start = crash_reserved_mem.start;
+	*end = crash_reserved_mem.end;
+
+	return 0;
 }
diff --git a/kexec/arch/arm64/crashdump-arm64.h b/kexec/arch/arm64/crashdump-arm64.h
index f33c7a2..ce9881e 100644
--- a/kexec/arch/arm64/crashdump-arm64.h
+++ b/kexec/arch/arm64/crashdump-arm64.h
@@ -1,12 +1,22 @@
 /*
  * ARM64 crashdump.
+ *
+ * Copyright (c) 2014-2017 Linaro Limited
+ * Author: AKASHI Takahiro <takahiro.akashi@linaro.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 
-#if !defined(CRASHDUMP_ARM64_H)
+#ifndef CRASHDUMP_ARM64_H
 #define CRASHDUMP_ARM64_H
 
 #include "kexec.h"
 
+#define CRASH_MAX_MEMORY_RANGES	32
+
 extern struct memory_ranges usablemem_rgns;
+extern struct memory_range crash_reserved_mem;
 
-#endif
+#endif /* CRASHDUMP_ARM64_H */
diff --git a/kexec/arch/arm64/iomem.h b/kexec/arch/arm64/iomem.h
index 7fd66eb..20cda87 100644
--- a/kexec/arch/arm64/iomem.h
+++ b/kexec/arch/arm64/iomem.h
@@ -2,6 +2,7 @@
 #define IOMEM_H
 
 #define SYSTEM_RAM		"System RAM\n"
+#define CRASH_KERNEL		"Crash kernel\n"
 #define IOMEM_RESERVED		"reserved\n"
 
 #endif
-- 
2.11.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v7 06/10] arm64: kdump: add elf core header segment
  2017-05-17  5:51 [PATCH v7 00/10] (kexec-tools) arm64: add kdump support AKASHI Takahiro
                   ` (4 preceding siblings ...)
  2017-05-17  5:51 ` [PATCH v7 05/10] arm64: kdump: identify memory regions AKASHI Takahiro
@ 2017-05-17  5:51 ` AKASHI Takahiro
  2017-05-17  5:51 ` [PATCH v7 07/10] arm64: kdump: set up kernel image segment AKASHI Takahiro
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: AKASHI Takahiro @ 2017-05-17  5:51 UTC (permalink / raw)
  To: horms; +Cc: geoff, panand, kexec, AKASHI Takahiro

Elf core header contains the information necessary for the coredump of
the 1st kernel, including its physcal memory layout as well as cpu register
states at the panic.
The segment is allocated inside the reserved memory of crash dump kernel.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 kexec/arch/arm64/crashdump-arm64.c | 98 ++++++++++++++++++++++++++++++++++++++
 kexec/arch/arm64/crashdump-arm64.h |  3 ++
 kexec/arch/arm64/iomem.h           |  2 +
 kexec/arch/arm64/kexec-elf-arm64.c | 11 +++++
 4 files changed, 114 insertions(+)

diff --git a/kexec/arch/arm64/crashdump-arm64.c b/kexec/arch/arm64/crashdump-arm64.c
index 9267c9a..d142435 100644
--- a/kexec/arch/arm64/crashdump-arm64.c
+++ b/kexec/arch/arm64/crashdump-arm64.c
@@ -39,6 +39,39 @@ struct memory_ranges usablemem_rgns = {
 	.ranges = &crash_reserved_mem,
 };
 
+struct memory_range elfcorehdr_mem;
+
+static struct crash_elf_info elf_info = {
+	.class		= ELFCLASS64,
+#if (__BYTE_ORDER == __LITTLE_ENDIAN)
+	.data		= ELFDATA2LSB,
+#else
+	.data		= ELFDATA2MSB,
+#endif
+	.machine	= EM_AARCH64,
+};
+
+/*
+ * Note: The returned value is correct only if !CONFIG_RANDOMIZE_BASE.
+ */
+static uint64_t get_kernel_page_offset(void)
+{
+	int i;
+
+	if (elf_info.kern_vaddr_start == UINT64_MAX)
+		return UINT64_MAX;
+
+	/* Current max virtual memory range is 48-bits. */
+	for (i = 48; i > 0; i--)
+		if (!(elf_info.kern_vaddr_start & (1UL << i)))
+			break;
+
+	if (i <= 0)
+		return UINT64_MAX;
+	else
+		return UINT64_MAX << i;
+}
+
 /*
  * iomem_range_callback() - callback called for each iomem region
  * @data: not used
@@ -62,6 +95,10 @@ static int iomem_range_callback(void *UNUSED(data), int UNUSED(nr),
 	else if (strncmp(str, SYSTEM_RAM, strlen(SYSTEM_RAM)) == 0)
 		return mem_regions_add(&system_memory_rgns,
 				       base, length, RANGE_RAM);
+	else if (strncmp(str, KERNEL_CODE, strlen(KERNEL_CODE)) == 0)
+		elf_info.kern_paddr_start = base;
+	else if (strncmp(str, KERNEL_DATA, strlen(KERNEL_DATA)) == 0)
+		elf_info.kern_size = base + length - elf_info.kern_paddr_start;
 
 	return 0;
 }
@@ -111,6 +148,67 @@ static int crash_get_memory_ranges(void)
 
 	dbgprint_mem_range("Coredump memory ranges",
 			   system_memory_rgns.ranges, system_memory_rgns.size);
+
+	/*
+	 * For additional kernel code/data segment.
+	 * kern_paddr_start/kern_size are determined in iomem_range_callback
+	 */
+	elf_info.kern_vaddr_start = get_kernel_sym("_text");
+	if (!elf_info.kern_vaddr_start)
+		elf_info.kern_vaddr_start = UINT64_MAX;
+
+	return 0;
+}
+
+/*
+ * load_crashdump_segments() - load the elf core header
+ * @info: kexec info structure
+ *
+ * This function creates and loads an additional segment of elf core header
+ : which is used to construct /proc/vmcore on crash dump kernel.
+ *
+ * Return 0 in case of success and -1 in case of error.
+ */
+
+int load_crashdump_segments(struct kexec_info *info)
+{
+	unsigned long elfcorehdr;
+	unsigned long bufsz;
+	void *buf;
+	int err;
+
+	/*
+	 * First fetch all the memory (RAM) ranges that we are going to
+	 * pass to the crash dump kernel during panic.
+	 */
+
+	err = crash_get_memory_ranges();
+
+	if (err)
+		return EFAILED;
+
+	elf_info.page_offset = get_kernel_page_offset();
+	dbgprintf("%s: page_offset:   %016llx\n", __func__,
+			elf_info.page_offset);
+
+	err = crash_create_elf64_headers(info, &elf_info,
+			system_memory_rgns.ranges, system_memory_rgns.size,
+			&buf, &bufsz, ELF_CORE_HEADER_ALIGN);
+
+	if (err)
+		return EFAILED;
+
+	elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 0,
+		crash_reserved_mem.start, crash_reserved_mem.end,
+		-1, 0);
+
+	elfcorehdr_mem.start = elfcorehdr;
+	elfcorehdr_mem.end = elfcorehdr + bufsz - 1;
+
+	dbgprintf("%s: elfcorehdr 0x%llx-0x%llx\n", __func__,
+			elfcorehdr_mem.start, elfcorehdr_mem.end);
+
+	return 0;
 }
 
 int get_crash_kernel_load_range(uint64_t *start, uint64_t *end)
diff --git a/kexec/arch/arm64/crashdump-arm64.h b/kexec/arch/arm64/crashdump-arm64.h
index ce9881e..64c677d 100644
--- a/kexec/arch/arm64/crashdump-arm64.h
+++ b/kexec/arch/arm64/crashdump-arm64.h
@@ -18,5 +18,8 @@
 
 extern struct memory_ranges usablemem_rgns;
 extern struct memory_range crash_reserved_mem;
+extern struct memory_range elfcorehdr_mem;
+
+extern int load_crashdump_segments(struct kexec_info *info);
 
 #endif /* CRASHDUMP_ARM64_H */
diff --git a/kexec/arch/arm64/iomem.h b/kexec/arch/arm64/iomem.h
index 20cda87..d4864bb 100644
--- a/kexec/arch/arm64/iomem.h
+++ b/kexec/arch/arm64/iomem.h
@@ -2,6 +2,8 @@
 #define IOMEM_H
 
 #define SYSTEM_RAM		"System RAM\n"
+#define KERNEL_CODE		"Kernel code\n"
+#define KERNEL_DATA		"Kernel data\n"
 #define CRASH_KERNEL		"Crash kernel\n"
 #define IOMEM_RESERVED		"reserved\n"
 
diff --git a/kexec/arch/arm64/kexec-elf-arm64.c b/kexec/arch/arm64/kexec-elf-arm64.c
index 2b6c127..900c693 100644
--- a/kexec/arch/arm64/kexec-elf-arm64.c
+++ b/kexec/arch/arm64/kexec-elf-arm64.c
@@ -119,6 +119,16 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
 	dbgprintf("%s: PE format:      %s\n", __func__,
 		(arm64_header_check_pe_sig(header) ? "yes" : "no"));
 
+	/* create and initialize elf core header segment */
+	if (info->kexec_flags & KEXEC_ON_CRASH) {
+		result = load_crashdump_segments(info);
+		if (result) {
+			dbgprintf("%s: Creating eflcorehdr failed.\n",
+								__func__);
+			goto exit;
+		}
+	}
+
 	/* load the kernel */
 	result = elf_exec_load(&ehdr, info);
 
@@ -127,6 +137,7 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
 		goto exit;
 	}
 
+	/* load additional data */
 	result = arm64_load_other_segments(info, kernel_segment
 		+ arm64_mem.text_offset);
 
-- 
2.11.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v7 07/10] arm64: kdump: set up kernel image segment
  2017-05-17  5:51 [PATCH v7 00/10] (kexec-tools) arm64: add kdump support AKASHI Takahiro
                   ` (5 preceding siblings ...)
  2017-05-17  5:51 ` [PATCH v7 06/10] arm64: kdump: add elf core header segment AKASHI Takahiro
@ 2017-05-17  5:51 ` AKASHI Takahiro
  2017-05-17  5:51 ` [PATCH v7 08/10] arm64: kdump: set up other segments AKASHI Takahiro
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: AKASHI Takahiro @ 2017-05-17  5:51 UTC (permalink / raw)
  To: horms; +Cc: geoff, panand, kexec, AKASHI Takahiro

On arm64, we can use the same kernel image as 1st kernel, but
we have to modify the entry point as well as segments' addresses
in the kernel's elf header in order to load them into correct places.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 kexec/arch/arm64/crashdump-arm64.c | 24 ++++++++++++++++++++++++
 kexec/arch/arm64/crashdump-arm64.h |  1 +
 kexec/arch/arm64/kexec-arm64.c     | 25 ++++++++++++++++++++-----
 kexec/arch/arm64/kexec-elf-arm64.c | 11 ++++++++++-
 4 files changed, 55 insertions(+), 6 deletions(-)

diff --git a/kexec/arch/arm64/crashdump-arm64.c b/kexec/arch/arm64/crashdump-arm64.c
index d142435..4fd7aa8 100644
--- a/kexec/arch/arm64/crashdump-arm64.c
+++ b/kexec/arch/arm64/crashdump-arm64.c
@@ -211,6 +211,30 @@ int load_crashdump_segments(struct kexec_info *info)
 	return 0;
 }
 
+/*
+ * e_entry and p_paddr are actually in virtual address space.
+ * Those values will be translated to physcal addresses by using
+ * virt_to_phys() in add_segment().
+ * So let's fix up those values for later use so the memory base
+ * (arm64_mm.phys_offset) will be correctly replaced with
+ * crash_reserved_mem.start.
+ */
+void fixup_elf_addrs(struct mem_ehdr *ehdr)
+{
+	struct mem_phdr *phdr;
+	int i;
+
+	ehdr->e_entry += - arm64_mem.phys_offset + crash_reserved_mem.start;
+
+	for (i = 0; i < ehdr->e_phnum; i++) {
+		phdr = &ehdr->e_phdr[i];
+		if (phdr->p_type != PT_LOAD)
+			continue;
+		phdr->p_paddr +=
+			(-arm64_mem.phys_offset + crash_reserved_mem.start);
+	}
+}
+
 int get_crash_kernel_load_range(uint64_t *start, uint64_t *end)
 {
 	if (!usablemem_rgns.size)
diff --git a/kexec/arch/arm64/crashdump-arm64.h b/kexec/arch/arm64/crashdump-arm64.h
index 64c677d..880b83a 100644
--- a/kexec/arch/arm64/crashdump-arm64.h
+++ b/kexec/arch/arm64/crashdump-arm64.h
@@ -21,5 +21,6 @@ extern struct memory_range crash_reserved_mem;
 extern struct memory_range elfcorehdr_mem;
 
 extern int load_crashdump_segments(struct kexec_info *info);
+extern void fixup_elf_addrs(struct mem_ehdr *ehdr);
 
 #endif /* CRASHDUMP_ARM64_H */
diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
index 153c96f..6c21756 100644
--- a/kexec/arch/arm64/kexec-arm64.c
+++ b/kexec/arch/arm64/kexec-arm64.c
@@ -308,12 +308,27 @@ unsigned long arm64_locate_kernel_segment(struct kexec_info *info)
 {
 	unsigned long hole;
 
-	hole = locate_hole(info,
-		arm64_mem.text_offset + arm64_mem.image_size,
-		MiB(2), 0, ULONG_MAX, 1);
+	if (info->kexec_flags & KEXEC_ON_CRASH) {
+		unsigned long hole_end;
+
+		hole = (crash_reserved_mem.start < mem_min ?
+				mem_min : crash_reserved_mem.start);
+		hole = _ALIGN_UP(hole, MiB(2));
+		hole_end = hole + arm64_mem.text_offset + arm64_mem.image_size;
+
+		if ((hole_end > mem_max) ||
+		    (hole_end > crash_reserved_mem.end)) {
+			dbgprintf("%s: Crash kernel out of range\n", __func__);
+			hole = ULONG_MAX;
+		}
+	} else {
+		hole = locate_hole(info,
+			arm64_mem.text_offset + arm64_mem.image_size,
+			MiB(2), 0, ULONG_MAX, 1);
 
-	if (hole == ULONG_MAX)
-		dbgprintf("%s: locate_hole failed\n", __func__);
+		if (hole == ULONG_MAX)
+			dbgprintf("%s: locate_hole failed\n", __func__);
+	}
 
 	return hole;
 }
diff --git a/kexec/arch/arm64/kexec-elf-arm64.c b/kexec/arch/arm64/kexec-elf-arm64.c
index 900c693..a961147 100644
--- a/kexec/arch/arm64/kexec-elf-arm64.c
+++ b/kexec/arch/arm64/kexec-elf-arm64.c
@@ -9,6 +9,7 @@
 #include <stdlib.h>
 #include <linux/elf.h>
 
+#include "crashdump-arm64.h"
 #include "kexec-arm64.h"
 #include "kexec-elf.h"
 #include "kexec-syscall.h"
@@ -105,7 +106,8 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
 	}
 
 	arm64_mem.vp_offset = _ALIGN_DOWN(ehdr.e_entry, MiB(2));
-	arm64_mem.vp_offset -= kernel_segment - get_phys_offset();
+	if (!(info->kexec_flags & KEXEC_ON_CRASH))
+		arm64_mem.vp_offset -= kernel_segment - get_phys_offset();
 
 	dbgprintf("%s: kernel_segment: %016lx\n", __func__, kernel_segment);
 	dbgprintf("%s: text_offset:    %016lx\n", __func__,
@@ -130,6 +132,13 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
 	}
 
 	/* load the kernel */
+	if (info->kexec_flags & KEXEC_ON_CRASH)
+		/*
+		 * offset addresses in elf header in order to load
+		 * vmlinux (elf_exec) into crash kernel's memory
+		 */
+		fixup_elf_addrs(&ehdr);
+
 	result = elf_exec_load(&ehdr, info);
 
 	if (result) {
-- 
2.11.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v7 08/10] arm64: kdump: set up other segments
  2017-05-17  5:51 [PATCH v7 00/10] (kexec-tools) arm64: add kdump support AKASHI Takahiro
                   ` (6 preceding siblings ...)
  2017-05-17  5:51 ` [PATCH v7 07/10] arm64: kdump: set up kernel image segment AKASHI Takahiro
@ 2017-05-17  5:51 ` AKASHI Takahiro
  2017-05-17  5:51 ` [PATCH v7 09/10] arm64: kdump: add DT properties to crash dump kernel's dtb AKASHI Takahiro
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: AKASHI Takahiro @ 2017-05-17  5:51 UTC (permalink / raw)
  To: horms; +Cc: geoff, panand, kexec, AKASHI Takahiro

We make sure that all the other segments, initrd and device-tree blob,
also be loaded into the reserved memory of crash dump kernel.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 kexec/arch/arm64/kexec-arm64.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
index 6c21756..dfe16a6 100644
--- a/kexec/arch/arm64/kexec-arm64.c
+++ b/kexec/arch/arm64/kexec-arm64.c
@@ -376,7 +376,10 @@ int arm64_load_other_segments(struct kexec_info *info,
 	/* Put the other segments after the image. */
 
 	hole_min = image_base + arm64_mem.image_size;
-	hole_max = ULONG_MAX;
+	if (info->kexec_flags & KEXEC_ON_CRASH)
+		hole_max = crash_reserved_mem.end;
+	else
+		hole_max = ULONG_MAX;
 
 	if (arm64_opts.initrd) {
 		initrd_buf = slurp_file(arm64_opts.initrd, &initrd_size);
-- 
2.11.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v7 09/10] arm64: kdump: add DT properties to crash dump kernel's dtb
  2017-05-17  5:51 [PATCH v7 00/10] (kexec-tools) arm64: add kdump support AKASHI Takahiro
                   ` (7 preceding siblings ...)
  2017-05-17  5:51 ` [PATCH v7 08/10] arm64: kdump: set up other segments AKASHI Takahiro
@ 2017-05-17  5:51 ` AKASHI Takahiro
  2017-05-17  5:51 ` [PATCH v7 10/10] arm64: kdump: Add support for binary image files AKASHI Takahiro
  2017-05-22  6:22 ` [PATCH v7 00/10] (kexec-tools) arm64: add kdump support Pratyush Anand
  10 siblings, 0 replies; 15+ messages in thread
From: AKASHI Takahiro @ 2017-05-17  5:51 UTC (permalink / raw)
  To: horms; +Cc: geoff, panand, kexec, AKASHI Takahiro

We pass the following properties to crash dump kernel:
linux,elfcorehdr: elf core header segment,
		  same as "elfcorehdr=" kernel parameter on other archs
linux,usable-memory-range: usable memory reserved for crash dump kernel

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 kexec/arch/arm64/kexec-arm64.c     | 197 ++++++++++++++++++++++++++++++++++++-
 kexec/arch/arm64/kexec-elf-arm64.c |   5 -
 2 files changed, 192 insertions(+), 10 deletions(-)

diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
index dfe16a6..62f3758 100644
--- a/kexec/arch/arm64/kexec-arm64.c
+++ b/kexec/arch/arm64/kexec-arm64.c
@@ -25,6 +25,14 @@
 #include "kexec-syscall.h"
 #include "arch/options.h"
 
+#define ROOT_NODE_ADDR_CELLS_DEFAULT 1
+#define ROOT_NODE_SIZE_CELLS_DEFAULT 1
+
+#define PROP_ADDR_CELLS "#address-cells"
+#define PROP_SIZE_CELLS "#size-cells"
+#define PROP_ELFCOREHDR "linux,elfcorehdr"
+#define PROP_USABLE_MEM_RANGE "linux,usable-memory-range"
+
 /* Global varables the core kexec routines expect. */
 
 unsigned char reuse_initrd;
@@ -129,9 +137,6 @@ int arch_process_options(int argc, char **argv)
 		case OPT_INITRD:
 			arm64_opts.initrd = optarg;
 			break;
-		case OPT_PANIC:
-			die("load-panic (-p) not supported");
-			break;
 		default:
 			break; /* Ignore core and unknown options. */
 		}
@@ -282,12 +287,115 @@ on_success:
 	return 0;
 }
 
+static int get_cells_size(void *fdt, uint32_t *address_cells,
+						uint32_t *size_cells)
+{
+	int nodeoffset;
+	const uint32_t *prop = NULL;
+	int prop_len;
+
+	/* default values */
+	*address_cells = ROOT_NODE_ADDR_CELLS_DEFAULT;
+	*size_cells = ROOT_NODE_SIZE_CELLS_DEFAULT;
+
+	/* under root node */
+	nodeoffset = fdt_path_offset(fdt, "/");
+	if (nodeoffset < 0)
+		goto on_error;
+
+	prop = fdt_getprop(fdt, nodeoffset, PROP_ADDR_CELLS, &prop_len);
+	if (prop) {
+		if (prop_len == sizeof(*prop))
+			*address_cells = fdt32_to_cpu(*prop);
+		else
+			goto on_error;
+	}
+
+	prop = fdt_getprop(fdt, nodeoffset, PROP_SIZE_CELLS, &prop_len);
+	if (prop) {
+		if (prop_len == sizeof(*prop))
+			*size_cells = fdt32_to_cpu(*prop);
+		else
+			goto on_error;
+	}
+
+	dbgprintf("%s: #address-cells:%d #size-cells:%d\n", __func__,
+			*address_cells, *size_cells);
+	return 0;
+
+on_error:
+	return EFAILED;
+}
+
+static bool cells_size_fitted(uint32_t address_cells, uint32_t size_cells,
+						struct memory_range *range)
+{
+	dbgprintf("%s: %llx-%llx\n", __func__, range->start, range->end);
+
+	/* if *_cells >= 2, cells can hold 64-bit values anyway */
+	if ((address_cells == 1) && (range->start >= (1ULL << 32)))
+		return false;
+
+	if ((size_cells == 1) &&
+			((range->end - range->start + 1) >= (1ULL << 32)))
+		return false;
+
+	return true;
+}
+
+static void fill_property(void *buf, uint64_t val, uint32_t cells)
+{
+	uint32_t val32;
+	int i;
+
+	if (cells == 1) {
+		val32 = cpu_to_fdt32((uint32_t)val);
+		memcpy(buf, &val32, sizeof(uint32_t));
+	} else {
+		for (i = 0;
+		     i < (cells * sizeof(uint32_t) - sizeof(uint64_t)); i++)
+			*(char *)buf++ = 0;
+
+		val = cpu_to_fdt64(val);
+		memcpy(buf, &val, sizeof(uint64_t));
+	}
+}
+
+static int fdt_setprop_range(void *fdt, int nodeoffset,
+				const char *name, struct memory_range *range,
+				uint32_t address_cells, uint32_t size_cells)
+{
+	void *buf, *prop;
+	size_t buf_size;
+	int result;
+
+	buf_size = (address_cells + size_cells) * sizeof(uint32_t);
+	prop = buf = xmalloc(buf_size);
+
+	fill_property(prop, range->start, address_cells);
+	prop += address_cells * sizeof(uint32_t);
+
+	fill_property(prop, range->end - range->start + 1, size_cells);
+	prop += size_cells * sizeof(uint32_t);
+
+	result = fdt_setprop(fdt, nodeoffset, name, buf, buf_size);
+
+	free(buf);
+
+	return result;
+}
+
 /**
  * setup_2nd_dtb - Setup the 2nd stage kernel's dtb.
  */
 
-static int setup_2nd_dtb(struct dtb *dtb, char *command_line)
+static int setup_2nd_dtb(struct dtb *dtb, char *command_line, int on_crash)
 {
+	uint32_t address_cells, size_cells;
+	int range_len;
+	int nodeoffset;
+	char *new_buf = NULL;
+	int new_size;
 	int result;
 
 	result = fdt_check_header(dtb->buf);
@@ -299,8 +407,86 @@ static int setup_2nd_dtb(struct dtb *dtb, char *command_line)
 
 	result = set_bootargs(dtb, command_line);
 
+	if (on_crash) {
+		/* determine #address-cells and #size-cells */
+		result = get_cells_size(dtb->buf, &address_cells, &size_cells);
+		if (result) {
+			fprintf(stderr,
+				"kexec: cannot determine cells-size.\n");
+			result = -EINVAL;
+			goto on_error;
+		}
+
+		if (!cells_size_fitted(address_cells, size_cells,
+					&elfcorehdr_mem)) {
+			fprintf(stderr,
+				"kexec: elfcorehdr doesn't fit cells-size.\n");
+			result = -EINVAL;
+			goto on_error;
+		}
+
+		if (!cells_size_fitted(address_cells, size_cells,
+					&crash_reserved_mem)) {
+			fprintf(stderr,
+				"kexec: usable memory range doesn't fit cells-size.\n");
+			result = -EINVAL;
+			goto on_error;
+		}
+
+		/* duplicate dt blob */
+		range_len = sizeof(uint32_t) * (address_cells + size_cells);
+		new_size = fdt_totalsize(dtb->buf)
+			+ fdt_prop_len(PROP_ELFCOREHDR, range_len)
+			+ fdt_prop_len(PROP_USABLE_MEM_RANGE, range_len);
+
+		new_buf = xmalloc(new_size);
+		result = fdt_open_into(dtb->buf, new_buf, new_size);
+		if (result) {
+			dbgprintf("%s: fdt_open_into failed: %s\n", __func__,
+				fdt_strerror(result));
+			result = -ENOSPC;
+			goto on_error;
+		}
+
+		/* add linux,elfcorehdr */
+		nodeoffset = fdt_path_offset(new_buf, "/chosen");
+		result = fdt_setprop_range(new_buf, nodeoffset,
+				PROP_ELFCOREHDR, &elfcorehdr_mem,
+				address_cells, size_cells);
+		if (result) {
+			dbgprintf("%s: fdt_setprop failed: %s\n", __func__,
+				fdt_strerror(result));
+			result = -EINVAL;
+			goto on_error;
+		}
+
+		/* add linux,usable-memory-range */
+		nodeoffset = fdt_path_offset(new_buf, "/chosen");
+		result = fdt_setprop_range(new_buf, nodeoffset,
+				PROP_USABLE_MEM_RANGE, &crash_reserved_mem,
+				address_cells, size_cells);
+		if (result) {
+			dbgprintf("%s: fdt_setprop failed: %s\n", __func__,
+				fdt_strerror(result));
+			result = -EINVAL;
+			goto on_error;
+		}
+
+		fdt_pack(new_buf);
+		dtb->buf = new_buf;
+		dtb->size = fdt_totalsize(new_buf);
+	}
+
 	dump_reservemap(dtb);
 
+
+	return result;
+
+on_error:
+	fprintf(stderr, "kexec: %s failed.\n", __func__);
+	if (new_buf)
+		free(new_buf);
+
 	return result;
 }
 
@@ -368,7 +554,8 @@ int arm64_load_other_segments(struct kexec_info *info,
 		}
 	}
 
-	result = setup_2nd_dtb(&dtb, command_line);
+	result = setup_2nd_dtb(&dtb, command_line,
+			info->kexec_flags & KEXEC_ON_CRASH);
 
 	if (result)
 		return EFAILED;
diff --git a/kexec/arch/arm64/kexec-elf-arm64.c b/kexec/arch/arm64/kexec-elf-arm64.c
index a961147..fc83b42 100644
--- a/kexec/arch/arm64/kexec-elf-arm64.c
+++ b/kexec/arch/arm64/kexec-elf-arm64.c
@@ -47,11 +47,6 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
 	int result;
 	int i;
 
-	if (info->kexec_flags & KEXEC_ON_CRASH) {
-		fprintf(stderr, "kexec: kdump not yet supported on arm64\n");
-		return EFAILED;
-	}
-
 	result = build_elf_exec_info(kernel_buf, kernel_size, &ehdr, 0);
 
 	if (result < 0) {
-- 
2.11.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v7 10/10] arm64: kdump: Add support for binary image files
  2017-05-17  5:51 [PATCH v7 00/10] (kexec-tools) arm64: add kdump support AKASHI Takahiro
                   ` (8 preceding siblings ...)
  2017-05-17  5:51 ` [PATCH v7 09/10] arm64: kdump: add DT properties to crash dump kernel's dtb AKASHI Takahiro
@ 2017-05-17  5:51 ` AKASHI Takahiro
  2017-05-22  6:22 ` [PATCH v7 00/10] (kexec-tools) arm64: add kdump support Pratyush Anand
  10 siblings, 0 replies; 15+ messages in thread
From: AKASHI Takahiro @ 2017-05-17  5:51 UTC (permalink / raw)
  To: horms; +Cc: geoff, panand, kexec, AKASHI Takahiro

From: Pratyush Anand <panand@redhat.com>

This patch adds support to use binary image ie arch/arm64/boot/Image with
kdump.

Signed-off-by: Pratyush Anand <panand@redhat.com>
[takahiro.akashi@linaro.org: a bit reworked]
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 kexec/arch/arm64/kexec-image-arm64.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/kexec/arch/arm64/kexec-image-arm64.c b/kexec/arch/arm64/kexec-image-arm64.c
index e5f2a9b..e1b1e54 100644
--- a/kexec/arch/arm64/kexec-image-arm64.c
+++ b/kexec/arch/arm64/kexec-image-arm64.c
@@ -4,7 +4,9 @@
 
 #define _GNU_SOURCE
 
+#include "crashdump-arm64.h"
 #include "kexec-arm64.h"
+#include "kexec-syscall.h"
 #include <limits.h>
 
 int image_arm64_probe(const char *kernel_buf, off_t kernel_size)
@@ -58,11 +60,22 @@ int image_arm64_load(int argc, char **argv, const char *kernel_buf,
 	dbgprintf("%s: PE format:      %s\n", __func__,
 		(arm64_header_check_pe_sig(header) ? "yes" : "no"));
 
+	/* create and initialize elf core header segment */
+	if (info->kexec_flags & KEXEC_ON_CRASH) {
+		result = load_crashdump_segments(info);
+		if (result) {
+			dbgprintf("%s: Creating eflcorehdr failed.\n",
+								__func__);
+			goto exit;
+		}
+	}
+
 	/* load the kernel */
 	add_segment_phys_virt(info, kernel_buf, kernel_size,
 			kernel_segment + arm64_mem.text_offset,
 			arm64_mem.image_size, 0);
 
+	/* load additional data */
 	result = arm64_load_other_segments(info, kernel_segment
 		+ arm64_mem.text_offset);
 
-- 
2.11.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v7 01/10] kexec: exntend the semantics of kexec_iomem_for_each_line
  2017-05-17  5:51 ` [PATCH v7 01/10] kexec: exntend the semantics of kexec_iomem_for_each_line AKASHI Takahiro
@ 2017-05-17 23:37   ` David Woodhouse
  2017-05-22  0:18     ` AKASHI Takahiro
  0 siblings, 1 reply; 15+ messages in thread
From: David Woodhouse @ 2017-05-17 23:37 UTC (permalink / raw)
  To: AKASHI Takahiro, horms; +Cc: geoff, panand, kexec


[-- Attachment #1.1: Type: text/plain, Size: 933 bytes --]

On Wed, 2017-05-17 at 14:51 +0900, AKASHI Takahiro wrote:
> The current kexec_iomem_for_each_line() counts up all the lines for which
> a callback function returns zero(0) or positive, and otherwise it stops
> further scanning.
> This behavior is incovenient in some cases. For instance, on arm64, we want
> to count up "System RAM" entries, but need to skip "reserved" entries.

s/exntend/extend/ and s/incovenient/inconvenient/ but other than that,
all ten patches
Tested-by: David Woodhouse <dwmw@amazon.co.uk>

Simon, any chance of a 2.0.15 release once these are merged please?

Thanks for your continued effort on this, Akashi-san. Congratulations
on finally getting the support merged into 4.12!

I've backported the final set of patches to 4.9 too. That's where I'm
going to be using it for the moment. In case it's useful to anyone
else, it's here:
http://git.infradead.org/users/dwmw2/arm64-kdump-4.9.git

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4938 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v7 01/10] kexec: exntend the semantics of kexec_iomem_for_each_line
  2017-05-17 23:37   ` David Woodhouse
@ 2017-05-22  0:18     ` AKASHI Takahiro
  2017-05-22 11:41       ` Simon Horman
  0 siblings, 1 reply; 15+ messages in thread
From: AKASHI Takahiro @ 2017-05-22  0:18 UTC (permalink / raw)
  To: David Woodhouse; +Cc: geoff, panand, horms, kexec

On Wed, May 17, 2017 at 04:37:04PM -0700, David Woodhouse wrote:
> On Wed, 2017-05-17 at 14:51 +0900, AKASHI Takahiro wrote:
> > The current kexec_iomem_for_each_line() counts up all the lines for which
> > a callback function returns zero(0) or positive, and otherwise it stops
> > further scanning.
> > This behavior is incovenient in some cases. For instance, on arm64, we want
> > to count up "System RAM" entries, but need to skip "reserved" entries.
> 
> s/exntend/extend/ and s/incovenient/inconvenient/ but other than that,
> all ten patches
> Tested-by: David Woodhouse <dwmw@amazon.co.uk>

Thanks a lot!

> Simon, any chance of a 2.0.15 release once these are merged please?

For your convenience, you can also find my patch with fixes above:
http://git.linaro.org/people/takahiro.akashi/kexec-tools.git

> Thanks for your continued effort on this, Akashi-san. Congratulations
> on finally getting the support merged into 4.12!
> 
> I've backported the final set of patches to 4.9 too. That's where I'm
> going to be using it for the moment. In case it's useful to anyone
> else, it's here:
> http://git.infradead.org/users/dwmw2/arm64-kdump-4.9.git

Great.
Just FYI, we, linaro, will also backport kdump to our lsk v4.4 and v4.9.

Thanks,
-Takahiro AKASHI

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v7 00/10] (kexec-tools) arm64: add kdump support
  2017-05-17  5:51 [PATCH v7 00/10] (kexec-tools) arm64: add kdump support AKASHI Takahiro
                   ` (9 preceding siblings ...)
  2017-05-17  5:51 ` [PATCH v7 10/10] arm64: kdump: Add support for binary image files AKASHI Takahiro
@ 2017-05-22  6:22 ` Pratyush Anand
  10 siblings, 0 replies; 15+ messages in thread
From: Pratyush Anand @ 2017-05-22  6:22 UTC (permalink / raw)
  To: AKASHI Takahiro, horms; +Cc: geoff, kexec

Hi Akashi,

On Wednesday 17 May 2017 11:21 AM, AKASHI Takahiro wrote:
> My kernel patches of kdump support on arm64 were merged in v4.12-rc1.
>
> This patchset is synced with them and provides necessary changes for
> kexec-tools. It can be applied on top of kexec-tools master branch.
>
> Patch #1 to #4 are preparatory patches for succeeding patches,
> #5 to #9 are main part of kdump implementation for vmlinux support
> and #10 is for Image support.
>
> Changes for v7:
>  - rebased on the latest master
>  - fix incorrect return values on error (patch #4)
>  - implement get_crash_kernel_load_range() (patch #5)
>  - rename some variables/functions for better readability (patch #5/#9)
>  - add/revise comments
>


Thanks for the v7 updates. I tested this version as well, and it worked!!
Tested-by: Pratyush Anand <panand@redhat.com>


I will be sending v2 of D-cache enabling patches(for faster purgatory sha 
verification) once these patches are merged. If some one would like to test 
those patches in advance, it will be more than welcome. Patches lie in my 
github devel branch.

https://github.com/pratyushanand/kexec-tools.git : devel

~Pratyush

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v7 01/10] kexec: exntend the semantics of kexec_iomem_for_each_line
  2017-05-22  0:18     ` AKASHI Takahiro
@ 2017-05-22 11:41       ` Simon Horman
  0 siblings, 0 replies; 15+ messages in thread
From: Simon Horman @ 2017-05-22 11:41 UTC (permalink / raw)
  To: AKASHI Takahiro, David Woodhouse, geoff, panand, kexec

On Mon, May 22, 2017 at 09:18:07AM +0900, AKASHI Takahiro wrote:
> On Wed, May 17, 2017 at 04:37:04PM -0700, David Woodhouse wrote:
> > On Wed, 2017-05-17 at 14:51 +0900, AKASHI Takahiro wrote:
> > > The current kexec_iomem_for_each_line() counts up all the lines for which
> > > a callback function returns zero(0) or positive, and otherwise it stops
> > > further scanning.
> > > This behavior is incovenient in some cases. For instance, on arm64, we want
> > > to count up "System RAM" entries, but need to skip "reserved" entries.
> > 
> > s/exntend/extend/ and s/incovenient/inconvenient/ but other than that,
> > all ten patches
> > Tested-by: David Woodhouse <dwmw@amazon.co.uk>
> 
> Thanks a lot!
> 
> > Simon, any chance of a 2.0.15 release once these are merged please?
> 
> For your convenience, you can also find my patch with fixes above:
> http://git.linaro.org/people/takahiro.akashi/kexec-tools.git

Thanks, I have applied this series with the tags from David (above)
and Pratyush (below).

Regarding releasing 2.0.15. It should have come out around the same time
as v4.11, but I entirely forgot - sorry about that. I will see about
getting it released soon with these patches included.

> > Thanks for your continued effort on this, Akashi-san. Congratulations
> > on finally getting the support merged into 4.12!
> > 
> > I've backported the final set of patches to 4.9 too. That's where I'm
> > going to be using it for the moment. In case it's useful to anyone
> > else, it's here:
> > http://git.infradead.org/users/dwmw2/arm64-kdump-4.9.git
> 
> Great.
> Just FYI, we, linaro, will also backport kdump to our lsk v4.4 and v4.9.
> 
> Thanks,
> -Takahiro AKASHI
> 

On Mon, May 22, 2017 at 11:52:25AM +0530, Pratyush Anand wrote:

...

> Thanks for the v7 updates. I tested this version as well, and it worked!!
> Tested-by: Pratyush Anand <panand@redhat.com>


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-05-22 11:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-17  5:51 [PATCH v7 00/10] (kexec-tools) arm64: add kdump support AKASHI Takahiro
2017-05-17  5:51 ` [PATCH v7 01/10] kexec: exntend the semantics of kexec_iomem_for_each_line AKASHI Takahiro
2017-05-17 23:37   ` David Woodhouse
2017-05-22  0:18     ` AKASHI Takahiro
2017-05-22 11:41       ` Simon Horman
2017-05-17  5:51 ` [PATCH v7 02/10] kexec: generalize and rename get_kernel_stext_sym() AKASHI Takahiro
2017-05-17  5:51 ` [PATCH v7 03/10] arm64: identify PHYS_OFFSET correctly AKASHI Takahiro
2017-05-17  5:51 ` [PATCH v7 04/10] arm64: change return values on error to negative AKASHI Takahiro
2017-05-17  5:51 ` [PATCH v7 05/10] arm64: kdump: identify memory regions AKASHI Takahiro
2017-05-17  5:51 ` [PATCH v7 06/10] arm64: kdump: add elf core header segment AKASHI Takahiro
2017-05-17  5:51 ` [PATCH v7 07/10] arm64: kdump: set up kernel image segment AKASHI Takahiro
2017-05-17  5:51 ` [PATCH v7 08/10] arm64: kdump: set up other segments AKASHI Takahiro
2017-05-17  5:51 ` [PATCH v7 09/10] arm64: kdump: add DT properties to crash dump kernel's dtb AKASHI Takahiro
2017-05-17  5:51 ` [PATCH v7 10/10] arm64: kdump: Add support for binary image files AKASHI Takahiro
2017-05-22  6:22 ` [PATCH v7 00/10] (kexec-tools) arm64: add kdump support Pratyush Anand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.