summaryrefslogtreecommitdiffstats
path: root/src/kernel
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2016-05-16 11:22:18 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-05-24 17:09:33 -0400
commit39c834621810eac50a7b34a94a90a840dcdb58d9 (patch)
treef215055b8565eebee4944aa5646925ad85336863 /src/kernel
parentc518fff3c3a71c3a9944a4b2e8ca7ac776cd8eb1 (diff)
downloadtalos-hostboot-39c834621810eac50a7b34a94a90a840dcdb58d9.tar.gz
talos-hostboot-39c834621810eac50a7b34a94a90a840dcdb58d9.zip
Add simics breakpoint for exceptions
Created a new magic instruction handler that can be enabled via environment variable to stop the simulation for Hostboot exceptions. This is useful when we want to get a backtrace at the failing spot without recompiling code or having to manually insert breakpoints in simics directly. Enable the function by setting HB_BREAK_ON_ERROR The trigger call is MAGIC_BREAK_ON_ERROR Change-Id: I17e008281d010e3f8c5e5817e5f30fd0ccb624d0 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24600 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-by: Marshall J. Wilks <mjwilks@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/exception.C10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/kernel/exception.C b/src/kernel/exception.C
index 686d3012c..5b891ff63 100644
--- a/src/kernel/exception.C
+++ b/src/kernel/exception.C
@@ -63,6 +63,7 @@ void kernel_execute_prog_ex()
if (!handled)
{
printk("Program exception, killing task %d\n", t->tid);
+ MAGIC_INSTRUCTION(MAGIC_BREAK_ON_ERROR);
TaskManager::endTask(t, NULL, TASK_STATUS_CRASHED);
}
}
@@ -102,6 +103,7 @@ void kernel_execute_data_storage()
{
printk("Data Storage exception on %d: %lx, %lx @ %p\n",
t->tid, getDAR(), getDSISR(), t->context.nip);
+ MAGIC_INSTRUCTION(MAGIC_BREAK_ON_ERROR);
TaskManager::endTask(t, NULL, TASK_STATUS_CRASHED);
}
}
@@ -112,6 +114,7 @@ void kernel_execute_data_segment()
task_t* t = TaskManager::getCurrentTask();
printk("Data Segment exception on %d: %lx @ %p\n",
t->tid, getDAR(), t->context.nip);
+ MAGIC_INSTRUCTION(MAGIC_BREAK_ON_ERROR);
TaskManager::endTask(t, NULL, TASK_STATUS_CRASHED);
}
@@ -135,6 +138,7 @@ void kernel_execute_inst_storage()
{
printk("Inst Storage exception on %d: %lx, %lx\n",
t->tid, getSRR0(), getSRR1());
+ MAGIC_INSTRUCTION(MAGIC_BREAK_ON_ERROR);
TaskManager::endTask(t, NULL, TASK_STATUS_CRASHED);
}
}
@@ -144,6 +148,7 @@ void kernel_execute_inst_segment()
{
task_t* t = TaskManager::getCurrentTask();
printk("Inst Segment exception on %d: %p\n", t->tid, t->context.nip);
+ MAGIC_INSTRUCTION(MAGIC_BREAK_ON_ERROR);
TaskManager::endTask(t, NULL, TASK_STATUS_CRASHED);
}
@@ -152,6 +157,7 @@ void kernel_execute_alignment()
{
task_t* t = TaskManager::getCurrentTask();
printk("Alignment exception, killing task %d\n", t->tid);
+ MAGIC_INSTRUCTION(MAGIC_BREAK_ON_ERROR);
TaskManager::endTask(t, NULL, TASK_STATUS_CRASHED);
}
@@ -161,6 +167,7 @@ void kernel_execute_hype_emu_assist()
task_t* t = TaskManager::getCurrentTask();
printk("HypeEmu: Illegal instruction in task %d\n"
"\tHSSR0 = %lx, HEIR = %lx\n", t->tid, getHSRR0(), getHEIR());
+ MAGIC_INSTRUCTION(MAGIC_BREAK_ON_ERROR);
TaskManager::endTask(t, NULL, TASK_STATUS_CRASHED);
}
@@ -311,6 +318,7 @@ void kernel_execute_machine_check()
"\tDSISR = %lx, DAR = %lx\n",
t->tid, getPIR(),
getSRR0(), getSRR1(), getDSISR(), getDAR());
+ MAGIC_INSTRUCTION(MAGIC_BREAK_ON_ERROR);
kassert(false);
}
@@ -366,6 +374,7 @@ void kernel_execute_machine_check()
"\tDSISR = %lx, DAR = %lx\n",
t->tid, getPIR(),
getSRR0(), getSRR1(), getDSISR(), getDAR());
+ MAGIC_INSTRUCTION(MAGIC_BREAK_ON_ERROR);
TaskManager::endTask(t, NULL, TASK_STATUS_CRASHED);
}
}
@@ -388,6 +397,7 @@ void kernel_execute_unhandled_exception()
printk("Unhandled exception %lx by task %d @ %p\n",
exception, t->tid, t->context.nip);
+ MAGIC_INSTRUCTION(MAGIC_BREAK_ON_ERROR);
termWriteSRC(TI_UNHANDLED_EX, RC_UNHANDLED_EX, exception);
terminateExecuteTI();
OpenPOWER on IntegriCloud