Skip to contentSkip to conversation

kexec-tools: Upgrade to 2.0.14

PATCH New [email protected] 1 participant 2 messages Dec 29, 2016

lore
Share & tools
lore
#0 lore raw

v3 cover kexec-tools: Upgrade to 2.0.14

From: He Zhe <[email protected]>

v1 to v2: Remove redundant tarball link in SRC_URI v2 to v3: Address Alex's comments:
Remove kexec-aarch64.patch and kexec-x32.patch files Correct Upstream-Status
Regenerate patch with git's rename detection enabled

He Zhe (1):
kexec-tools: Upgrade to 2.0.14

 ...nd-the-semantics-of-kexec_iomem_for_each_.patch |  78 ++
 ...eneralize-and-rename-get_kernel_stext_sym.patch | 194 +++++
 ...0003-arm64-identify-PHYS_OFFSET-correctly.patch |  76 ++
 .../0004-arm64-kdump-identify-memory-regions.patch | 202 ++++++
 ...5-arm64-kdump-add-elf-core-header-segment.patch | 191 +++++
 ...6-arm64-kdump-set-up-kernel-image-segment.patch | 137 ++++
 .../0007-arm64-kdump-set-up-other-segments.patch   |  35 +
 ...-add-DT-properties-to-crash-dump-kernel-s.patch | 150 ++++
 ...-kdump-Add-support-for-binary-image-files.patch |  52 ++
 .../kexec/kexec-tools/kexec-aarch64.patch          | 801 ---------------------
 .../kexec/kexec-tools/kexec-x32.patch              |  88 ---
 ...kexec-tools_2.0.12.bb => kexec-tools_2.0.14.bb} |  15 +-
 12 files changed, 1126 insertions(+), 893 deletions(-)
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-kexec-exntend-the-semantics-of-kexec_iomem_for_each_.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0002-kexec-generalize-and-rename-get_kernel_stext_sym.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0003-arm64-identify-PHYS_OFFSET-correctly.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0004-arm64-kdump-identify-memory-regions.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0005-arm64-kdump-add-elf-core-header-segment.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0006-arm64-kdump-set-up-kernel-image-segment.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0007-arm64-kdump-set-up-other-segments.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0008-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0009-arm64-kdump-Add-support-for-binary-image-files.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/kexec-aarch64.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch
 rename meta/recipes-kernel/kexec/{kexec-tools_2.0.12.bb => kexec-tools_2.0.14.bb} (55%)
Signature · 1 line
2.8.3
#1 lore raw

PATCH v3 1/1 kexec-tools: Upgrade to 2.0.14

From: He Zhe <[email protected]>

Remove kexec-aarch64.patch since it has been merged upstream Remove kexec-x32.patch since it has been reverted upstream Add patches for kdump arm64 from upstream mailing list:
http://lists.infradead.org/pipermail/kexec/2016-November/017555.html

---
 ...nd-the-semantics-of-kexec_iomem_for_each_.patch |  78 ++
 ...eneralize-and-rename-get_kernel_stext_sym.patch | 194 +++++
 ...0003-arm64-identify-PHYS_OFFSET-correctly.patch |  76 ++
 .../0004-arm64-kdump-identify-memory-regions.patch | 202 ++++++
 ...5-arm64-kdump-add-elf-core-header-segment.patch | 191 +++++
 ...6-arm64-kdump-set-up-kernel-image-segment.patch | 137 ++++
 .../0007-arm64-kdump-set-up-other-segments.patch   |  35 +
 ...-add-DT-properties-to-crash-dump-kernel-s.patch | 150 ++++
 ...-kdump-Add-support-for-binary-image-files.patch |  52 ++
 .../kexec/kexec-tools/kexec-aarch64.patch          | 801 ---------------------
 .../kexec/kexec-tools/kexec-x32.patch              |  88 ---
 ...kexec-tools_2.0.12.bb => kexec-tools_2.0.14.bb} |  15 +-
 12 files changed, 1126 insertions(+), 893 deletions(-)
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-kexec-exntend-the-semantics-of-kexec_iomem_for_each_.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0002-kexec-generalize-and-rename-get_kernel_stext_sym.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0003-arm64-identify-PHYS_OFFSET-correctly.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0004-arm64-kdump-identify-memory-regions.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0005-arm64-kdump-add-elf-core-header-segment.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0006-arm64-kdump-set-up-kernel-image-segment.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0007-arm64-kdump-set-up-other-segments.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0008-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0009-arm64-kdump-Add-support-for-binary-image-files.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/kexec-aarch64.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch
 rename meta/recipes-kernel/kexec/{kexec-tools_2.0.12.bb => kexec-tools_2.0.14.bb} (55%)
