Review Board 2.0.15


mem: Fix prefetchSquash + memInhibitAsserted bug

Review Request #2654 - Created Feb. 13, 2015 and submitted

Information
Andreas Hansson
gem5
default
Reviewers
Default
Changeset 10706:7aa00b79bc99
---------------------------
mem: Fix prefetchSquash + memInhibitAsserted bug

This patch resolves a bug with hardware prefetches. Before a hardware
prefetch is sent towards the memory, the system generates a snoop
request to check all caches above the prefetch generating cache for
the presence of the prefetth target. If the prefetch target is found
in the tags or the MSHRs of the upper caches, the cache sets the
prefetchSquashed flag in the snoop packet. When the snoop packet
returns with the prefetchSquashed flag set, the prefetch generating
cache deallocates the MSHR reserved for the prefetch. If the prefetch
target is found in the writeback buffer of the upper cache, the cache
sets the memInhibit flag, which signals the prefetch generating cache
to expect the data from the writeback. When the snoop packet returns
with the memInhibitAsserted flag set, it marks the allocated MSHR as
inService and waits for the data from the writeback.

If the prefetch target is found in multiple upper level caches,
specifically in the tags or MSHRs of one upper level cache and the
writeback buffer of another, the snoop packet will return with both
prefetchSquashed and memInhibitAsserted set, while the current code is
not written to handle such an outcome. Current code checks for the
prefetchSquashed flag first, if it finds the flag, it deallocates the
reserved MSHR. This leads to assert failure when the data from the
writeback appears at cache. In this fix, we simply switch the order of
checks. We first check for memInhibitAsserted and then for prefetch
squashed.

   
Review request changed
Updated (March 2, 2015, 1:37 a.m.)

Status: Closed (submitted)