From b2c9f7c0496b50b810157560464580d0810f29c370a1edcd86e79636d92c9094 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 24 Oct 2008 13:50:16 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kexec-tools?expand=0&rev=60 --- kexec-tools-ppc-check-flags.diff | 54 ++++++++++++++++++++++++++++++++ kexec-tools.changes | 6 ++++ kexec-tools.spec | 7 ++++- 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 kexec-tools-ppc-check-flags.diff diff --git a/kexec-tools-ppc-check-flags.diff b/kexec-tools-ppc-check-flags.diff new file mode 100644 index 0000000..e790860 --- /dev/null +++ b/kexec-tools-ppc-check-flags.diff @@ -0,0 +1,54 @@ +From: Chandru +Subject: kdump: check flags field from drconf memory +References: bnc#438086 +X-Git-Id: 802a8a5e396e06a514251c44454c982bff3c5073 + +On a powerpc machine when memory is dynamically removed/added from an lpar, the +corresponding flags field in the drconf memory reflects the same with the bits +unset/set accordingly. The kernel does a check on these flags while booting. +Following are the similar changes brought in to kexec-tools. This makes +kexec-tools to skip those memory regions that do not belong or are not +assigned to the current partition ( but are available to dynamically add them +back ). Without this patch (and with memory remove operation) copying vmcore +fails with error as + +Copying data : [ 84 %] readmem: Can't read the dump +memory(/proc/vmcore). Bad address +read_pfn: Can't get the page data. + + +Signed-off-by : Chandru S +Signed-off-by: Simon Horman +Acked-by: Bernhard Walle + +--- + kexec/arch/ppc64/crashdump-ppc64.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/kexec/arch/ppc64/crashdump-ppc64.c ++++ b/kexec/arch/ppc64/crashdump-ppc64.c +@@ -124,7 +124,7 @@ static void exclude_crash_region(uint64_ + static int get_dyn_reconf_crash_memory_ranges() + { + uint64_t start, end; +- char fname[128], buf[32]; ++ char fname[128], buf[32], flags; + FILE *file; + int i, n; + +@@ -152,6 +152,13 @@ static int get_dyn_reconf_crash_memory_r + + start = ((uint64_t *)buf)[0]; + end = start + lmb_size; ++ ++ flags = buf[23]; ++ /* skip this block if the reserved bit is set in flags (0x80) ++ or if the memory region is not assigned to this partition (0x8) */ ++ if ((flags & 0x80) || !(flags & 0x8)) ++ continue; ++ + if (start == 0 && end >= (BACKUP_SRC_END + 1)) + start = BACKUP_SRC_END + 1; + exclude_crash_region(start, end); + + diff --git a/kexec-tools.changes b/kexec-tools.changes index 7912bd6..e83a473 100644 --- a/kexec-tools.changes +++ b/kexec-tools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Oct 24 14:17:21 CEST 2008 - bwalle@suse.de + +- Check for reserved and assigned bit flags on the memory regions + (bnc#438086). + ------------------------------------------------------------------- Sat Oct 18 22:25:59 CEST 2008 - bwalle@suse.de diff --git a/kexec-tools.spec b/kexec-tools.spec index cd55d2b..ad6e202 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -29,7 +29,7 @@ PreReq: %insserv_prereq %fillup_prereq AutoReqProv: on Summary: Tools for fast kernel loading Version: 2.0.0 -Release: 41 +Release: 42 Source: %{name}-%{version}.tar.bz2 Source1: kexec-bootloader Source2: kexec-bootloader.8.txt @@ -44,6 +44,7 @@ Patch6: %{name}-crash-memory-ranges-drconf.diff Patch7: %{name}-add-usable-drconf-memory-node-to-device-tree.diff Patch8: %{name}-get-details-dynamic-reconfiguration-memory-node.diff Patch9: %{name}-device-tree-return.diff +Patch10: %{name}-ppc-check-flags.diff Url: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: zlib-devel @@ -80,6 +81,7 @@ Authors: %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 %build %{?suse_update_config -f} @@ -146,6 +148,9 @@ install -m 0755 kexec.init ${RPM_BUILD_ROOT}/etc/init.d/kexec %endif %changelog +* Fri Oct 24 2008 bwalle@suse.de +- Check for reserved and assigned bit flags on the memory regions + (bnc#438086). * Sun Oct 19 2008 bwalle@suse.de - Honor grubonce also when the 1st (== 0th) entry was chosen. * Mon Oct 13 2008 bwalle@suse.de