kexec-tools/kexec-tools-ppc-check-flags.diff

55 lines
1.8 KiB
Diff
Raw Normal View History

From: Chandru <chandru@in.ibm.com>
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 <chandru@in.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Acked-by: Bernhard Walle <bwalle@suse.de>
---
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);