diff -r fa970dd27516 -r 86c772cdcb3e src/cpu/o3/commit.hh --- a/src/cpu/o3/commit.hh Tue Jan 22 16:49:53 2013 -0500 +++ b/src/cpu/o3/commit.hh Tue Jan 22 16:49:53 2013 -0500 @@ -479,6 +479,12 @@ /** True if last committed microop can be followed by an interrupt */ bool canHandleInterrupts; + /** Have we had an interrupt pending and then seen it de-asserted because + of a masking change? In this case the variable is set and the next time + interrupts are enabled and pending the pipeline will squash to avoid + a possible livelock senario. */ + bool avoidQuiesceLiveLock; + /** Updates commit stats based on this instruction. */ void updateComInstStats(DynInstPtr &inst); diff -r fa970dd27516 -r 86c772cdcb3e src/cpu/o3/commit_impl.hh --- a/src/cpu/o3/commit_impl.hh Tue Jan 22 16:49:53 2013 -0500 +++ b/src/cpu/o3/commit_impl.hh Tue Jan 22 16:49:53 2013 -0500 @@ -103,7 +103,8 @@ numThreads(params->numThreads), drainPending(false), trapLatency(params->trapLatency), - canHandleInterrupts(true) + canHandleInterrupts(true), + avoidQuiesceLiveLock(false) { _status = Active; _nextStatus = Inactive; @@ -730,6 +731,7 @@ "it got handled. Restart fetching from the orig path.\n"); toIEW->commitInfo[0].clearInterrupt = true; interrupt = NoFault; + avoidQuiesceLiveLock = true; return; } @@ -761,6 +763,7 @@ generateTrapEvent(0); interrupt = NoFault; + avoidQuiesceLiveLock = false; } else { DPRINTF(Commit, "Interrupt pending: instruction is %sin " "flight, ROB is %sempty\n", @@ -1060,6 +1063,18 @@ "PC skip function event, stopping commit\n"); break; } + + // Check if an instruction just enabled interrupts and we've + // previously had an interrupt pending that was not handled + // because interrupts were subsequently disabled before the + // pipeline reached a place to handle the interrupt. In that + // case squash now to make sure the interrupt is handled. + // + // If we don't do this, we might end up in a live lock situation + if (!interrupt && avoidQuiesceLiveLock && + (!head_inst->isMicroop() || head_inst->isLastMicroop()) && + cpu->checkInterrupts(cpu->tcBase(0))) + squashAfter(tid, head_inst); } else { DPRINTF(Commit, "Unable to commit head instruction PC:%s " "[tid:%i] [sn:%i].\n",