diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index c2c6b382e0..c7215a20da 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,11 @@ +# Version 24.0.0.1 + +**[HOTFIX]** Fixes a bug affecting the use of the `IndirectMemoryPrefetcher`, `SignaturePathPrefetcher`, `SignaturePathPrefetcherV2`, `STeMSPrefetcher`, and `PIFPrefetcher` SimObjects. +Use of these resulted in gem5 crashing a gem5 crash with the error message "Need is_secure arg". + +The fix to this introduced to the gem5 develop branch in the Pull Request. +The commits in this PR were cherry-picked on the gem5 stable branch to create the v24.0.0.1 hotfix release. + # Version 24.0 gem5 Version 24.0 is the first major release of 2024. diff --git a/src/Doxyfile b/src/Doxyfile index 2206f17669..fc95f17d62 100644 --- a/src/Doxyfile +++ b/src/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = gem5 # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = v24.0.0.0 +PROJECT_NUMBER = v24.0.0.1 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/src/base/version.cc b/src/base/version.cc index dedbb425d3..ffbc7bd38d 100644 --- a/src/base/version.cc +++ b/src/base/version.cc @@ -32,6 +32,6 @@ namespace gem5 /** * @ingroup api_base_utils */ -const char *gem5Version = "24.0.0.0"; +const char *gem5Version = "24.0.0.1"; } // namespace gem5 diff --git a/src/mem/cache/prefetch/associative_set.hh b/src/mem/cache/prefetch/associative_set.hh index b73939fd5d..d434a6b47c 100644 --- a/src/mem/cache/prefetch/associative_set.hh +++ b/src/mem/cache/prefetch/associative_set.hh @@ -90,8 +90,6 @@ class AssociativeSet : public AssociativeCache using AssociativeCache::accessEntryByAddr; using AssociativeCache::findEntry; using AssociativeCache::insertEntry; - using AssociativeCache::getPossibleEntries; - using AssociativeCache::replPolicy; using AssociativeCache::indexingPolicy; }; diff --git a/src/mem/cache/prefetch/indirect_memory.cc b/src/mem/cache/prefetch/indirect_memory.cc index f689bff38c..169356277a 100644 --- a/src/mem/cache/prefetch/indirect_memory.cc +++ b/src/mem/cache/prefetch/indirect_memory.cc @@ -85,7 +85,7 @@ IndirectMemory::calculatePrefetch(const PrefetchInfo &pfi, } } else { // if misses are not being tracked, attempt to detect stream accesses - PrefetchTableEntry *pt_entry = prefetchTable.findEntry(pc); + PrefetchTableEntry *pt_entry = prefetchTable.findEntry(pc, is_secure); if (pt_entry != nullptr) { prefetchTable.accessEntry(pt_entry); @@ -159,7 +159,7 @@ IndirectMemory::calculatePrefetch(const PrefetchInfo &pfi, } else { pt_entry = prefetchTable.findVictim(pc); assert(pt_entry != nullptr); - prefetchTable.insertEntry(pc, pt_entry); + prefetchTable.insertEntry(pc, pt_entry-> secure, pt_entry); pt_entry->address = addr; pt_entry->secure = is_secure; } diff --git a/src/mem/cache/prefetch/indirect_memory.hh b/src/mem/cache/prefetch/indirect_memory.hh index 1062545301..00c89fd036 100644 --- a/src/mem/cache/prefetch/indirect_memory.hh +++ b/src/mem/cache/prefetch/indirect_memory.hh @@ -121,7 +121,7 @@ class IndirectMemory : public Queued } }; /** Prefetch table */ - AssociativeCache prefetchTable; + AssociativeSet prefetchTable; /** Indirect Pattern Detector entrt */ struct IndirectPatternDetectorEntry : public TaggedEntry diff --git a/src/mem/cache/prefetch/pif.cc b/src/mem/cache/prefetch/pif.cc index 138c89f08e..6d62910452 100644 --- a/src/mem/cache/prefetch/pif.cc +++ b/src/mem/cache/prefetch/pif.cc @@ -176,14 +176,16 @@ 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); - - auto idx_entry = index.findEntry(spatialCompactor.trigger); + constexpr bool is_secure = false; + auto idx_entry = index.findEntry(spatialCompactor.trigger, + 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, idx_entry); + index.insertEntry(spatialCompactor.trigger, is_secure, + idx_entry); } idx_entry->historyIt = historyBuffer.getIterator(historyBuffer.tail()); @@ -205,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 @@ -219,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); + IndexEntry *idx_entry = index.findEntry(pc, is_secure); if (idx_entry != nullptr) { index.accessEntry(idx_entry); diff --git a/src/mem/cache/prefetch/pif.hh b/src/mem/cache/prefetch/pif.hh index 3592397804..9422419db5 100644 --- a/src/mem/cache/prefetch/pif.hh +++ b/src/mem/cache/prefetch/pif.hh @@ -143,7 +143,7 @@ class PIF : public Queued * The index table is a small cache-like structure that facilitates * fast search of the history buffer. */ - AssociativeCache index; + AssociativeSet index; /** * A Stream Address Buffer (SAB) tracks a window of consecutive diff --git a/src/mem/cache/prefetch/signature_path.cc b/src/mem/cache/prefetch/signature_path.cc index 122c498be7..7f2f8b4794 100644 --- a/src/mem/cache/prefetch/signature_path.cc +++ b/src/mem/cache/prefetch/signature_path.cc @@ -192,7 +192,8 @@ SignaturePath::getSignatureEntry(Addr ppn, bool is_secure, SignaturePath::PatternEntry & SignaturePath::getPatternEntry(Addr signature) { - PatternEntry* pattern_entry = patternTable.findEntry(signature); + constexpr bool is_secure = false; + PatternEntry* pattern_entry = patternTable.findEntry(signature, is_secure); if (pattern_entry != nullptr) { // Signature found patternTable.accessEntry(pattern_entry); @@ -201,7 +202,7 @@ SignaturePath::getPatternEntry(Addr signature) pattern_entry = patternTable.findVictim(signature); assert(pattern_entry != nullptr); - patternTable.insertEntry(signature, pattern_entry); + patternTable.insertEntry(signature, is_secure, pattern_entry); } return *pattern_entry; } @@ -277,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); + patternTable.findEntry(current_signature, is_secure); PatternStrideEntry const *lookahead = nullptr; if (current_pattern_entry != nullptr) { unsigned long max_counter = 0; diff --git a/src/mem/cache/prefetch/signature_path.hh b/src/mem/cache/prefetch/signature_path.hh index d5e1ea18ab..c4a640ae78 100644 --- a/src/mem/cache/prefetch/signature_path.hh +++ b/src/mem/cache/prefetch/signature_path.hh @@ -148,7 +148,7 @@ class SignaturePath : public Queued }; /** Pattern table */ - AssociativeCache patternTable; + AssociativeSet patternTable; /** * Generates a new signature from an existing one and a new stride diff --git a/src/mem/cache/prefetch/signature_path_v2.cc b/src/mem/cache/prefetch/signature_path_v2.cc index 518fc3e0e7..34209e6f00 100644 --- a/src/mem/cache/prefetch/signature_path_v2.cc +++ b/src/mem/cache/prefetch/signature_path_v2.cc @@ -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, gh_entry); + constexpr bool is_secure = false; + globalHistoryRegister.insertEntry(0, is_secure, gh_entry); gh_entry->signature = signature; gh_entry->lastBlock = last_offset; diff --git a/src/mem/cache/prefetch/signature_path_v2.hh b/src/mem/cache/prefetch/signature_path_v2.hh index ee9e2cdc3c..417b7ec540 100644 --- a/src/mem/cache/prefetch/signature_path_v2.hh +++ b/src/mem/cache/prefetch/signature_path_v2.hh @@ -66,7 +66,7 @@ class SignaturePathV2 : public SignaturePath delta(0) {} }; /** Global History Register */ - AssociativeCache globalHistoryRegister; + AssociativeSet globalHistoryRegister; double calculateLookaheadConfidence(PatternEntry const &sig, PatternStrideEntry const &lookahead) const override; diff --git a/src/mem/cache/prefetch/spatio_temporal_memory_streaming.cc b/src/mem/cache/prefetch/spatio_temporal_memory_streaming.cc index c2f936b176..b16267c09f 100644 --- a/src/mem/cache/prefetch/spatio_temporal_memory_streaming.cc +++ b/src/mem/cache/prefetch/spatio_temporal_memory_streaming.cc @@ -92,12 +92,15 @@ STeMS::checkForActiveGenerationsEnd(const CacheAccessor &cache) } if (generation_ended) { // PST is indexed using the PC (secure bit is unused) - auto pst_entry = patternSequenceTable.findEntry(pst_addr); + constexpr bool is_secure = false; + auto pst_entry = patternSequenceTable.findEntry(pst_addr, + 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, pst_entry); + patternSequenceTable.insertEntry(pst_addr, is_secure, + pst_entry); } else { patternSequenceTable.accessEntry(pst_entry); } @@ -219,9 +222,11 @@ STeMS::reconstructSequence( // Now query the PST with the PC of each RMOB entry idx = 0; + constexpr bool is_secure = false; for (auto it = rmob_it; it != rmob.end() && (idx < reconstructionEntries); it++) { - auto pst_entry = patternSequenceTable.findEntry(it->pstAddress); + auto pst_entry = patternSequenceTable.findEntry(it->pstAddress, + is_secure); if (pst_entry != nullptr) { patternSequenceTable.accessEntry(pst_entry); for (auto &seq_entry : pst_entry->sequence) { diff --git a/src/mem/cache/prefetch/spatio_temporal_memory_streaming.hh b/src/mem/cache/prefetch/spatio_temporal_memory_streaming.hh index 753c6a79b4..c6cd2f72d1 100644 --- a/src/mem/cache/prefetch/spatio_temporal_memory_streaming.hh +++ b/src/mem/cache/prefetch/spatio_temporal_memory_streaming.hh @@ -155,7 +155,7 @@ class STeMS : public Queued /** Active Generation Table (AGT) */ AssociativeSet activeGenerationTable; /** Pattern Sequence Table (PST) */ - AssociativeCache patternSequenceTable; + AssociativeSet patternSequenceTable; /** Data type of the Region Miss Order Buffer entry */ struct RegionMissOrderBufferEntry