summaryrefslogtreecommitdiff
path: root/src/cpu/o3/lsq_unit_impl.hh
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2019-04-03 10:29:37 +0800
committerIru Cai <mytbk920423@gmail.com>2019-05-31 15:59:17 +0800
commitc0d7cca1d9895f1c3476ce9864584eb4fb2e6ee9 (patch)
tree3a1cb356c61cc6366d20c46353ed494d8e49ba92 /src/cpu/o3/lsq_unit_impl.hh
parentcb5562bb15f32e9040eccb57271d86fddc614230 (diff)
downloadgem5-c0d7cca1d9895f1c3476ce9864584eb4fb2e6ee9.tar.xz
check loads using tainted registers, set USL dst as tainted
Diffstat (limited to 'src/cpu/o3/lsq_unit_impl.hh')
-rw-r--r--src/cpu/o3/lsq_unit_impl.hh15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/cpu/o3/lsq_unit_impl.hh b/src/cpu/o3/lsq_unit_impl.hh
index 7462d4c84..14256e382 100644
--- a/src/cpu/o3/lsq_unit_impl.hh
+++ b/src/cpu/o3/lsq_unit_impl.hh
@@ -1043,6 +1043,7 @@ LSQUnit<Impl>::updateVisibleState()
}
inst->readyToExpose(true);
}else {
+#if 0 /* now an untainted USL can be safe */
if (inst->readyToExpose()){
DPRINTF(LSQUnit, "The load can not be validated "
"[sn:%lli] PC %s\n",
@@ -1050,7 +1051,19 @@ LSQUnit<Impl>::updateVisibleState()
assert(0);
//--loadsToVLD;
}
- inst->readyToExpose(false);
+#endif
+ /* set taint for dst registers */
+ inst->taintDestRegs();
+ /* if the load depends on tainted registers, set
+ readyToExpose to false, otherwise set it to true
+ */
+ if (inst->srcTainted()) {
+ DPRINTF(LSQUnit, "load inst [sn:%lli] %s not safe, set readyToExpose to false\n", inst->seqNum, inst->pcState());
+ inst->readyToExpose(false);
+ } else {
+ DPRINTF(LSQUnit, "load inst [sn:%lli] %s is an unsafe speculated load, but source registers are not tainted.\n", inst->seqNum, inst->pcState());
+ inst->readyToExpose(true);
+ }
}
inst->fenceDelay(false);
} else {