cpu: Fix LLSC atomic CPU wakeup
Writes to locked memory addresses (LLSC) did not wake up the locking CPU. This can lead to deadlocks on multi-core runs. In AtomicSimpleCPU, recvAtomicSnoop was checking if the incoming packet was an invalidation (isInvalidate) and only then handled a locked snoop. But, writes are seen instead of invalidates when running without caches (fast-forward configurations). As as simple fix, now handleLockedSnoop is also called even if the incoming snoop packet are from writes.
This commit is contained in:
@@ -876,8 +876,14 @@ TimingSimpleCPU::DcachePort::recvTimingSnoopReq(PacketPtr pkt)
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &t_info : cpu->threadInfo) {
|
||||
TheISA::handleLockedSnoop(t_info->thread, pkt, cacheBlockMask);
|
||||
// Making it uniform across all CPUs:
|
||||
// The CPUs need to be woken up only on an invalidation packet (when using caches)
|
||||
// or on an incoming write packet (when not using caches)
|
||||
// It is not necessary to wake up the processor on all incoming packets
|
||||
if (pkt->isInvalidate() || pkt->isWrite()) {
|
||||
for (auto &t_info : cpu->threadInfo) {
|
||||
TheISA::handleLockedSnoop(t_info->thread, pkt, cacheBlockMask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user