Sungkeun Kim has uploaded this change for review. (
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
---
M src/cpu/pred/ras.cc
1 file changed, 4 insertions(+), 0 deletions(-)
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: 1
Gerrit-Owner: Sungkeun Kim <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s