From daedc5a49127eb91036291af1619bbc98016aff0 Mon Sep 17 00:00:00 2001 From: Mitch Hayenga Date: Wed, 3 Sep 2014 07:42:36 -0400 Subject: cpu: Fix incorrect speculative branch predictor behavior When a branch mispredicted gem5 would squash all history after and including the mispredicted branch. However, the mispredicted branch is still speculative and its history is required to rollback state if another, older, branch mispredicts. This leads to things like RAS corruption. --- src/cpu/pred/2bit_local.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/cpu/pred/2bit_local.hh') diff --git a/src/cpu/pred/2bit_local.hh b/src/cpu/pred/2bit_local.hh index 23683cc67..e008c6232 100644 --- a/src/cpu/pred/2bit_local.hh +++ b/src/cpu/pred/2bit_local.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 ARM Limited + * Copyright (c) 2011, 2014 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -92,6 +92,9 @@ class LocalBP : public BPredUnit */ void update(Addr branch_addr, bool taken, void *bp_history, bool squashed); + void retireSquashed(void *bp_history) + { assert(bp_history == NULL); } + void squash(void *bp_history) { assert(bp_history == NULL); } -- cgit v1.2.3