summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Lan <jlan@sgi.com>2008-09-19 19:17:05 -0700
committerSimon Horman <horms@verge.net.au>2008-10-23 10:59:04 +1100
commit39dd40d3e83acbe8ef2f1465e02e8d3e26e6a21d (patch)
treed88b2113e0c33ee5cfb17d0536a78e49b328d152
parenta96b5c237919e6761260efa83cc6f9d455c25ac1 (diff)
IA64: better calculate PT_LOAD segment size
This patch combines consecutive PL_LOAD segments into one. The end address of the last PL_LOAD segment, calculated by adding p_memsz to p_paddr & rounded up to ELF_PAGE_SIZE, will be the end address of this loaded_segments[] entry. This patch fixes the kdump kernel MCA problem caused by under- allocation of memory and a "kdump broken on ALtix 350" problem reported by Bernhard Walle. Simon, this patch replaces my previous patch I submitted on the underallocation issue. Signed-off-by: Jay Lan <jlan@sgi.com> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/arch/ia64/crashdump-ia64.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/kexec/arch/ia64/crashdump-ia64.c b/kexec/arch/ia64/crashdump-ia64.c
index 9a9053a..82c95d0 100644
--- a/kexec/arch/ia64/crashdump-ia64.c
+++ b/kexec/arch/ia64/crashdump-ia64.c
@@ -86,19 +86,20 @@ static void add_loaded_segments_info(struct kexec_info *info,
loaded_segments[loaded_segments_num].end =
loaded_segments[loaded_segments_num].start;
+ /* Consolidate consecutive PL_LOAD segments into one.
+ * The end addr of the last PL_LOAD segment, calculated by
+ * adding p_memsz to p_paddr & rounded up to ELF_PAGE_SIZE,
+ * will be the end address of this loaded_segments entry.
+ */
while (i < ehdr->e_phnum) {
phdr = &ehdr->e_phdr[i];
if (phdr->p_type != PT_LOAD)
break;
- if (loaded_segments[loaded_segments_num].end !=
- phdr->p_paddr & ~(ELF_PAGE_SIZE-1))
- break;
- loaded_segments[loaded_segments_num].end +=
- (phdr->p_memsz + ELF_PAGE_SIZE - 1) &
- ~(ELF_PAGE_SIZE - 1);
+ loaded_segments[loaded_segments_num].end =
+ (phdr->p_paddr + phdr->p_memsz +
+ ELF_PAGE_SIZE - 1) & ~(ELF_PAGE_SIZE - 1);
i++;
}
-
loaded_segments_num++;
}
}