From bf25c53a7d2e34319a8f845045c83ef7a74068a7 Mon Sep 17 00:00:00 2001 From: Mitchell Hayenga Date: Wed, 23 Apr 2014 05:18:26 -0400 Subject: [PATCH] cpu: Fix setTranslateLatency() bug for squashed instructions setTranslateLatency could sometimes improperly access a deleted request packet after an instruction was squashed. --- src/cpu/translation.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cpu/translation.hh b/src/cpu/translation.hh index c05cc86a0..46c96a0d4 100644 --- a/src/cpu/translation.hh +++ b/src/cpu/translation.hh @@ -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; }