From a898b6cc70e1a32494d474620e40076fa5741125 Mon Sep 17 00:00:00 2001 From: Jack Rosenthal Date: Mon, 11 Mar 2019 17:37:28 -0600 Subject: minute-ia: Print panic info on processor exception This adds appropriate x86 exception handlers to print helpful panic info when a processor exception occurs. An example is shown below: > rw 0xFFFFFFFF 0xDEADBEEF write 0xffffffff = 0xdeadbeef ========== PANIC ========== General Protection Fault Error Code = 0xFF010000 EIP = 0xFF006363 CS = 0x00000008 EFLAGS = 0x00010202 EAX = 0x00000060 EBX = 0xDEADBEEF ECX = 0xFF01519F EDX = 0x00103085 ESI = 0xFF015280 EDI = 0xFFFFFFFF Resetting system... =========================== In addition, this fixes a bug with get_current_vector_number, causing it to return 0x100 when ISR=0. BUG=b:126691187,b:128444630 BRANCH=none TEST=loaded onto arcada using ISH shim loader, used memory access and divide by zero instructions to trigger a processor exception Change-Id: Ibd58e6cb3a28b4d9cf3aa7bfb0f13d4f6fdbb77e Signed-off-by: Jack Rosenthal Reviewed-on: https://chromium-review.googlesource.com/1515949 Reviewed-by: Jett Rink --- core/minute-ia/task.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/minute-ia/task.c') diff --git a/core/minute-ia/task.c b/core/minute-ia/task.c index 9975cc62d7..62481d96f0 100644 --- a/core/minute-ia/task.c +++ b/core/minute-ia/task.c @@ -269,6 +269,8 @@ void __keep task_start_irq_handler(void *unused) * pre-empted. */ uint32_t t = get_time().le.lo; + + /* ISR is occasionally zero, see b:128444630 */ uint32_t vector = get_current_interrupt_vector(); int irq = VEC_TO_IRQ(vector); -- cgit v1.2.1