diff options
Diffstat (limited to 'src/mem/cache/prefetch/base.cc')
-rw-r--r-- | src/mem/cache/prefetch/base.cc | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/mem/cache/prefetch/base.cc b/src/mem/cache/prefetch/base.cc index ed7b63f82..c440978e6 100644 --- a/src/mem/cache/prefetch/base.cc +++ b/src/mem/cache/prefetch/base.cc @@ -122,9 +122,9 @@ BasePrefetcher::regStats() } inline bool -BasePrefetcher::inCache(Addr addr) +BasePrefetcher::inCache(Addr addr, bool is_secure) { - if (cache->inCache(addr)) { + if (cache->inCache(addr, is_secure)) { pfCacheHit++; return true; } @@ -132,9 +132,9 @@ BasePrefetcher::inCache(Addr addr) } inline bool -BasePrefetcher::inMissQueue(Addr addr) +BasePrefetcher::inMissQueue(Addr addr, bool is_secure) { - if (cache->inMissQueue(addr)) { + if (cache->inMissQueue(addr, is_secure)) { pfMSHRHit++; return true; } @@ -157,12 +157,14 @@ BasePrefetcher::getPacket() pf.pop_front(); Addr blk_addr = pkt->getAddr() & ~(Addr)(blkSize-1); + bool is_secure = pkt->isSecure(); - if (!inCache(blk_addr) && !inMissQueue(blk_addr)) + if (!inCache(blk_addr, is_secure) && !inMissQueue(blk_addr, is_secure)) // we found a prefetch, return it break; - DPRINTF(HWPrefetch, "addr 0x%x in cache, skipping\n", pkt->getAddr()); + DPRINTF(HWPrefetch, "addr 0x%x (%s) in cache, skipping\n", + pkt->getAddr(), is_secure ? "s" : "ns"); delete pkt->req; delete pkt; @@ -174,7 +176,8 @@ BasePrefetcher::getPacket() pfIssued++; assert(pkt != NULL); - DPRINTF(HWPrefetch, "returning 0x%x\n", pkt->getAddr()); + DPRINTF(HWPrefetch, "returning 0x%x (%s)\n", pkt->getAddr(), + pkt->isSecure() ? "s" : "ns"); return pkt; } @@ -185,12 +188,15 @@ BasePrefetcher::notify(PacketPtr &pkt, Tick tick) if (!pkt->req->isUncacheable() && !(pkt->req->isInstFetch() && onlyData)) { // Calculate the blk address Addr blk_addr = pkt->getAddr() & ~(Addr)(blkSize-1); + bool is_secure = pkt->isSecure(); // Check if miss is in pfq, if so remove it - std::list<DeferredPacket>::iterator iter = inPrefetch(blk_addr); + std::list<DeferredPacket>::iterator iter = inPrefetch(blk_addr, + is_secure); if (iter != pf.end()) { DPRINTF(HWPrefetch, "Saw a miss to a queued prefetch addr: " - "0x%x, removing it\n", blk_addr); + "0x%x (%s), removing it\n", blk_addr, + is_secure ? "s" : "ns"); pfRemovedMSHR++; delete iter->pkt->req; delete iter->pkt; @@ -239,7 +245,7 @@ BasePrefetcher::notify(PacketPtr &pkt, Tick tick) addr, *delayIter, time); // Check if it is already in the pf buffer - if (inPrefetch(addr) != pf.end()) { + if (inPrefetch(addr, is_secure) != pf.end()) { pfBufferHit++; DPRINTF(HWPrefetch, "Prefetch addr already in pf buffer\n"); continue; @@ -247,6 +253,8 @@ BasePrefetcher::notify(PacketPtr &pkt, Tick tick) // create a prefetch memreq Request *prefetchReq = new Request(*addrIter, blkSize, 0, masterId); + if (is_secure) + prefetchReq->setFlags(Request::SECURE); prefetchReq->taskId(ContextSwitchTaskId::Prefetcher); PacketPtr prefetch = new Packet(prefetchReq, MemCmd::HardPFReq); @@ -274,12 +282,13 @@ BasePrefetcher::notify(PacketPtr &pkt, Tick tick) } std::list<BasePrefetcher::DeferredPacket>::iterator -BasePrefetcher::inPrefetch(Addr address) +BasePrefetcher::inPrefetch(Addr address, bool is_secure) { // Guaranteed to only be one match, we always check before inserting std::list<DeferredPacket>::iterator iter; for (iter = pf.begin(); iter != pf.end(); iter++) { - if ((iter->pkt->getAddr() & ~(Addr)(blkSize-1)) == address) { + if (((*iter).pkt->getAddr() & ~(Addr)(blkSize-1)) == address && + (*iter).pkt->isSecure() == is_secure) { return iter; } } |