ruby: Don't set the block data when a store conditional fails
authorNikos Nikoleris <nikos.nikoleris@arm.com>
Fri, 3 Mar 2017 16:52:45 +0000 (16:52 +0000)
committerNikos Nikoleris <nikos.nikoleris@arm.com>
Wed, 31 May 2017 18:34:16 +0000 (18:34 +0000)
Previously the Sequencer upon a Store Conditional would
unconditionally set the data of the memory location. This change
checks and prevents a failed Store Conditional from modifying any
data.

Change-Id: Id63c9579d8f054f0e95c6d338a7e31aa48762755
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2902
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Bradford Beckmann <brad.beckmann@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

src/mem/ruby/system/Sequencer.cc

index 7fdd52623a21d2405f1bc7b4ff488633ee6dc8a6..97afa5ec6e6bbfde2763b44573a496afff03013b 100644 (file)
@@ -489,7 +489,9 @@ Sequencer::hitCallback(SequencerRequest* srequest, DataBlock& data,
             data.setData(&overwrite_val[0],
                          getOffset(request_address), pkt->getSize());
             DPRINTF(RubySequencer, "swap data %s\n", data);
-        } else {
+        } else if (type != RubyRequestType_Store_Conditional || llscSuccess) {
+            // Types of stores set the actual data here, apart from
+            // failed Store Conditional requests
             data.setData(pkt->getConstPtr<uint8_t>(),
                          getOffset(request_address), pkt->getSize());
             DPRINTF(RubySequencer, "set data %s\n", data);