diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2015-06-09 09:21:17 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2015-06-09 09:21:17 -0400 |
commit | 578a7f20c647e4051e137bdb219cec450a741ca6 (patch) | |
tree | f028a77426e0c6a32933c173a2f806e5aa93cba3 | |
parent | eb3ed11794667975476a4ec3b070e215c2c5dc12 (diff) | |
download | gem5-578a7f20c647e4051e137bdb219cec450a741ca6.tar.xz |
mem: Fix snoop packet data allocation bug
This patch fixes an issue where the snoop packet did not properly
forward the data pointer in case of static data.
-rw-r--r-- | src/mem/cache/cache_impl.hh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh index 734ca826c..9c5070ffa 100644 --- a/src/mem/cache/cache_impl.hh +++ b/src/mem/cache/cache_impl.hh @@ -1610,7 +1610,11 @@ Cache::handleSnoop(PacketPtr pkt, CacheBlk *blk, bool is_timing, // rewritten to be relative to cpu-side bus (if any) bool alreadyResponded = pkt->memInhibitAsserted(); if (is_timing) { - Packet snoopPkt(pkt, true, false); // clear flags, no allocation + // copy the packet so that we can clear any flags before + // forwarding it upwards, we also allocate data (passing + // the pointer along in case of static data), in case + // there is a snoop hit in upper levels + Packet snoopPkt(pkt, true, true); snoopPkt.setExpressSnoop(); snoopPkt.pushSenderState(new ForwardResponseRecord()); // the snoop packet does not need to wait any additional @@ -1622,6 +1626,8 @@ Cache::handleSnoop(PacketPtr pkt, CacheBlk *blk, bool is_timing, assert(!alreadyResponded); pkt->assertMemInhibit(); } else { + // no cache (or anyone else for that matter) will + // respond, so delete the ForwardResponseRecord here delete snoopPkt.popSenderState(); } if (snoopPkt.sharedAsserted()) { |