From 70c4b1c608b1f551a03744767fdc4fff849dffa9 Mon Sep 17 00:00:00 2001 From: "Michiel W. van Tol" Date: Thu, 4 Jun 2020 16:01:26 +0100 Subject: [PATCH] cpu-o3: Avoid passing ReExec 'faults' on CPU tracing interface The O3 model uses ReExec faults to flush the pipeline and restart after a memory ordering violation, e.g. due to an incoming snoop. These, just like branch mispredict flushes, are not architectural faults but micro-architectural events, and should therefore not show up on the instruction tracing interface. This adds a check on faulting instructions in commit, to verify if the instruction faulted due to ReExec, to avoid tracing it. Change-Id: I1d3eaffb0ff22411e0e16a69ef07961924c88c10 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30554 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- src/cpu/o3/commit_impl.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cpu/o3/commit_impl.hh b/src/cpu/o3/commit_impl.hh index 4f467e96a..49b40e3f5 100644 --- a/src/cpu/o3/commit_impl.hh +++ b/src/cpu/o3/commit_impl.hh @@ -1259,7 +1259,11 @@ DefaultCommit::commitHead(const DynInstPtr &head_inst, unsigned inst_num) "[tid:%i] [sn:%llu] Committing instruction with fault\n", tid, head_inst->seqNum); if (head_inst->traceData) { - if (DTRACE(ExecFaulting)) { + // We ignore ReExecution "faults" here as they are not real + // (architectural) faults but signal flush/replays. + if (DTRACE(ExecFaulting) + && dynamic_cast(inst_fault.get()) == nullptr) { + head_inst->traceData->setFaulting(true); head_inst->traceData->setFetchSeq(head_inst->seqNum); head_inst->traceData->setCPSeq(thread[tid]->numOp); -- 2.30.2