mem-cache: Only pendingModified MSHRs can satisfy CMO snoops
[gem5.git] / src / mem / cache / mshr.cc
index d89adef19903f316f635b46dd5f87fe5e69bbfd1..493b7f02101a5fc04b70a79c36cfc1c6cad5c341 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, 2015-2017 ARM Limited
+ * Copyright (c) 2012-2013, 2015-2018 ARM Limited
  * All rights reserved.
  *
  * The license below extends only to copyright in the software and shall
@@ -426,7 +426,7 @@ MSHR::handleSnoop(PacketPtr pkt, Counter _order)
         // the packet and the request as part of handling the deferred
         // snoop.
         PacketPtr cp_pkt = will_respond ? new Packet(pkt, true, true) :
-            new Packet(new Request(*pkt->req), pkt->cmd, blkSize);
+            new Packet(new Request(*pkt->req), pkt->cmd, blkSize, pkt->id);
 
         if (will_respond) {
             // we are the ordering point, and will consequently
@@ -452,7 +452,7 @@ MSHR::handleSnoop(PacketPtr pkt, Counter _order)
             postInvalidate = true;
         }
 
-        if (pkt->isClean()) {
+        if (isPendingModified() && pkt->isClean()) {
             pkt->setSatisfied();
         }
     }