summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cpu/minor/cpu.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cpu/minor/cpu.cc b/src/cpu/minor/cpu.cc
index aefd5599d..b49c1ecda 100644
--- a/src/cpu/minor/cpu.cc
+++ b/src/cpu/minor/cpu.cc
@@ -189,8 +189,13 @@ MinorCPU::startup()
for (auto i = threads.begin(); i != threads.end(); i ++)
(*i)->startup();
- /* CPU state setup, activate initial context */
- activateContext(0);
+ /* Workaround cases in SE mode where a thread is activated with an
+ * incorrect PC that is updated after the call to activate. This
+ * causes problems for Minor since it instantiates a virtual
+ * branch instruction when activateContext() is called which ends
+ * up pointing to an illegal address. */
+ if (threads[0]->status() == ThreadContext::Active)
+ activateContext(0);
}
DrainState