meta/recipes-kernel/kexec/kexec-tools/0001-kexec-exntend-the-semantics-of-kexec_iomem_for_each_.patch new file +78 -0
new file mode 100644
index 0000000..dc8f9b1
@@ -0,0 +1,78 @@
+From 02eed0f8f2748fd7579f69e5373445b52b2b8754 Mon Sep 17 00:00:00 2001
+From: AKASHI Takahiro <[email protected]>
+Date: Mon, 17 Oct 2016 13:56:58 +0900
+Subject: [PATCH 1/9] kexec: exntend the semantics of kexec_iomem_for_each_line
+
+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.
+
+Upstream-Status: Submitted [http://lists.infradead.org/pipermail/kexec/2016-November/017556.html]
+
+Signed-off-by: AKASHI Takahiro <[email protected]>
+Signed-off-by: He Zhe <[email protected]>
+---
+ 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 485a2e8..0a0277a 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++;
+ 		}
+ 	}
+ 
+-- 
+1.9.1
+
meta/recipes-kernel/kexec/kexec-tools/0002-kexec-generalize-and-rename-get_kernel_stext_sym.patch new file +194 -0

194 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0003-arm64-identify-PHYS_OFFSET-correctly.patch new file +76 -0

76 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0004-arm64-kdump-identify-memory-regions.patch new file +202 -0

202 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0005-arm64-kdump-add-elf-core-header-segment.patch new file +191 -0

191 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0006-arm64-kdump-set-up-kernel-image-segment.patch new file +137 -0

137 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0007-arm64-kdump-set-up-other-segments.patch new file +35 -0
new file mode 100644
index 0000000..1ee6809
@@ -0,0 +1,35 @@
+From 07ad14e12665221d754fde8e47c32ac18c24586a Mon Sep 17 00:00:00 2001
+From: AKASHI Takahiro <[email protected]>
+Date: Fri, 31 Jul 2015 20:01:39 +0900
+Subject: [PATCH 7/9] arm64: kdump: set up other segments
+
+We make sure that all the other segments, initrd and device-tree blob,
+also be loaded into the reserved memory of crash dump kernel.
+
+Upstream-Status: Submitted [http://lists.infradead.org/pipermail/kexec/2016-November/017562.html]
+
+Signed-off-by: AKASHI Takahiro <[email protected]>
+Signed-off-by: He Zhe <[email protected]>
+---
+ 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 cec4e41..78a0035 100644
+--- a/kexec/arch/arm64/kexec-arm64.c
++++ b/kexec/arch/arm64/kexec-arm64.c
+@@ -374,7 +374,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);
+-- 
+1.9.1
+
meta/recipes-kernel/kexec/kexec-tools/0008-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch new file +150 -0

150 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0009-arm64-kdump-Add-support-for-binary-image-files.patch new file +52 -0

52 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/kexec-aarch64.patch deleted +0 -801

801 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch deleted +0 -88

88 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb renamed from meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb +11 -4
similarity index 55%
rename from meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb
rename to meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb
index 59376c8..de5ce44 100644
@@ -3,15 +3,22 @@ export LDFLAGS = "-L${STAGING_LIBDIR}"
 EXTRA_OECONF = " --with-zlib=yes"
 
 SRC_URI += " \
-            file://kexec-aarch64.patch \
-            file://kexec-x32.patch \
             file://0002-powerpc-change-the-memory-size-limit.patch \
             file://0001-purgatory-Pass-r-directly-to-linker.patch \
             file://0001-vmcore-dmesg-Define-_GNU_SOURCE.patch \
+            file://0001-kexec-exntend-the-semantics-of-kexec_iomem_for_each_.patch \
+            file://0002-kexec-generalize-and-rename-get_kernel_stext_sym.patch \
+            file://0003-arm64-identify-PHYS_OFFSET-correctly.patch \
+            file://0004-arm64-kdump-identify-memory-regions.patch \
+            file://0005-arm64-kdump-add-elf-core-header-segment.patch \
+            file://0006-arm64-kdump-set-up-kernel-image-segment.patch \
+            file://0007-arm64-kdump-set-up-other-segments.patch \
+            file://0008-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch \
+            file://0009-arm64-kdump-Add-support-for-binary-image-files.patch \
          "
 
-SRC_URI[md5sum] = "10ddaae0e86af54407b164a1f5a39cc3"
-SRC_URI[sha256sum] = "cc7b60dad0da202004048a6179d8a53606943062dd627a2edba45a8ea3a85135"
+SRC_URI[md5sum] = "b2b2c5e6b29d467d6e99d587fb6b7cf5"
+SRC_URI[sha256sum] = "b3e69519d2acced256843b1e8f1ecfa00d9b54fa07449ed78f05b9193f239370"
 
 PACKAGES =+ "kexec kdump vmcore-dmesg"
 
Signature · 1 line
2.8.3