Sungkeun Kim has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/33214 )

Change subject: cpu: Failure to restore RAS during squash
......................................................................

cpu: Failure to restore RAS during squash

During squash of branch predictor history, RAS recovery mess up the
stack because of function "restore" in RAS (src/cpu/pred/ras.cc). In
restore function, it does not update "usedEntries" variable resulting in
restore failure.

To be specific, in order to remove mispredicted call, it uses pop() and
it updates tos. However in order to restore mispredicted ret
instruction, it uses restore() but it does not update tos. This pair of
function call mess up the RAS resulting in many misspeculation.

The solution is to update usedEntries variable as “push” function does.
This is possible because restoration is done with reverse order of push
and pop.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-732

Change-Id: Ia14e71c26d20b2795fd55a6a0dd3284c03570614
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33214
Reviewed-by: Trivikram Reddy <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/cpu/pred/ras.cc
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
Jason Lowe-Power: Looks good to me, but someone else must approve; Looks good to me, approved
  Trivikram Reddy: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/cpu/pred/ras.cc b/src/cpu/pred/ras.cc
index e07ac6a..33eec0e 100644
--- a/src/cpu/pred/ras.cc
+++ b/src/cpu/pred/ras.cc
@@ -74,4 +74,8 @@
     tos = top_entry_idx;

     addrStack[tos] = restored;
+
+    if (usedEntries != numEntries) {
+        ++usedEntries;
+    }
 }

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/33214
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ia14e71c26d20b2795fd55a6a0dd3284c03570614
Gerrit-Change-Number: 33214
Gerrit-PatchSet: 2
Gerrit-Owner: Sungkeun Kim <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Sungkeun Kim <[email protected]>
Gerrit-Reviewer: Sungkeun Kim <[email protected]>
Gerrit-Reviewer: Trivikram Reddy <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-CC: Jason Lowe-Power <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to