summaryrefslogtreecommitdiff
path: root/src/mem/cache/mshr.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2015-03-27 04:56:00 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2015-03-27 04:56:00 -0400
commita7a1e6004a0d2508913277b5c60d245fdcad2681 (patch)
treefa367fcbea69318b4cf16e40d1799f5a08365eff /src/mem/cache/mshr.cc
parent801ce65eaeda04017ac0df544eaa4c8ffae98455 (diff)
downloadgem5-a7a1e6004a0d2508913277b5c60d245fdcad2681.tar.xz
mem: Ignore uncacheable MSHRs when finding matches
This patch changes how we search for matching MSHRs, ignoring any MSHR that is allocated for an uncacheable access. By doing so, this patch fixes a corner case in the MSHRs where incorrect data ended up being copied into a (cacheable) read packet due to a first uncacheable MSHR target of size 4, followed by a cacheable target to the same MSHR of size 64. The latter target was filled with nonsense data.
Diffstat (limited to 'src/mem/cache/mshr.cc')
-rw-r--r--src/mem/cache/mshr.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mem/cache/mshr.cc b/src/mem/cache/mshr.cc
index 79cf7a998..0915df23f 100644
--- a/src/mem/cache/mshr.cc
+++ b/src/mem/cache/mshr.cc
@@ -273,6 +273,15 @@ MSHR::deallocate()
void
MSHR::allocateTarget(PacketPtr pkt, Tick whenReady, Counter _order)
{
+ // assume we'd never issue a prefetch when we've got an
+ // outstanding miss
+ assert(pkt->cmd != MemCmd::HardPFReq);
+
+ // uncacheable accesses always allocate a new MSHR, and cacheable
+ // accesses ignore any uncacheable MSHRs, thus we should never
+ // have targets addded if originally allocated uncacheable
+ assert(!_isUncacheable);
+
// if there's a request already in service for this MSHR, we will
// have to defer the new target until after the response if any of
// the following are true:
@@ -283,11 +292,6 @@ MSHR::allocateTarget(PacketPtr pkt, Tick whenReady, Counter _order)
// getting an exclusive block back or we have already snooped
// another read request that will downgrade our exclusive block
// to shared
-
- // assume we'd never issue a prefetch when we've got an
- // outstanding miss
- assert(pkt->cmd != MemCmd::HardPFReq);
-
if (inService &&
(!deferredTargets.empty() || hasPostInvalidate() ||
(pkt->needsExclusive() &&