Re: [PATCH] kdump: Fix for boot problems on SMP

From: Hariprasad Nellitheertha
Date: Sat Nov 27 2004 - 01:14:37 EST


Akinobu Mita wrote:
> On Tuesday 23 November 2004 09:43, Badari Pulavarty wrote:
>
>>gdb is not showing the stack info properly, on my saved vmcore.
>>I thought vmlinux is not matching the vmcore, so I verified that
>>vmcore and vmlinux matchup. But still no luck...
>>
>># gdb ../linux-2.6.9/vmlinux vmcore.2
>
>
> [...]
>
>
>>(gdb) bt
>>#0 default_idle () at arch/i386/kernel/process.c:108
>>#1 0xc04cdff8 in init_thread_union ()
>>#2 0xc0101b86 in cpu_idle () at arch/i386/kernel/process.c:196
>>#3 0xc04cea20 in start_kernel () at init/main.c:523
>>#4 0xc0100211 in L6 () at /tmp/cch2z2jk.s:2054
>>Cannot access memory at address 0x550007
>
>
>
> I think the panic was happened on the CPU except for CPU#0.
>
> Currently vmcore contains only CPU#0's register contents.
> Therefore, GDB always shows backtrace of CPU#0.
>
>
> fs/proc/vmcore.c:
>
> static void elf_vmcore_store_hdr(char *bufp, int nphdr, int dataoff)
> {
> ...
> /* 1 - Get the registers from the reserved memory area */
> reg_ppos = BACKUP_END + CRASH_RELOCATE_SIZE;
> read_from_oldmem(reg_buf, REG_SIZE, &reg_ppos, 0);
> elf_core_copy_regs(&prstatus.pr_reg, (struct pt_regs *)reg_buf);
> buf = storenote(&notes[0], buf);
>
>
> In this place, "reg_ppos" is the pointer to the copy of relocated
> crash_smp_regs[0].
> kdump should save the "crash_smp_regs[**panic_cpu**]".
>
> Or, it is better to save all crash_smp_regs[NR_CPUS].
> In other words:

I am actually working on patches to export the registers of all
processors as elf notes sections. Similar to what multi-threaded core
dump does. This will enable gdb to correctly analyze the stack trace
on all processors.

Thanks and Regards,
Hari
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/