diff options
author | Chandru <chandru@in.ibm.com> | 2008-10-17 23:25:54 +0530 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2008-10-23 11:12:20 +1100 |
commit | 802a8a5e396e06a514251c44454c982bff3c5073 (patch) | |
tree | b28feeca95ed090eff4545f94de8030162ad7460 /kexec/arch/ppc64/crashdump-ppc64.c | |
parent | 39dd40d3e83acbe8ef2f1465e02e8d3e26e6a21d (diff) |
kdump: check flags field from drconf memory
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>
Diffstat (limited to 'kexec/arch/ppc64/crashdump-ppc64.c')
-rw-r--r-- | kexec/arch/ppc64/crashdump-ppc64.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c index 00031b6..412db8f 100644 --- a/kexec/arch/ppc64/crashdump-ppc64.c +++ b/kexec/arch/ppc64/crashdump-ppc64.c @@ -127,6 +127,7 @@ static int get_dyn_reconf_crash_memory_ranges(void) char fname[128], buf[32]; FILE *file; int i, n; + uint32_t flags; strcpy(fname, "/proc/device-tree/"); strcat(fname, "ibm,dynamic-reconfiguration-memory/ibm,dynamic-memory"); @@ -150,10 +151,17 @@ static int get_dyn_reconf_crash_memory_ranges(void) return -1; } - start = ((uint64_t *)buf)[0]; + start = ((uint64_t *)buf)[DRCONF_ADDR]; end = start + lmb_size; if (start == 0 && end >= (BACKUP_SRC_END + 1)) start = BACKUP_SRC_END + 1; + + flags = (*((uint32_t *)&buf[DRCONF_FLAGS])); + /* skip this block if the reserved bit is set in flags (0x80) + or if the block is not assigned to this partition (0x8) */ + if ((flags & 0x80) || !(flags & 0x8)) + continue; + exclude_crash_region(start, end); } fclose(file); |