summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2015-05-05 03:22:26 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2015-05-05 03:22:26 -0400
commit14e5b2ea552f05e7a83970af09ed255eb26ab134 (patch)
tree668013a377461d530ebf94dd08ee187dc0b79010
parent3d334321360de7f8a7ce90b018c10b9495fec198 (diff)
downloadgem5-14e5b2ea552f05e7a83970af09ed255eb26ab134.tar.xz
mem: Pass shared downstream through caches
This patch ensures that we pass on information about a packet being shared (rather than exclusive), when forwarding a packet downstream. Without this patch there is a risk that a downstream cache considers the line exclusive when it really isn't.
-rw-r--r--src/mem/cache/cache_impl.hh12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh
index 5e6eccec8..ca332697b 100644
--- a/src/mem/cache/cache_impl.hh
+++ b/src/mem/cache/cache_impl.hh
@@ -819,6 +819,18 @@ Cache::getBusPacket(PacketPtr cpu_pkt, CacheBlk *blk,
}
PacketPtr pkt = new Packet(cpu_pkt->req, cmd, blkSize);
+ // if there are sharers in the upper levels, pass that info downstream
+ if (cpu_pkt->sharedAsserted()) {
+ // note that cpu_pkt may have spent a considerable time in the
+ // MSHR queue and that the information could possibly be out
+ // of date, however, there is no harm in conservatively
+ // assuming the block is shared
+ pkt->assertShared();
+ DPRINTF(Cache, "%s passing shared from %s to %s addr %#llx size %d\n",
+ __func__, cpu_pkt->cmdString(), pkt->cmdString(),
+ pkt->getAddr(), pkt->getSize());
+ }
+
// the packet should be block aligned
assert(pkt->getAddr() == blockAlign(pkt->getAddr()));