coreboot: Dump memory around problem area when encountering exception
When we encounter an x86 exception, we print the problem address, dump the registers and die. This may not be sufficient information for debug. Also dump the memory around the problem instruction. This has proven useful in identifying memory issues, and DRAM burst reordering problems. Change-Id: I6411344e89f946e16d11217d7dbd73812c45d54c Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/1454 Tested-by: build bot (Jenkins) Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
This commit is contained in:
parent
811d661f3a
commit
de415ebdd6
|
@ -475,6 +475,7 @@ void x86_exception(struct eregs *info)
|
||||||
put_packet(out_buffer);
|
put_packet(out_buffer);
|
||||||
}
|
}
|
||||||
#else /* !CONFIG_GDB_STUB */
|
#else /* !CONFIG_GDB_STUB */
|
||||||
|
#define MDUMP_SIZE 0x80
|
||||||
printk(BIOS_EMERG,
|
printk(BIOS_EMERG,
|
||||||
"Unexpected Exception: %d @ %02x:%08x - Halting\n"
|
"Unexpected Exception: %d @ %02x:%08x - Halting\n"
|
||||||
"Code: %d eflags: %08x\n"
|
"Code: %d eflags: %08x\n"
|
||||||
|
@ -484,6 +485,18 @@ void x86_exception(struct eregs *info)
|
||||||
info->error_code, info->eflags,
|
info->error_code, info->eflags,
|
||||||
info->eax, info->ebx, info->ecx, info->edx,
|
info->eax, info->ebx, info->ecx, info->edx,
|
||||||
info->edi, info->esi, info->ebp, info->esp);
|
info->edi, info->esi, info->ebp, info->esp);
|
||||||
|
u8 *code = (u8*)((u32)info->eip - (MDUMP_SIZE >>1));
|
||||||
|
/* Align to 8-byte boundary please, and print eight bytes per row.
|
||||||
|
* This is done to make DRAM burst timing/reordering errors more
|
||||||
|
* evident from the looking at the dump */
|
||||||
|
code = (u8*)((u32)code & ~0x7);
|
||||||
|
int i;
|
||||||
|
for(i = 0; i < MDUMP_SIZE; i++)
|
||||||
|
{
|
||||||
|
if( (i & 0x07) == 0 )
|
||||||
|
printk(BIOS_EMERG, "\n%.8x:\t", (int)code + i );
|
||||||
|
printk(BIOS_EMERG, "%.2x ", code[i]);
|
||||||
|
}
|
||||||
die("");
|
die("");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue