diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/checker/cpu_impl.hh --- a/src/cpu/checker/cpu_impl.hh Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/checker/cpu_impl.hh Thu Dec 06 14:48:46 2012 -0500 @@ -574,12 +574,12 @@ "registers from main CPU", curTick(), unverifiedInst->instAddr()); // Terribly convoluted way to make sure O3 model does not implode - bool inSyscall = unverifiedInst->thread->inSyscall; - unverifiedInst->thread->inSyscall = true; + bool no_squash_from_TC = unverifiedInst->thread->noSquashFromTC; + unverifiedInst->thread->noSquashFromTC = true; // Heavy-weight copying of all registers thread->copyArchRegs(unverifiedInst->tcBase()); - unverifiedInst->thread->inSyscall = inSyscall; + unverifiedInst->thread->noSquashFromTC = no_squash_from_TC; // Set curStaticInst to unverifiedInst->staticInst curStaticInst = unverifiedInst->staticInst; diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/inorder/cpu.cc --- a/src/cpu/inorder/cpu.cc Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/inorder/cpu.cc Thu Dec 06 14:48:46 2012 -0500 @@ -786,9 +786,9 @@ BaseCPU::init(); for (ThreadID tid = 0; tid < numThreads; ++tid) { - // Set inSyscall so that the CPU doesn't squash when initially + // Set noSquashFromTC so that the CPU doesn't squash when initially // setting up registers. - thread[tid]->inSyscall = true; + thread[tid]->noSquashFromTC = true; // Initialise the ThreadContext's memory proxies thread[tid]->initMemProxies(thread[tid]->getTC()); } @@ -800,9 +800,9 @@ } } - // Clear inSyscall. + // Clear noSquashFromTC. for (ThreadID tid = 0; tid < numThreads; ++tid) - thread[tid]->inSyscall = false; + thread[tid]->noSquashFromTC = false; // Call Initializiation Routine for Resource Pool resPool->init(); diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/inorder/inorder_dyn_inst.cc --- a/src/cpu/inorder/inorder_dyn_inst.cc Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/inorder/inorder_dyn_inst.cc Thu Dec 06 14:48:46 2012 -0500 @@ -220,12 +220,12 @@ // when using the TC during an instruction's execution // (specifically for instructions that have side-effects that use // the TC). Fix this. - bool in_syscall = this->thread->inSyscall; - this->thread->inSyscall = true; + bool no_squash_from_TC = this->thread->noSquashFromTC; + this->thread->noSquashFromTC = true; this->fault = this->staticInst->execute(this, this->traceData); - this->thread->inSyscall = in_syscall; + this->thread->noSquashFromTC = no_squash_from_TC; return this->fault; } @@ -244,12 +244,12 @@ // when using the TC during an instruction's execution // (specifically for instructions that have side-effects that use // the TC). Fix this. - bool in_syscall = this->thread->inSyscall; - this->thread->inSyscall = true; + bool no_squash_from_TC = this->thread->noSquashFromTC; + this->thread->noSquashFromTC = true; this->fault = this->staticInst->initiateAcc(this, this->traceData); - this->thread->inSyscall = in_syscall; + this->thread->noSquashFromTC = no_squash_from_TC; return this->fault; } diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/inorder/thread_context.cc --- a/src/cpu/inorder/thread_context.cc Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/inorder/thread_context.cc Thu Dec 06 14:48:46 2012 -0500 @@ -90,10 +90,10 @@ copyArchRegs(old_context); thread->funcExeInst = old_context->readFuncExeInst(); - + old_context->setStatus(ThreadContext::Halted); - thread->inSyscall = false; + thread->noSquashFromTC = false; thread->trapPending = false; } @@ -159,7 +159,7 @@ void InOrderThreadContext::unserialize(Checkpoint *cp, const std::string §ion) { - panic("unserialize unimplemented"); + panic("unserialize unimplemented"); } diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/inorder/thread_state.hh --- a/src/cpu/inorder/thread_state.hh Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/inorder/thread_state.hh Thu Dec 06 14:48:46 2012 -0500 @@ -61,10 +61,15 @@ InOrderCPU *cpu; public: - /** Whether or not the thread is currently in syscall mode, and - * thus able to be externally updated without squashing. + /* This variable controls if writes to a thread context should cause a all + * dynamic/speculative state to be thrown away. Nominally this is the + * desired behavior because the external thread context write has updated + * some state that could be used by an inflight instruction, however there + * are some cases like in a fault/trap handler where this behavior would + * lead to successive restarts and forward progress couldn't be made. This + * variable controls if the squashing will occur. */ - bool inSyscall; + bool noSquashFromTC; /** Whether or not the thread is currently waiting on a trap, and * thus able to be externally updated without squashing. @@ -75,7 +80,8 @@ Process *_process) : ThreadState(reinterpret_cast(_cpu), _thread_num, _process), - cpu(_cpu), inSyscall(0), trapPending(0), lastGradIsBranch(false) + cpu(_cpu), noSquashFromTC(false), trapPending(false), + lastGradIsBranch(false) { } /** Handles the syscall. */ diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/o3/commit_impl.hh --- a/src/cpu/o3/commit_impl.hh Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/o3/commit_impl.hh Thu Dec 06 14:48:46 2012 -0500 @@ -559,7 +559,7 @@ DPRINTF(Commit, "Squashing from trap, restarting at PC %s\n", pc[tid]); thread[tid]->trapPending = false; - thread[tid]->inSyscall = false; + thread[tid]->noSquashFromTC = false; trapInFlight[tid] = false; trapSquash[tid] = false; @@ -576,7 +576,7 @@ DPRINTF(Commit, "Squashing from TC, restarting at PC %s\n", pc[tid]); - thread[tid]->inSyscall = false; + thread[tid]->noSquashFromTC = false; assert(!thread[tid]->trapPending); commitStatus[tid] = ROBSquashing; @@ -721,8 +721,8 @@ // Clear the interrupt now that it's going to be handled toIEW->commitInfo[0].clearInterrupt = true; - assert(!thread[0]->inSyscall); - thread[0]->inSyscall = true; + assert(!thread[0]->noSquashFromTC); + thread[0]->noSquashFromTC = true; if (cpu->checker) { cpu->checker->handlePendingInt(); @@ -731,7 +731,7 @@ // CPU will handle interrupt. cpu->processInterrupts(interrupt); - thread[0]->inSyscall = false; + thread[0]->noSquashFromTC = false; commitStatus[0] = TrapPending; @@ -1014,7 +1014,7 @@ Addr oldpc; // Debug statement. Checks to make sure we're not // currently updating state while handling PC events. - assert(!thread[tid]->inSyscall && !thread[tid]->trapPending); + assert(!thread[tid]->noSquashFromTC && !thread[tid]->trapPending); do { oldpc = pc[tid].instAddr(); cpu->system->pcEventQueue.service(thread[tid]->getTC()); @@ -1140,11 +1140,11 @@ cpu->checker->verify(head_inst); } - assert(!thread[tid]->inSyscall); + assert(!thread[tid]->noSquashFromTC); // Mark that we're in state update mode so that the trap's // execution doesn't generate extra squashes. - thread[tid]->inSyscall = true; + thread[tid]->noSquashFromTC = true; // Execute the trap. Although it's slightly unrealistic in // terms of timing (as it doesn't wait for the full timing of @@ -1155,7 +1155,7 @@ cpu->trap(inst_fault, tid, head_inst->staticInst); // Exit state update mode to avoid accidental updating. - thread[tid]->inSyscall = false; + thread[tid]->noSquashFromTC = false; commitStatus[tid] = TrapPending; diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/o3/cpu.cc --- a/src/cpu/o3/cpu.cc Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/o3/cpu.cc Thu Dec 06 14:48:46 2012 -0500 @@ -644,9 +644,9 @@ BaseCPU::init(); for (ThreadID tid = 0; tid < numThreads; ++tid) { - // Set inSyscall so that the CPU doesn't squash when initially + // Set noSquashFromTC so that the CPU doesn't squash when initially // setting up registers. - thread[tid]->inSyscall = true; + thread[tid]->noSquashFromTC = true; // Initialise the ThreadContext's memory proxies thread[tid]->initMemProxies(thread[tid]->getTC()); } @@ -665,9 +665,9 @@ } } - // Clear inSyscall. + // Clear noSquashFromTC. for (int tid = 0; tid < numThreads; ++tid) - thread[tid]->inSyscall = false; + thread[tid]->noSquashFromTC = false; // Initialize stages. fetch.initStage(); @@ -1464,7 +1464,7 @@ void FullO3CPU::squashFromTC(ThreadID tid) { - this->thread[tid]->inSyscall = true; + this->thread[tid]->noSquashFromTC = true; this->commit.generateTCEvent(tid); } diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/o3/dyn_inst.hh --- a/src/cpu/o3/dyn_inst.hh Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/o3/dyn_inst.hh Thu Dec 06 14:48:46 2012 -0500 @@ -183,14 +183,14 @@ // using the TC during an instruction's execution (specifically for // instructions that have side-effects that use the TC). Fix this. // See cpu/o3/dyn_inst_impl.hh. - bool in_syscall = this->thread->inSyscall; - this->thread->inSyscall = true; + bool no_squash_from_TC = this->thread->noSquashFromTC; + this->thread->noSquashFromTC = true; for (int i = 0; i < _numDestMiscRegs; i++) this->cpu->setMiscReg( _destMiscRegIdx[i], _destMiscRegVal[i], this->threadNumber); - this->thread->inSyscall = in_syscall; + this->thread->noSquashFromTC = no_squash_from_TC; } void forwardOldRegs() diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/o3/dyn_inst_impl.hh --- a/src/cpu/o3/dyn_inst_impl.hh Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/o3/dyn_inst_impl.hh Thu Dec 06 14:48:46 2012 -0500 @@ -130,12 +130,12 @@ // when using the TC during an instruction's execution // (specifically for instructions that have side-effects that use // the TC). Fix this. - bool in_syscall = this->thread->inSyscall; - this->thread->inSyscall = true; + bool no_squash_from_TC = this->thread->noSquashFromTC; + this->thread->noSquashFromTC = true; this->fault = this->staticInst->execute(this, this->traceData); - this->thread->inSyscall = in_syscall; + this->thread->noSquashFromTC = no_squash_from_TC; return this->fault; } @@ -148,12 +148,12 @@ // when using the TC during an instruction's execution // (specifically for instructions that have side-effects that use // the TC). Fix this. - bool in_syscall = this->thread->inSyscall; - this->thread->inSyscall = true; + bool no_squash_from_TC = this->thread->noSquashFromTC; + this->thread->noSquashFromTC = true; this->fault = this->staticInst->initiateAcc(this, this->traceData); - this->thread->inSyscall = in_syscall; + this->thread->noSquashFromTC = no_squash_from_TC; return this->fault; } @@ -166,8 +166,8 @@ // when using the TC during an instruction's execution // (specifically for instructions that have side-effects that use // the TC). Fix this. - bool in_syscall = this->thread->inSyscall; - this->thread->inSyscall = true; + bool no_squash_from_TC = this->thread->noSquashFromTC; + this->thread->noSquashFromTC = true; if (this->cpu->checker) { if (this->isStoreConditional()) { @@ -177,7 +177,7 @@ this->fault = this->staticInst->completeAcc(pkt, this, this->traceData); - this->thread->inSyscall = in_syscall; + this->thread->noSquashFromTC = no_squash_from_TC; return this->fault; } diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/o3/thread_context.hh --- a/src/cpu/o3/thread_context.hh Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/o3/thread_context.hh Thu Dec 06 14:48:46 2012 -0500 @@ -257,6 +257,16 @@ { return this->thread->quiesceEvent; } + /** check if the cpu is currently in state update mode and squash if not. + * This function will return true if a trap is pending or if a fault or + * similar is currently writing to the thread context and doesn't want + * reset all the state (see noSquashFromTC). + */ + inline void conditionalSquash() + { + if (!thread->trapPending && !thread->noSquashFromTC) + cpu->squashFromTC(thread->threadId()); + } }; diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/o3/thread_context_impl.hh --- a/src/cpu/o3/thread_context_impl.hh Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/o3/thread_context_impl.hh Thu Dec 06 14:48:46 2012 -0500 @@ -96,7 +96,7 @@ old_context->setStatus(ThreadContext::Halted); - thread->inSyscall = false; + thread->noSquashFromTC = false; thread->trapPending = false; } @@ -207,9 +207,9 @@ O3ThreadContext::copyArchRegs(ThreadContext *tc) { // Prevent squashing - thread->inSyscall = true; + thread->noSquashFromTC = true; TheISA::copyRegs(tc, this); - thread->inSyscall = false; + thread->noSquashFromTC = false; if (!FullSystem) this->thread->funcExeInst = tc->readFuncExeInst(); @@ -253,10 +253,7 @@ reg_idx = cpu->isa[thread->threadId()].flattenIntIndex(reg_idx); cpu->setArchIntReg(reg_idx, val, thread->threadId()); - // Squash if we're not already in a state update mode. - if (!thread->trapPending && !thread->inSyscall) { - cpu->squashFromTC(thread->threadId()); - } + conditionalSquash(); } template @@ -266,9 +263,7 @@ reg_idx = cpu->isa[thread->threadId()].flattenFloatIndex(reg_idx); cpu->setArchFloatReg(reg_idx, val, thread->threadId()); - if (!thread->trapPending && !thread->inSyscall) { - cpu->squashFromTC(thread->threadId()); - } + conditionalSquash(); } template @@ -278,10 +273,7 @@ reg_idx = cpu->isa[thread->threadId()].flattenFloatIndex(reg_idx); cpu->setArchFloatRegInt(reg_idx, val, thread->threadId()); - // Squash if we're not already in a state update mode. - if (!thread->trapPending && !thread->inSyscall) { - cpu->squashFromTC(thread->threadId()); - } + conditionalSquash(); } template @@ -290,10 +282,7 @@ { cpu->pcState(val, thread->threadId()); - // Squash if we're not already in a state update mode. - if (!thread->trapPending && !thread->inSyscall) { - cpu->squashFromTC(thread->threadId()); - } + conditionalSquash(); } template @@ -302,10 +291,7 @@ { cpu->pcState(val, thread->threadId()); - // Squash if we're not already in a state update mode. - if (!thread->trapPending && !thread->inSyscall) { - cpu->squashFromTC(thread->threadId()); - } + conditionalSquash(); } template @@ -328,10 +314,7 @@ { cpu->setMiscRegNoEffect(misc_reg, val, thread->threadId()); - // Squash if we're not already in a state update mode. - if (!thread->trapPending && !thread->inSyscall) { - cpu->squashFromTC(thread->threadId()); - } + conditionalSquash(); } template @@ -340,9 +323,6 @@ { cpu->setMiscReg(misc_reg, val, thread->threadId()); - // Squash if we're not already in a state update mode. - if (!thread->trapPending && !thread->inSyscall) { - cpu->squashFromTC(thread->threadId()); - } + conditionalSquash(); } diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/o3/thread_state.hh --- a/src/cpu/o3/thread_state.hh Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/o3/thread_state.hh Thu Dec 06 14:48:46 2012 -0500 @@ -61,10 +61,15 @@ /** Pointer to the CPU. */ O3CPU *cpu; public: - /** Whether or not the thread is currently in syscall mode, and - * thus able to be externally updated without squashing. + /* This variable controls if writes to a thread context should cause a all + * dynamic/speculative state to be thrown away. Nominally this is the + * desired behavior because the external thread context write has updated + * some state that could be used by an inflight instruction, however there + * are some cases like in a fault/trap handler where this behavior would + * lead to successive restarts and forward progress couldn't be made. This + * variable controls if the squashing will occur. */ - bool inSyscall; + bool noSquashFromTC; /** Whether or not the thread is currently waiting on a trap, and * thus able to be externally updated without squashing. @@ -73,7 +78,7 @@ O3ThreadState(O3CPU *_cpu, int _thread_num, Process *_process) : ThreadState(_cpu, _thread_num, _process), - cpu(_cpu), inSyscall(0), trapPending(0) + cpu(_cpu), noSquashFromTC(false), trapPending(false) { if (!FullSystem) return; diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/ozone/back_end_impl.hh --- a/src/cpu/ozone/back_end_impl.hh Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/ozone/back_end_impl.hh Thu Dec 06 14:48:46 2012 -0500 @@ -1513,16 +1513,16 @@ DPRINTF(BE, "Inst [sn:%lli] PC %#x has a fault\n", inst->seqNum, inst->readPC()); -// assert(!thread->inSyscall); +// assert(!thread->noSquashFromTC); -// thread->inSyscall = true; +// thread->noSquashFromTC = true; // Consider holding onto the trap and waiting until the trap event // happens for this to be executed. inst_fault->invoke(thread->getXCProxy()); // Exit state update mode to avoid accidental updating. -// thread->inSyscall = false; +// thread->noSquashFromTC = false; // commitStatus = TrapPending; @@ -1571,7 +1571,7 @@ Addr oldpc; do { if (count == 0) - assert(!thread->inSyscall && !thread->trapPending); + assert(!thread->noSquashFromTC && !thread->trapPending); oldpc = thread->readPC(); cpu->system->pcEventQueue.service( thread->getXCProxy()); diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/ozone/cpu_impl.hh --- a/src/cpu/ozone/cpu_impl.hh Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/ozone/cpu_impl.hh Thu Dec 06 14:48:46 2012 -0500 @@ -110,7 +110,7 @@ ozoneTC.cpu = this; ozoneTC.thread = &thread; - thread.inSyscall = false; + thread.noSquashFromTC = false; itb = p->itb; dtb = p->dtb; @@ -236,7 +236,7 @@ BaseCPU::takeOverFrom(oldCPU); thread.trapPending = false; - thread.inSyscall = false; + thread.noSquashFromTC = false; backEnd->takeOverFrom(); frontEnd->takeOverFrom(); @@ -375,7 +375,7 @@ BaseCPU::init(); // Mark this as in syscall so it won't need to squash - thread.inSyscall = true; + thread.noSquashFromTC = true; if (FullSystem) { for (int i = 0; i < threadContexts.size(); ++i) { ThreadContext *tc = threadContexts[i]; @@ -387,7 +387,7 @@ frontEnd->renameTable.copyFrom(thread.renameTable); backEnd->renameTable.copyFrom(thread.renameTable); - thread.inSyscall = false; + thread.noSquashFromTC = false; } template @@ -476,7 +476,7 @@ void OzoneCPU::squashFromTC() { - thread.inSyscall = true; + thread.noSquashFromTC = true; backEnd->generateTCEvent(); } @@ -487,7 +487,7 @@ // Not sure this copy is needed, depending on how the TC proxy is made. thread.renameTable.copyFrom(backEnd->renameTable); - thread.inSyscall = true; + thread.noSquashFromTC = true; thread.funcExeInst++; @@ -497,7 +497,7 @@ thread.funcExeInst--; - thread.inSyscall = false; + thread.noSquashFromTC = false; frontEnd->renameTable.copyFrom(thread.renameTable); backEnd->renameTable.copyFrom(thread.renameTable); @@ -774,7 +774,7 @@ { thread->renameTable[reg_idx]->setIntResult(val); - if (!thread->inSyscall) { + if (!thread->noSquashFromTC) { cpu->squashFromTC(); } } @@ -787,7 +787,7 @@ thread->renameTable[idx]->setDoubleResult(val); - if (!thread->inSyscall) { + if (!thread->noSquashFromTC) { cpu->squashFromTC(); } } @@ -806,7 +806,7 @@ thread->PC = val; cpu->frontEnd->setPC(val); - if (!thread->inSyscall) { + if (!thread->noSquashFromTC) { cpu->squashFromTC(); } } @@ -818,7 +818,7 @@ thread->nextPC = val; cpu->frontEnd->setNextPC(val); - if (!thread->inSyscall) { + if (!thread->noSquashFromTC) { cpu->squashFromTC(); } } @@ -844,7 +844,7 @@ // Needs to setup a squash event unless we're in syscall mode thread->miscRegFile.setRegNoEffect(misc_reg, val); - if (!thread->inSyscall) { + if (!thread->noSquashFromTC) { cpu->squashFromTC(); } } @@ -856,7 +856,7 @@ // Needs to setup a squash event unless we're in syscall mode thread->miscRegFile.setReg(misc_reg, val, this); - if (!thread->inSyscall) { + if (!thread->noSquashFromTC) { cpu->squashFromTC(); } } diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/ozone/dyn_inst_impl.hh --- a/src/cpu/ozone/dyn_inst_impl.hh Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/ozone/dyn_inst_impl.hh Thu Dec 06 14:48:46 2012 -0500 @@ -71,12 +71,12 @@ // @todo: Pretty convoluted way to avoid squashing from happening when using // the XC during an instruction's execution (specifically for instructions // that have sideeffects that use the XC). Fix this. - bool in_syscall = this->thread->inSyscall; - this->thread->inSyscall = true; + bool no_squash_from_TC = this->thread->noSquashFromTC; + this->thread->noSquashFromTC = true; this->fault = this->staticInst->execute(this, this->traceData); - this->thread->inSyscall = in_syscall; + this->thread->noSquashFromTC = no_squash_from_TC; return this->fault; } @@ -88,12 +88,12 @@ // @todo: Pretty convoluted way to avoid squashing from happening when using // the XC during an instruction's execution (specifically for instructions // that have sideeffects that use the XC). Fix this. - bool in_syscall = this->thread->inSyscall; - this->thread->inSyscall = true; + bool no_squash_from_TC = this->thread->noSquashFromTC; + this->thread->noSquashFromTC = true; this->fault = this->staticInst->initiateAcc(this, this->traceData); - this->thread->inSyscall = in_syscall; + this->thread->noSquashFromTC = no_squash_from_TC; return this->fault; } diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/ozone/inorder_back_end_impl.hh --- a/src/cpu/ozone/inorder_back_end_impl.hh Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/ozone/inorder_back_end_impl.hh Thu Dec 06 14:48:46 2012 -0500 @@ -117,7 +117,7 @@ } if (ipl && ipl > thread->readMiscRegNoEffect(IPR_IPLR)) { - thread->inSyscall = true; + thread->noSquashFromTC = true; thread->setMiscRegNoEffect(IPR_ISR, summary); thread->setMiscRegNoEffect(IPR_INTID, ipl); @@ -128,7 +128,7 @@ // May need to go 1 inst prior squashPending = true; - thread->inSyscall = false; + thread->noSquashFromTC = false; setSquashInfoFromXC(); } @@ -206,7 +206,7 @@ Addr oldpc; do { if (count == 0) - assert(!thread->inSyscall && !thread->trapPending); + assert(!thread->noSquashFromTC && !thread->trapPending); oldpc = thread->readPC(); cpu->system->pcEventQueue.service( thread->getXCProxy()); @@ -291,16 +291,16 @@ DPRINTF(IBE, "Inst [sn:%lli] PC %#x has a fault\n", inst->seqNum, inst->readPC()); - assert(!thread->inSyscall); + assert(!thread->noSquashFromTC); - thread->inSyscall = true; + thread->noSquashFromTC = true; // Consider holding onto the trap and waiting until the trap event // happens for this to be executed. inst_fault->invoke(xc); // Exit state update mode to avoid accidental updating. - thread->inSyscall = false; + thread->noSquashFromTC = false; squashPending = true; @@ -365,16 +365,16 @@ { DPRINTF(Commit, "Handling fault from fetch\n"); - assert(!thread->inSyscall); + assert(!thread->noSquashFromTC); - thread->inSyscall = true; + thread->noSquashFromTC = true; // Consider holding onto the trap and waiting until the trap event // happens for this to be executed. faultFromFetch->invoke(xc); // Exit state update mode to avoid accidental updating. - thread->inSyscall = false; + thread->noSquashFromTC = false; squashPending = true; @@ -415,8 +415,8 @@ squashPending = false; // Probably want to make sure that this squash is the one that set the - // thread into inSyscall mode. - thread->inSyscall = false; + // thread into noSquashFromTC mode. + thread->noSquashFromTC = false; // Tell front end to squash, reset PC to new one. frontEnd->squash(squash_num, next_PC); @@ -431,7 +431,7 @@ // Record that I need to squash squashPending = true; - thread->inSyscall = true; + thread->noSquashFromTC = true; } template diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/ozone/lw_back_end_impl.hh --- a/src/cpu/ozone/lw_back_end_impl.hh Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/ozone/lw_back_end_impl.hh Thu Dec 06 14:48:46 2012 -0500 @@ -531,8 +531,8 @@ // Not sure which thread should be the one to interrupt. For now // always do thread 0. - assert(!thread->inSyscall); - thread->inSyscall = true; + assert(!thread->noSquashFromTC); + thread->noSquashFromTC = true; // CPU will handle implementation of the interrupt. cpu->processInterrupts(); @@ -541,7 +541,7 @@ commitStatus = TrapPending; // Exit state update mode to avoid accidental updating. - thread->inSyscall = false; + thread->noSquashFromTC = false; // Generate trap squash event. generateTrapEvent(); @@ -559,16 +559,16 @@ { DPRINTF(BE, "Handling fault!\n"); - assert(!thread->inSyscall); + assert(!thread->noSquashFromTC); - thread->inSyscall = true; + thread->noSquashFromTC = true; // Consider holding onto the trap and waiting until the trap event // happens for this to be executed. fault->invoke(thread->getTC()); // Exit state update mode to avoid accidental updating. - thread->inSyscall = false; + thread->noSquashFromTC = false; commitStatus = TrapPending; @@ -1205,7 +1205,7 @@ Addr oldpc; do { if (count == 0) - assert(!thread->inSyscall && !thread->trapPending); + assert(!thread->noSquashFromTC && !thread->trapPending); oldpc = thread->readPC(); cpu->system->pcEventQueue.service( thread->getTC()); @@ -1357,7 +1357,7 @@ frontEnd->interruptPending = false; thread->trapPending = false; - thread->inSyscall = false; + thread->noSquashFromTC = false; tcSquash = false; commitStatus = Running; } @@ -1373,7 +1373,7 @@ frontEnd->interruptPending = false; thread->trapPending = false; - thread->inSyscall = false; + thread->noSquashFromTC = false; trapSquash = false; commitStatus = Running; } diff -r a8bfa97e9c0f -r eea341b75ea3 src/cpu/ozone/thread_state.hh --- a/src/cpu/ozone/thread_state.hh Thu Dec 06 14:48:45 2012 -0500 +++ b/src/cpu/ozone/thread_state.hh Thu Dec 06 14:48:46 2012 -0500 @@ -65,7 +65,7 @@ OzoneThreadState(CPUType *_cpu, int _thread_num) : ThreadState(_cpu, -1, _thread_num), - intrflag(0), cpu(_cpu), inSyscall(0), trapPending(0) + intrflag(0), cpu(_cpu), noSquashFromTC(false), trapPending(false) { if (cpu->params->profile) { profile = new FunctionProfile(cpu->params->system->kernelSymtab); @@ -85,7 +85,7 @@ OzoneThreadState(CPUType *_cpu, int _thread_num, Process *_process) : ThreadState(_cpu, -1, _thread_num, _process), - cpu(_cpu), inSyscall(0), trapPending(0) + cpu(_cpu), noSquashFromTC(false), trapPending(false) { miscRegFile.clear(); } @@ -102,7 +102,7 @@ typename Impl::CPUType *cpu; - bool inSyscall; + bool noSquashFromTC; bool trapPending;