Skip to contentSkip to conversation

kexec-tools: fix Unknown type (Reserved) and ELF core parse error when run kexec

PATCH In review Liwei Song 2 participants 2 messages Nov 3, 2017

lore
Share & tools
lore

Liwei Song

author
#0 lore raw

PATCH 1/1 kexec-tools: fix Unknown type (Reserved) and ELF core parse error when run kexec

When run kexec on NUC7i7BNH/NUC7i5BNH, got the following error:

"Please report this as bug. Using RANGE_RESERVED now" "ELF core (kcore) parse failed"

Apply three upstream patches to fix it.

---
 ...andle-additional-e820-memmap-type-strings.patch | 42 +++++++++++++++++
 ...ild_mem_phdrs-check-if-p_paddr-is-invalid.patch | 45 ++++++++++++++++++
 ...x86-Support-large-number-of-memory-ranges.patch | 55 ++++++++++++++++++++++
 meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb    |  3 ++
 4 files changed, 145 insertions(+)
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-Handle-additional-e820-memmap-type-strings.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-build_mem_phdrs-check-if-p_paddr-is-invalid.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-x86-Support-large-number-of-memory-ranges.patch
meta/recipes-kernel/kexec/kexec-tools/0001-Handle-additional-e820-memmap-type-strings.patch new file +42 -0
new file mode 100644
index 000000000000..e5216c3aaea7
@@ -0,0 +1,42 @@
+From fab91841c717150aca4bc73e4c54769305e27ade Mon Sep 17 00:00:00 2001
+From: Eric DeVolder <[email protected]>
+Date: Wed, 10 May 2017 11:03:37 -0500
+Subject: [PATCH] Handle additional e820 memmap type strings
+
+Keep pace with changes to linux arch/x86/kernel/e820.c to
+function e820_type_to_string(). With this change, the following
+messages from kexec are eliminated (and allows kexec to load):
+
+ Unknown type (Reserved) while parsing /sys/firmware/memmap/8/type.
+ Please report this as bug. Using RANGE_RESERVED now.
+
+ Unknown type (Unknown E820 type) while parsing /sys/firmware/memmap/4/type.
+ Please report this as bug. Using RANGE_RESERVED now.
+
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=fab91841c717150aca4bc73e4c54769305e27ade]
+
+Signed-off-by: Eric DeVolder <[email protected]>
+Signed-off-by: Simon Horman <[email protected]>
+Signed-off-by: Liwei Song <[email protected]>
+---
+ kexec/firmware_memmap.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/kexec/firmware_memmap.c b/kexec/firmware_memmap.c
+index 4d84f0011c57..1ee214aa9316 100644
+--- a/kexec/firmware_memmap.c
++++ b/kexec/firmware_memmap.c
+@@ -164,6 +164,10 @@ static int parse_memmap_entry(const char *entry, struct memory_range *range)
+ 		range->type = RANGE_RESERVED;
+ 	else if (strcmp(type, "reserved") == 0)
+ 		range->type = RANGE_RESERVED;
++	else if (strcmp(type, "Reserved") == 0)
++		range->type = RANGE_RESERVED;
++	else if (strcmp(type, "Unknown E820 type") == 0)
++		range->type = RANGE_RESERVED;
+ 	else if (strcmp(type, "ACPI Non-volatile Storage") == 0)
+ 		range->type = RANGE_ACPI_NVS;
+ 	else if (strcmp(type, "Uncached RAM") == 0)
+-- 
+2.7.4
+
meta/recipes-kernel/kexec/kexec-tools/0001-build_mem_phdrs-check-if-p_paddr-is-invalid.patch new file +45 -0

45 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0001-x86-Support-large-number-of-memory-ranges.patch new file +55 -0

55 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb +3 -0
index bd89720e5bb1..79307fecb42c 100644
@@ -21,6 +21,9 @@ SRC_URI += "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.g
             file://kexec-x32.patch \
             file://0001-Disable-PIE-during-link.patch \
             file://0001-arm64-Disable-PIC.patch \
+            file://0001-build_mem_phdrs-check-if-p_paddr-is-invalid.patch \
+            file://0001-x86-Support-large-number-of-memory-ranges.patch \
+            file://0001-Handle-additional-e820-memmap-type-strings.patch \
          "
 
 SRC_URI[md5sum] = "b2b2c5e6b29d467d6e99d587fb6b7cf5"
Signature · 1 line
2.7.4
#1 lore raw
Quoted 6 lines · Liwei Song

When run kexec on NUC7i7BNH/NUC7i5BNH, got the following error:

"Please report this as bug. Using RANGE_RESERVED now" "ELF core (kcore) parse failed"

Apply three upstream patches to fix it.

This patch should go to oe-core list, and the issue can probably be resolved with an update to 2.0.15.

Alex