From cabd4768c7186911fda91b9ea458df775b79486a Mon Sep 17 00:00:00 2001 From: Krishnendra Nathella Date: Sun, 19 Jul 2015 15:03:30 -0500 Subject: 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. --- src/cpu/o3/lsq_unit_impl.hh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/cpu/o3/lsq_unit_impl.hh') diff --git a/src/cpu/o3/lsq_unit_impl.hh b/src/cpu/o3/lsq_unit_impl.hh index 288f6271e..b87ab0240 100644 --- a/src/cpu/o3/lsq_unit_impl.hh +++ b/src/cpu/o3/lsq_unit_impl.hh @@ -438,10 +438,8 @@ LSQUnit::checkSnoop(PacketPtr pkt) int load_idx = loadHead; DPRINTF(LSQUnit, "Got snoop for address %#x\n", pkt->getAddr()); - // Unlock the cpu-local monitor when the CPU sees a snoop to a locked - // address. The CPU can speculatively execute a LL operation after a pending - // SC operation in the pipeline and that can make the cache monitor the CPU - // is connected to valid while it really shouldn't be. + // Only Invalidate packet calls checkSnoop + assert(pkt->isInvalidate()); for (int x = 0; x < cpu->numContexts(); x++) { ThreadContext *tc = cpu->getContext(x); bool no_squash = cpu->thread[x]->noSquashFromTC; -- cgit v1.2.3