mem: use is_secure instead of hardcoded false in prefetcher crash

This modifies the crash fix so that the function calls that were
modified use a local variables called `is_secure` instead of a
hardcoded `false`. Some of these existed previously so it made
more sense to use them, while others were newly added in to mark
where the code might need to be changed later.

Change-Id: I0c0d14b74f0ccf70ee5fe7c8b01ed0266353b3c1
This commit is contained in:
Erin Le
2024-07-22 21:14:29 +00:00
committed by Bobby R. Bruce
parent dc2162dbff
commit 6c4621c665
4 changed files with 14 additions and 9 deletions

View File

@@ -176,15 +176,15 @@ PIF::notifyRetiredInst(const Addr pc)
// Insert the spatial entry into the history buffer and update
// the 'iterator' table to point to the new entry
historyBuffer.push_back(spatialCompactor);
bool is_secure = false;
auto idx_entry = index.findEntry(spatialCompactor.trigger,
false);
is_secure);
if (idx_entry != nullptr) {
index.accessEntry(idx_entry);
} else {
idx_entry = index.findVictim(spatialCompactor.trigger);
assert(idx_entry != nullptr);
index.insertEntry(spatialCompactor.trigger, false,
index.insertEntry(spatialCompactor.trigger, is_secure,
idx_entry);
}
idx_entry->historyIt =
@@ -207,6 +207,7 @@ PIF::calculatePrefetch(const PrefetchInfo &pfi,
}
const Addr pc = pfi.getPC();
bool is_secure = pfi.isSecure();
// First check if the access has been prefetched, this is done by
// comparing the access against the active Stream Address Buffers
@@ -221,7 +222,7 @@ PIF::calculatePrefetch(const PrefetchInfo &pfi,
// Check if a valid entry in the 'index' table is found and allocate a new
// active prediction stream
IndexEntry *idx_entry = index.findEntry(pc, false);
IndexEntry *idx_entry = index.findEntry(pc, is_secure);
if (idx_entry != nullptr) {
index.accessEntry(idx_entry);

View File

@@ -278,7 +278,7 @@ SignaturePath::calculatePrefetch(const PrefetchInfo &pfi,
// confidence, these are prefetch candidates
// - select the entry with the highest counter as the "lookahead"
PatternEntry *current_pattern_entry =
patternTable.findEntry(current_signature, false); //,
patternTable.findEntry(current_signature, is_secure);
PatternStrideEntry const *lookahead = nullptr;
if (current_pattern_entry != nullptr) {
unsigned long max_counter = 0;

View File

@@ -125,7 +125,8 @@ SignaturePathV2::handlePageCrossingLookahead(signature_t signature,
GlobalHistoryEntry *gh_entry = globalHistoryRegister.findVictim(0);
assert(gh_entry != nullptr);
// Any address value works, as it is never used
globalHistoryRegister.insertEntry(0, false, gh_entry); // false,
bool is_secure = false;
globalHistoryRegister.insertEntry(0, is_secure, gh_entry); // false,
gh_entry->signature = signature;
gh_entry->lastBlock = last_offset;

View File

@@ -92,13 +92,14 @@ STeMS::checkForActiveGenerationsEnd(const CacheAccessor &cache)
}
if (generation_ended) {
// PST is indexed using the PC (secure bit is unused)
bool is_secure = false;
auto pst_entry = patternSequenceTable.findEntry(pst_addr,
false);
is_secure);
if (pst_entry == nullptr) {
// Tipically an entry will not exist
pst_entry = patternSequenceTable.findVictim(pst_addr);
assert(pst_entry != nullptr);
patternSequenceTable.insertEntry(pst_addr, false,
patternSequenceTable.insertEntry(pst_addr, is_secure,
pst_entry);
} else {
patternSequenceTable.accessEntry(pst_entry);
@@ -221,9 +222,11 @@ STeMS::reconstructSequence(
// Now query the PST with the PC of each RMOB entry
idx = 0;
bool is_secure = false;
for (auto it = rmob_it; it != rmob.end() && (idx < reconstructionEntries);
it++) {
auto pst_entry = patternSequenceTable.findEntry(it->pstAddress, false);
auto pst_entry = patternSequenceTable.findEntry(it->pstAddress,
is_secure);
if (pst_entry != nullptr) {
patternSequenceTable.accessEntry(pst_entry);
for (auto &seq_entry : pst_entry->sequence) {