From 28cfac93e16618b16d123414108dc6ca8a1a794eb99639c4c0c559508f191c1b Mon Sep 17 00:00:00 2001 From: Tony Jones Date: Fri, 2 May 2014 01:24:00 +0000 Subject: [PATCH] Accepting request 232373 from home:jones_tony:branches:Kernel:kdump OBS-URL: https://build.opensuse.org/request/show/232373 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kexec-tools?expand=0&rev=44 --- ...ness-issue-with-initrd-base-and-size.patch | 54 +++++++++++++++++++ ...-should-be-read-stored-in-big-endian.patch | 45 ++++++++++++++++ ...atory-disabling-gcc-stack-protection.patch | 3 ++ kexec-tools-zero-efi-info.patch | 3 +- kexec-tools.changes | 20 ++++++- kexec-tools.spec | 4 ++ 6 files changed, 126 insertions(+), 3 deletions(-) create mode 100644 kexec-tools-fs2dt-fix-endianess-issue-with-initrd-base-and-size.patch create mode 100644 kexec-tools-ppc64-purgatory-device-tree-values-should-be-read-stored-in-big-endian.patch diff --git a/kexec-tools-fs2dt-fix-endianess-issue-with-initrd-base-and-size.patch b/kexec-tools-fs2dt-fix-endianess-issue-with-initrd-base-and-size.patch new file mode 100644 index 0000000..c3953b4 --- /dev/null +++ b/kexec-tools-fs2dt-fix-endianess-issue-with-initrd-base-and-size.patch @@ -0,0 +1,54 @@ +From: Laurent Dufour +Subject: [PATCH] kexec/fs2dt : Fix endianess issue with initrd base and size +Date: Fri, 11 Apr 2014 12:10:30 +0200 +Git-commit: db3c32babc5279816344be8210ca91a64331f0fe +References: bnc#873169 +Signed-off-by: Tony Jones + +The initrd values exposed in the device tree of the kexeced kernel must be +encoded in Big Endian format. + +Without this patch, kexeced LE kernel are expected to panic when dealing +with the initrd image. + +Signed-off-by: Laurent Dufour +--- + kexec/fs2dt.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/kexec/fs2dt.c b/kexec/fs2dt.c +index 5e6b98d..2a90979 100644 +--- a/kexec/fs2dt.c ++++ b/kexec/fs2dt.c +@@ -531,7 +531,7 @@ static void putnode(void) + /* Add initrd entries to the second kernel */ + if (initrd_base && initrd_size && !strcmp(basename,"chosen/")) { + int len = 8; +- unsigned long long initrd_end; ++ uint64_t bevalue; + + dt_reserve(&dt, 12); /* both props, of 6 words ea. */ + *dt++ = cpu_to_be32(3); +@@ -539,7 +539,8 @@ static void putnode(void) + *dt++ = cpu_to_be32(propnum("linux,initrd-start")); + pad_structure_block(len); + +- memcpy(dt,&initrd_base,len); ++ bevalue = cpu_to_be64(initrd_base); ++ memcpy(dt, &bevalue, len); + dt += (len + 3)/4; + + len = 8; +@@ -547,10 +548,10 @@ static void putnode(void) + *dt++ = cpu_to_be32(len); + *dt++ = cpu_to_be32(propnum("linux,initrd-end")); + +- initrd_end = initrd_base + initrd_size; ++ bevalue = cpu_to_be64(initrd_base + initrd_size); + pad_structure_block(len); + +- memcpy(dt,&initrd_end,len); ++ memcpy(dt, &bevalue, len); + dt += (len + 3)/4; + + reserve(initrd_base, initrd_size); diff --git a/kexec-tools-ppc64-purgatory-device-tree-values-should-be-read-stored-in-big-endian.patch b/kexec-tools-ppc64-purgatory-device-tree-values-should-be-read-stored-in-big-endian.patch new file mode 100644 index 0000000..1256e47 --- /dev/null +++ b/kexec-tools-ppc64-purgatory-device-tree-values-should-be-read-stored-in-big-endian.patch @@ -0,0 +1,45 @@ +From: Laurent Dufour +Subject: ppc64/purgatory: Device tree values should be read/stored in Big Endian +References: bnc#875485 +Git-commit: pending +Signed-off-by: Tony Jones + +The purgatory code reads the device tree's version and stores if needed the +currently running CPU number. These 2 values are stored in Big Endian +format in the device tree and should be byte swapped when running in Little +Endian mode. + +Without this fix, when running in SMP environment, kexec or kdump kernel may +fail booting with the following message : +Failed to identify boot CPU + +Signed-off-by: Laurent Dufour +--- + purgatory/arch/ppc64/v2wrap.S | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/purgatory/arch/ppc64/v2wrap.S b/purgatory/arch/ppc64/v2wrap.S +index 6fc62e3..dc5034f 100644 +--- a/purgatory/arch/ppc64/v2wrap.S ++++ b/purgatory/arch/ppc64/v2wrap.S +@@ -90,10 +90,20 @@ master: + LOADADDR(16, dt_offset) + ld 3,0(16) # load device-tree address + mr 16,3 # save dt address in reg16 ++#ifdef __BIG_ENDIAN__ + lwz 6,20(3) # fetch version number ++#else ++ li 4,20 ++ lwbrx 6,3,4 # fetch BE version number ++#endif + cmpwi 0,6,2 # v2 ? + blt 80f ++#ifdef __BIG_ENDIAN__ + stw 17,28(3) # save my cpu number as boot_cpu_phys ++#else ++ li 4,28 ++ stwbrx 17,3,4 # Store my cpu as BE value ++#endif + 80: + LOADADDR(6,opal_base) # For OPAL early debug + ld 8,0(6) # load the OPAL base address in r8 diff --git a/kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch b/kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch index 269a6d3..85b7e7a 100644 --- a/kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch +++ b/kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch @@ -1,6 +1,9 @@ From: Laurent Dufour Date: Tue, 25 Mar 2014 10:55:53 +0100 Subject: [PATCH] ppc64/purgatory: Disabling GCC's stack protection +Git-commit: 7d33c8933ebf8e1788ffff0132b6e08a2388748c +References: bnc#869161 +Signed-off-by: Tony Jones Some Linux distributions, like Suse, are turning on the GCC's stack protection mechanism by default (-fstack-protector). When building the diff --git a/kexec-tools-zero-efi-info.patch b/kexec-tools-zero-efi-info.patch index d2b2595..8b8e93e 100644 --- a/kexec-tools-zero-efi-info.patch +++ b/kexec-tools-zero-efi-info.patch @@ -1,7 +1,8 @@ From: Tony Jones Subject: Disable erroneous efi memory descriptor version message References: bnc#867785c5 -Upstream: not yet +Git-commit: 3e5443fffb2c311a61fe157be25b80de53329604 +Signed-off-by: Tony Jones On non-EFI systems, efi_info section of boot_params is zero filled resulting in an erroneous message from kexec regarding "efi memory descriptor" version. diff --git a/kexec-tools.changes b/kexec-tools.changes index 0460ab9..264b407 100644 --- a/kexec-tools.changes +++ b/kexec-tools.changes @@ -1,9 +1,25 @@ +------------------------------------------------------------------- +Thu May 1 17:47:36 UTC 2014 - tonyj@suse.com + +- Device tree values should be big endian for ppc64le (bnc#875485) + New patch: kexec-tools-ppc64-purgatory-device-tree-values-should-be-read-stored-in-big-endian.patch + +------------------------------------------------------------------- +Fri Apr 11 18:08:41 UTC 2014 - tonyj@suse.com + +- Expose flattened device trees (ppc64le) to new kexec'd kernel in Big Endian + format (bnc#873169) + New patch: kexec-tools-fs2dt-fix-endianess-issue-with-initrd-base-and-size.patch +- Update patch headers to reflect upstream commit id's: + Change patch: kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch + Change patch: kexec-tools-zero-efi-info.patch + ------------------------------------------------------------------- Tue Mar 18 16:45:14 UTC 2014 - tonyj@suse.com - Disable stack protector for ppc64le (bnc#869161) - New patch: kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch_ -- Disable erroneous (efi memory descriptor version message (bnc#867785c5) + New patch: kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch +- Disable erroneous (efi memory descriptor version) message (bnc#867785c5) New patch: kexec-tools-zero-efi-info.patch ------------------------------------------------------------------- diff --git a/kexec-tools.spec b/kexec-tools.spec index 1874c60..ed415eb 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -42,6 +42,8 @@ Patch6: %{name}-enable-aarch64-fixup.patch Patch7: %{name}-i386-bzimage_efi.patch Patch8: %{name}-ppc64-purgatory-disabling-gcc-stack-protection.patch Patch9: %{name}-zero-efi-info.patch +Patch10: %{name}-fs2dt-fix-endianess-issue-with-initrd-base-and-size.patch +Patch11: %{name}-ppc64-purgatory-device-tree-values-should-be-read-stored-in-big-endian.patch Url: ftp://kernel.org/pub/linux/utils/kernel/kexec/%{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build #!BuildIgnore: fop @@ -71,6 +73,8 @@ the loaded kernel after it panics. %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 +%patch11 -p1 %build # disable as-needed