cpu: Allow storing an invalid HTM checkpoint
authorTimothy Hayes <timothy.hayes@arm.com>
Wed, 23 Sep 2020 11:10:37 +0000 (12:10 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 29 Sep 2020 09:16:28 +0000 (09:16 +0000)
Commits 02745afd and f9b4e32 introduced a mechanism for creating checkpoint
objects for hardware transactional memory (HTM) and Arm TME. Because the
checkpoint object also contains the local UID of a transaction, it is
needed before any architectural checkpointing takes places. This caused
segfaults when running HTM codes.

This commit allows ISAs to allocate a checkpoint once at the beginning
of simulation.  In order to do that we need to remove the validity check
assertion; the cpt will become valid only after a first successfull
transaction start

Change-Id: I233d01805f8ab655131ed8cd6404950a2bf6fbc7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35015
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/cpu/o3/thread_context_impl.hh
src/cpu/simple_thread.cc

index 005aa57166f983b66f931e2f42f1e53c7c254d85..bea4dc7840032ce354609f0364fd8cc0d5c410cc 100644 (file)
@@ -347,7 +347,6 @@ template <class Impl>
 void
 O3ThreadContext<Impl>::setHtmCheckpointPtr(BaseHTMCheckpointPtr new_cpt)
 {
-    assert(!thread->htmCheckpoint->valid());
     thread->htmCheckpoint = std::move(new_cpt);
 }
 
index 28a1c80692ea084efca4ea43b1138b7b74121090..b9b69d89ecf690950f1e1a39e2ff9897323806ac 100644 (file)
@@ -196,6 +196,5 @@ SimpleThread::getHtmCheckpointPtr()
 void
 SimpleThread::setHtmCheckpointPtr(BaseHTMCheckpointPtr new_cpt)
 {
-    assert(!_htmCheckpoint->valid());
     _htmCheckpoint = std::move(new_cpt);
 }