Prefetch: Don't prefetch if address is in the write queue.
authorAli Saidi <Ali.Saidi@ARM.com>
Tue, 13 Sep 2011 17:06:13 +0000 (12:06 -0500)
committerAli Saidi <Ali.Saidi@ARM.com>
Tue, 13 Sep 2011 17:06:13 +0000 (12:06 -0500)
Check that we're not currently writing back an address the prefetcher is trying
to prefetch before issuing it. We previously checked the mshrQueue and the cache
itself, but forgot to check the writeBuffer. This fixes a memory corrucption
issue with an L2 prefetcher.

src/mem/cache/cache_impl.hh

index b29d52f783e0668d411d8ec5220f025bf86f3833..a56495abb255d65cf6d4463aff50456eb9a8b005 100644 (file)
@@ -1437,7 +1437,8 @@ Cache<TagStore>::getNextMSHR()
         PacketPtr pkt = prefetcher->getPacket();
         if (pkt) {
             Addr pf_addr = blockAlign(pkt->getAddr());
-            if (!tags->findBlock(pf_addr) && !mshrQueue.findMatch(pf_addr)) {
+            if (!tags->findBlock(pf_addr) && !mshrQueue.findMatch(pf_addr) &&
+                                             !writeBuffer.findMatch(pf_addr)) {
                 // Update statistic on number of prefetches issued
                 // (hwpf_mshr_misses)
                 mshr_misses[pkt->cmdToIndex()][0/*pkt->req->threadId()*/]++;