From c0d7cca1d9895f1c3476ce9864584eb4fb2e6ee9 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Wed, 3 Apr 2019 10:29:37 +0800 Subject: check loads using tainted registers, set USL dst as tainted --- src/cpu/base_dyn_inst.hh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/cpu/base_dyn_inst.hh') diff --git a/src/cpu/base_dyn_inst.hh b/src/cpu/base_dyn_inst.hh index 6684a4765..3ddf25095 100644 --- a/src/cpu/base_dyn_inst.hh +++ b/src/cpu/base_dyn_inst.hh @@ -480,11 +480,22 @@ class BaseDynInst : public ExecContext, public RefCounted void taintDestRegs(void) { - for (auto dstreg: _destRegIdx) { + for (size_t i = 0; i < numDestRegs(); i++) { + auto dstreg = _destRegIdx[i]; cpu->setTaint(dstreg); } } + bool srcTainted(void) + { + bool result = false; + for (size_t i = 0; i < numSrcRegs(); i++) { + auto src = _srcRegIdx[i]; + result |= cpu->regTainted(src); + } + return result; + } + /** Renames a source logical register to the physical register which * has/will produce that logical register's result. * @todo: add in whether or not the source register is ready. -- cgit v1.2.3