O3: prevent a squash when completeAcc() modifies misc reg through TC.
authorMin Kyu Jeong <minkyu.jeong@arm.com>
Mon, 15 Nov 2010 20:04:04 +0000 (14:04 -0600)
committerMin Kyu Jeong <minkyu.jeong@arm.com>
Mon, 15 Nov 2010 20:04:04 +0000 (14:04 -0600)
This happens on ARM instructions when they update the IT state bits.
Code and associated comment was copied from execute() and initiateAcc() methods

src/cpu/o3/dyn_inst_impl.hh

index 6f7c23b2fb7a80c0e0b641e79c5a634cce0b41be..268746655210d1d43baca05c31c1d1f14c398042 100644 (file)
@@ -113,8 +113,17 @@ template <class Impl>
 Fault
 BaseO3DynInst<Impl>::completeAcc(PacketPtr pkt)
 {
+    // @todo: Pretty convoluted way to avoid squashing from happening
+    // 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;
+
     this->fault = this->staticInst->completeAcc(pkt, this, this->traceData);
 
+    this->thread->inSyscall = in_syscall;
+
     return this->fault;
 }