Hi,
This patch uses the kernel start address from the dump header on IA64
instead of the default value. This has been reported as bug on a SGI
machine -- lcrash was able to open the dump because it uses the start
address of the header, crash was not.
Troy, ACK?
Dave: That's my last LKCD patch for now. ;-)
Signed-off-by: Bernhard Walle <bwalle(a)suse.de>
---
defs.h | 2 ++
ia64.c | 11 ++++++++++-
lkcd_common.c | 21 +++++++++++++++++++++
lkcd_fix_mem.c | 10 ++++++++++
4 files changed, 43 insertions(+), 1 deletion(-)
--- a/defs.h
+++ b/defs.h
@@ -3874,6 +3874,7 @@ int fix_addr_v8(struct _dump_header_asm_
int lkcd_dump_init_v8_arch(struct _dump_header_s *dh);
int fix_addr_v7(int);
int get_lkcd_regs_for_cpu_arch(int cpu, ulong *eip, ulong *esp);
+int lkcd_get_kernel_start_v8(ulong *addr);
/*
* lkcd_v8.c
@@ -4144,6 +4145,7 @@ int lkcd_load_dump_page_header(void *, u
void lkcd_dumpfile_complaint(uint32_t, uint32_t, int);
int set_mb_benchmark(ulong);
ulonglong fix_lkcd_address(ulonglong);
+int lkcd_get_kernel_start(ulong *addr);
int get_lkcd_regs_for_cpu(struct bt_info *bt, ulong *eip, ulong *esp);
/*
--- a/ia64.c
+++ b/ia64.c
@@ -3810,7 +3810,16 @@ ia64_calc_phys_start(void)
phys_start);
}
return;
- }
+ } else if (LKCD_DUMPFILE()) {
+
+ if (lkcd_get_kernel_start(&phys_start)) {
+ machdep->machspec->phys_start = phys_start;
+ if (CRASHDEBUG(1))
+ fprintf(fp,
+ "LKCD dump: phys_start: %lx\n",
+ phys_start);
+ }
+ }
if ((vd = get_kdump_vmcore_data())) {
/*
--- a/lkcd_common.c
+++ b/lkcd_common.c
@@ -787,6 +787,27 @@ get_offset(uint64_t paddr)
}
+#ifdef IA64
+
+int
+lkcd_get_kernel_start(ulong *addr)
+{
+ if (!addr)
+ return 0;
+
+ switch (lkcd->version)
+ {
+ case LKCD_DUMP_V8:
+ case LKCD_DUMP_V9:
+ return lkcd_get_kernel_start_v8(addr);
+
+ default:
+ return 0;
+ }
+}
+
+#endif
+
int
lkcd_lseek(physaddr_t paddr)
--- a/lkcd_fix_mem.c
+++ b/lkcd_fix_mem.c
@@ -97,4 +97,14 @@ get_lkcd_switch_stack(ulong task)
return 0;
}
+int lkcd_get_kernel_start_v8(ulong *addr)
+{
+ if (!addr)
+ return 0;
+
+ *addr = ((dump_header_asm_t *)lkcd->dump_header_asm)->dha_kernel_addr;
+
+ return 1;
+}
+
#endif // IA64