cpu: Fix setTranslateLatency() bug for squashed instructions
authorMitchell Hayenga <Mitchell.Hayenga@ARM.com>
Wed, 23 Apr 2014 09:18:26 +0000 (05:18 -0400)
committerMitchell Hayenga <Mitchell.Hayenga@ARM.com>
Wed, 23 Apr 2014 09:18:26 +0000 (05:18 -0400)
setTranslateLatency could sometimes improperly access a deleted request
packet after an instruction was squashed.

src/cpu/translation.hh

index c05cc86a04060e5db88eca81686917fbdcb1fb85..46c96a0d49a2c7e854a4245a76110caaca19e6be 100644 (file)
@@ -255,8 +255,11 @@ class DataTranslation : public BaseTLB::Translation
         assert(state);
         assert(mode == state->mode);
         if (state->finish(fault, index)) {
+            if (state->getFault() == NoFault) {
+                // Don't access the request if faulted (due to squash)
+                req->setTranslateLatency();
+            }
             xc->finishTranslation(state);
-            req->setTranslateLatency();
         }
         delete this;
     }