mem-ruby: Fix race related to atomics in VIPER
authorMatthew Poremba <matthew.poremba@amd.com>
Fri, 15 Jan 2021 01:03:00 +0000 (19:03 -0600)
committerMatthew Poremba <matthew.poremba@amd.com>
Fri, 15 Jan 2021 17:46:38 +0000 (17:46 +0000)
commit7246f70bfb7697b71d643334b7015b7274810b5f
tree87d4862eea47b3786e172f1c9bbec89eab0f3655
parente91524b1f21bf861eddeda5cc4b4f88b6bcb6ba7
mem-ruby: Fix race related to atomics in VIPER

There is a race condition in VIPER where an atomic issued to the same
address can occur resulting in multiple trigger messages signalling the
compleition of the atomic operation. The first message was deallocating
the TBE causing the second message to dereference a nullptr when looking
up the TBE.

A counter is added to track the number of in flight AtomicDone trigger
messages. The AtomicDone is not called until the last in flight message
arrives at the trigger queue. The remaining messages call AtomicNotDone
which simply pops the message from the queue and keeps the TBE
allocated.

Change-Id: Ie1de0436861a7c393ad6d2fb2faceb83c18d4cc3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39175
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/ruby/protocol/GPU_VIPER-TCC.sm