Daniel Carvalho has uploaded this change for review. (
https://gem5-review.googlesource.com/10722
Change subject: mem-cache: Use secure bit in findVictim
......................................................................
mem-cache: Use secure bit in findVictim
Sector caches must know if there was a sector hit in order
to decide whether a victim's sector must be fully evicted
to give place to a new sector or not.
In order to do so it needs the tag and secure information.
Change-Id: Ib554169e25fa131d6bf986561f7970b787c56874
---
M src/mem/cache/base.cc
M src/mem/cache/tags/base.hh
M src/mem/cache/tags/base_set_assoc.hh
M src/mem/cache/tags/fa_lru.cc
M src/mem/cache/tags/fa_lru.hh
5 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index 75b1769..fdfe37e 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -1210,7 +1210,7 @@
{
// Find replacement victim
std::vector<CacheBlk*> evict_blks;
- CacheBlk *victim = tags->findVictim(addr, evict_blks);
+ CacheBlk *victim = tags->findVictim(addr, is_secure, evict_blks);
// It is valid to return nullptr if there is no victim
if (!victim)
diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh
index 0cc7902..7ed90fb 100644
--- a/src/mem/cache/tags/base.hh
+++ b/src/mem/cache/tags/base.hh
@@ -270,11 +270,12 @@
* @sa insertBlock
*
* @param addr Address to find a victim for.
+ * @param is_secure True if the target memory space is secure.
* @param evict_blks Cache blocks to be evicted.
* @return Cache block to be replaced.
*/
- virtual CacheBlk* findVictim(Addr addr, std::vector<CacheBlk*>&
evict_blks)
- const
= 0;
+ virtual CacheBlk* findVictim(Addr addr, const bool is_secure,
+ std::vector<CacheBlk*>& evict_blks) const
= 0;
virtual CacheBlk* accessBlock(Addr addr, bool is_secure, Cycles &lat)
= 0;
diff --git a/src/mem/cache/tags/base_set_assoc.hh
b/src/mem/cache/tags/base_set_assoc.hh
index b41c309..12b2efb 100644
--- a/src/mem/cache/tags/base_set_assoc.hh
+++ b/src/mem/cache/tags/base_set_assoc.hh
@@ -204,11 +204,12 @@
* only contains the victim.
*
* @param addr Address to find a victim for.
+ * @param is_secure True if the target memory space is secure.
* @param evict_blks Cache blocks to be evicted.
* @return Cache block to be replaced.
*/
- CacheBlk* findVictim(Addr addr, std::vector<CacheBlk*>& evict_blks)
const
-
override
+ CacheBlk* findVictim(Addr addr, const bool is_secure,
+ std::vector<CacheBlk*>& evict_blks) const override
{
// Get possible locations for the victim block
std::vector<CacheBlk*> locations = getPossibleLocations(addr);
diff --git a/src/mem/cache/tags/fa_lru.cc b/src/mem/cache/tags/fa_lru.cc
index 185a05e..890d1ad 100644
--- a/src/mem/cache/tags/fa_lru.cc
+++ b/src/mem/cache/tags/fa_lru.cc
@@ -195,7 +195,8 @@
}
CacheBlk*
-FALRU::findVictim(Addr addr, std::vector<CacheBlk*>& evict_blks) const
+FALRU::findVictim(Addr addr, const bool is_secure,
+ std::vector<CacheBlk*>& evict_blks) const
{
// The victim is always stored on the tail for the FALRU
FALRUBlk* victim = tail;
diff --git a/src/mem/cache/tags/fa_lru.hh b/src/mem/cache/tags/fa_lru.hh
index b134417..7aec36a 100644
--- a/src/mem/cache/tags/fa_lru.hh
+++ b/src/mem/cache/tags/fa_lru.hh
@@ -199,11 +199,12 @@
* only contains the victim.
*
* @param addr Address to find a victim for.
+ * @param is_secure True if the target memory space is secure.
* @param evict_blks Cache blocks to be evicted.
* @return Cache block to be replaced.
*/
- CacheBlk* findVictim(Addr addr, std::vector<CacheBlk*>& evict_blks)
const
-
override;
+ CacheBlk* findVictim(Addr addr, const bool is_secure,
+ std::vector<CacheBlk*>& evict_blks) const
override;
/**
* Insert the new block into the cache and update replacement data.
--
To view, visit https://gem5-review.googlesource.com/10722
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ib554169e25fa131d6bf986561f7970b787c56874
Gerrit-Change-Number: 10722
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev