cpu: Fix LLSC atomic CPU wakeup
Review Request #3316 - Created Feb. 9, 2016 and submitted
| Information | |
|---|---|
| Curtis Dunham | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
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.Tests, Ran regression on all ISAs, observed acceptable change in 1:
opt/quick/fs/10.linux-boot/arm/linux/realview-simple-timing-dual
Description: |
|
|---|
So if you look at http://grok.gem5.org/search?q=handleLockedSnoop&defs=&refs=&path=&hist=&type=&project=gem5 there are multiple places where TheISA::handleLockedSnoop() is called from the various CPU models. Are we consistent in that this is only ever called on writes or invalidates? Is there a problem with it being called unconditionally, as it apparently is in most places?
Or to put it another way, your problem with AtomicSimpleCPU was the 'if (pkt->isInvalidate())' check; an alternative solution would be just to get rid of that check entirely rather than adding pkt->isWrite() to the condition. And regardless of which way the solution goes, we should be sure it's applied consistently at all of the TheISA::handleLockedSnoop() call sites. (And maybe even document that somewhere!)
