mem-cache: Fix secure bit modification
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Thu, 31 May 2018 10:09:39 +0000 (12:09 +0200)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Fri, 1 Jun 2018 09:07:20 +0000 (09:07 +0000)
Secure bit was being updated outside insertion.

Change-Id: I83d9b010e8cf64013bbea9bae3ea68b0c414a189
Reviewed-on: https://gem5-review.googlesource.com/10622
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

src/mem/cache/base.cc
src/mem/cache/cache.cc

index e6315cf04e87a3680f5a7ab97a431ea222c21037..604aab6216cdf3e84c25ac118550bc80f3b085c5 100644 (file)
@@ -1136,14 +1136,13 @@ BaseCache::handleFill(PacketPtr pkt, CacheBlk *blk, PacketList &writebacks,
     } else {
         // existing block... probably an upgrade
         assert(blk->tag == tags->extractTag(addr));
+        assert(blk->isSecure() == is_secure);
         // either we're getting new data or the block should already be valid
         assert(pkt->hasData() || blk->isValid());
         // don't clear block status... if block is already dirty we
         // don't want to lose that
     }
 
-    if (is_secure)
-        blk->status |= BlkSecure;
     blk->status |= BlkValid | BlkReadable;
 
     // sanity check for whole-line writes, which should always be
index 5034ca521e41c6d091682a05784bffb194f9c52c..9177ebea8036056497088916f5c16a84b1d9a36f 100644 (file)
@@ -887,7 +887,6 @@ Cache::cleanEvictBlk(CacheBlk *blk)
     return pkt;
 }
 
-
 /////////////////////////////////////////////////////
 //
 // Snoop path: requests coming in from the memory side