summaryrefslogtreecommitdiff
path: root/src/mem/cache/tags/cacheset.hh
diff options
context:
space:
mode:
authorGiacomo Gabrielli <Giacomo.Gabrielli@arm.com>2014-01-24 15:29:30 -0600
committerGiacomo Gabrielli <Giacomo.Gabrielli@arm.com>2014-01-24 15:29:30 -0600
commitaefe9cc624902fe26535028f86ba3a45f555bcf0 (patch)
tree4d775f34b34eeafc0c596b95aa071cc52fb94283 /src/mem/cache/tags/cacheset.hh
parent7f835a59f1c342eb1c170973ad53c493cc38e978 (diff)
downloadgem5-aefe9cc624902fe26535028f86ba3a45f555bcf0.tar.xz
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.
Diffstat (limited to 'src/mem/cache/tags/cacheset.hh')
-rw-r--r--src/mem/cache/tags/cacheset.hh14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mem/cache/tags/cacheset.hh b/src/mem/cache/tags/cacheset.hh
index 31eb28bf0..88e661cad 100644
--- a/src/mem/cache/tags/cacheset.hh
+++ b/src/mem/cache/tags/cacheset.hh
@@ -69,10 +69,11 @@ class CacheSet
* Find a block matching the tag in this set.
* @param way_id The id of the way that matches the tag.
* @param tag The Tag to find.
+ * @param is_secure True if the target memory space is secure.
* @return Pointer to the block if found. Set way_id to assoc if none found
*/
- Blktype* findBlk(Addr tag, int& way_id) const ;
- Blktype* findBlk(Addr tag) const ;
+ Blktype* findBlk(Addr tag, bool is_secure, int& way_id) const ;
+ Blktype* findBlk(Addr tag, bool is_secure) const ;
/**
* Move the given block to the head of the list.
@@ -90,7 +91,7 @@ class CacheSet
template <class Blktype>
Blktype*
-CacheSet<Blktype>::findBlk(Addr tag, int& way_id) const
+CacheSet<Blktype>::findBlk(Addr tag, bool is_secure, int& way_id) const
{
/**
* Way_id returns the id of the way that matches the block
@@ -98,7 +99,8 @@ CacheSet<Blktype>::findBlk(Addr tag, int& way_id) const
*/
way_id = assoc;
for (int i = 0; i < assoc; ++i) {
- if (blks[i]->tag == tag && blks[i]->isValid()) {
+ if (blks[i]->tag == tag && blks[i]->isValid() &&
+ blks[i]->isSecure() == is_secure) {
way_id = i;
return blks[i];
}
@@ -108,10 +110,10 @@ CacheSet<Blktype>::findBlk(Addr tag, int& way_id) const
template <class Blktype>
Blktype*
-CacheSet<Blktype>::findBlk(Addr tag) const
+CacheSet<Blktype>::findBlk(Addr tag, bool is_secure) const
{
int ignored_way_id;
- return findBlk(tag, ignored_way_id);
+ return findBlk(tag, is_secure, ignored_way_id);
}
template <class Blktype>