From aefe9cc624902fe26535028f86ba3a45f555bcf0 Mon Sep 17 00:00:00 2001 From: Giacomo Gabrielli Date: Fri, 24 Jan 2014 15:29:30 -0600 Subject: mem: Add support for a security bit in the memory system This patch adds the basic building blocks required to support e.g. ARM TrustZone by discerning secure and non-secure memory accesses. --- src/mem/cache/mshr_queue.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/mem/cache/mshr_queue.cc') diff --git a/src/mem/cache/mshr_queue.cc b/src/mem/cache/mshr_queue.cc index d8cc5f40a..3150b4f5d 100644 --- a/src/mem/cache/mshr_queue.cc +++ b/src/mem/cache/mshr_queue.cc @@ -62,13 +62,13 @@ MSHRQueue::MSHRQueue(const std::string &_label, } MSHR * -MSHRQueue::findMatch(Addr addr) const +MSHRQueue::findMatch(Addr addr, bool is_secure) const { MSHR::ConstIterator i = allocatedList.begin(); MSHR::ConstIterator end = allocatedList.end(); for (; i != end; ++i) { MSHR *mshr = *i; - if (mshr->addr == addr) { + if (mshr->addr == addr && mshr->isSecure == is_secure) { return mshr; } } @@ -76,7 +76,7 @@ MSHRQueue::findMatch(Addr addr) const } bool -MSHRQueue::findMatches(Addr addr, vector& matches) const +MSHRQueue::findMatches(Addr addr, bool is_secure, vector& matches) const { // Need an empty vector assert(matches.empty()); @@ -85,7 +85,7 @@ MSHRQueue::findMatches(Addr addr, vector& matches) const MSHR::ConstIterator end = allocatedList.end(); for (; i != end; ++i) { MSHR *mshr = *i; - if (mshr->addr == addr) { + if (mshr->addr == addr && mshr->isSecure == is_secure) { retval = true; matches.push_back(mshr); } @@ -113,19 +113,19 @@ MSHRQueue::checkFunctional(PacketPtr pkt, Addr blk_addr) MSHR * -MSHRQueue::findPending(Addr addr, int size) const +MSHRQueue::findPending(Addr addr, int size, bool is_secure) const { MSHR::ConstIterator i = readyList.begin(); MSHR::ConstIterator end = readyList.end(); for (; i != end; ++i) { MSHR *mshr = *i; - if (mshr->addr < addr) { - if (mshr->addr + mshr->size > addr) { - return mshr; - } - } else { - if (addr + size > mshr->addr) { - return mshr; + if (mshr->isSecure == is_secure) { + if (mshr->addr < addr) { + if (mshr->addr + mshr->size > addr) + return mshr; + } else { + if (addr + size > mshr->addr) + return mshr; } } } -- cgit v1.2.3