14
0
forked from pool/crash
Files
crash/crash-sles9-quirk.patch

76 lines
2.6 KiB
Diff
Raw Permalink Normal View History

From: Bernhard Walle <bwalle@suse.de>
Subject: [PATCH] Add quirk for SLES9 LKCD header
Upstream: never
On SLES9, we have a different header on IA64:
SLES 10:
typedef struct __dump_header_asm {
uint64_t dha_magic_number;
uint32_t dha_version;
uint32_t dha_header_size;
uint64_t dha_pt_regs;
struct pt_regs dha_regs;
uint64_t dha_rnat;
uint64_t dha_pfs;
uint64_t dha_bspstore;
uint32_t dha_smp_num_cpus;
uint32_t dha_dumping_cpu;
struct pt_regs dha_smp_regs[NR_CPUS];
uint64_t dha_smp_current_task[NR_CPUS];
uint64_t dha_stack[NR_CPUS];
uint64_t dha_stack_ptr[NR_CPUS];
uint64_t dha_kernel_addr;
} __attribute__((packed)) dump_header_asm_t;
SLES 9:
typedef struct __dump_header_asm {
uint64_t dha_magic_number;
uint32_t dha_version;
uint32_t dha_header_size;
uint64_t dha_kernel_addr;
uint64_t dha_pt_regs;
struct pt_regs dha_regs;
uint64_t dha_rnat;
uint64_t dha_pfs;
uint64_t dha_bspstore;
uint32_t dha_smp_num_cpus;
uint32_t dha_dumping_cpu;
struct pt_regs dha_smp_regs[NR_CPUS];
uint64_t dha_smp_current_task[NR_CPUS];
uint64_t dha_stack[NR_CPUS];
uint64_t dha_stack_ptr[NR_CPUS];
} __attribute__((packed)) dump_header_asm_t;
That patch tries to guess if it's a SLES 9 or a SLES 10 header
at runtime.
Signed-off-by: Bernhard Walle <bwalle@suse.de>
---
lkcd_v8.c | 11 +++++++++++
1 file changed, 11 insertions(+)
Accepting request 214996 from home:dmair:branches:Kernel:kdump - Implementation of 7.0.4 from upstream and patch refresh. - Fix for the "ps" command's display of per-task RSS and %MEM values in Linux 2.6.34 and later kernels in which SPLIT_RSS_COUNTING is enabled. Without the patch, the values are only taken from each task's mm_struct.rss_stat structure, which may contain stale values because they may not be synchronized with the RSS values stored in each per-thread task_struct.rss_stat structure; this may lead to invalid or slightly low RSS values, and worst-case, the %MEM value may show garbage percentage values. (vinayakm.list@gmail.com) - Addressed a few (harmless) Coverity Scan complaints in diskdump.c: 1579:dead_error_line – Execution cannot reach this expression ""|"" inside statement "fprintf(fp, "%sDUMP_DH_COMP...". 1574:dead_error_line – Execution cannot reach this expression ""|"" inside statement "fprintf(fp, "%sDUMP_HEADER_...". 1571:dead_error_line – Execution cannot reach this expression ""|"" inside statement "fprintf(fp, "%sDUMP_HEADER_...". (anderson@redhat.com) - Addressed two warnings when compiling diskdump.c on 32-bit architectures when the snappy library is built in: diskdump.c:1046: warning: passing argument 3 of 'snappy_uncompressed_length' from incompatible pointer type /usr/include/snappy-c.h:120: note: expected ‘size_t *’ but argument is of type ‘ulong *’ diskdump.c:1056: warning: passing argument 4 of ‘snappy_uncompress’ from incompatible pointer type /usr/include/snappy-c.h:103: note: expected ‘size_t *’ but argument is of type ‘ulong *’ (anderson@redhat.com) - Created a simpler interface with the internal do_list() function. OBS-URL: https://build.opensuse.org/request/show/214996 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/crash?expand=0&rev=227
2014-01-24 08:29:46 +00:00
--- a/lkcd_v8.c
+++ b/lkcd_v8.c
@@ -130,6 +130,17 @@ lkcd_dump_init_v8_arch(dump_header_t *dh
goto err;
}
+#if IA64
+ /* SLES9 on IA64? */
+ if ( *((uint64_t *)(hdr_buf + hdr_size - sizeof(uint64_t))) <= NR_CPUS) {
+ uint64_t kernel_addr;
+ kernel_addr = ((dump_header_asm_t *)hdr_buf)->dha_pt_regs;
+ memmove(hdr_buf + offsetof(dump_header_asm_t, dha_pt_regs),
+ hdr_buf + offsetof(dump_header_asm_t, dha_regs),
+ hdr_size - offsetof(dump_header_asm_t, dha_regs));
+ *((uint64_t *)(hdr_buf + hdr_size - sizeof(uint64_t))) = kernel_addr;
+ }
+#endif
/*
* Though we have KL_NR_CPUS is 128, the header size is different