dev, arm: Fix multi-core KVM race in the generic timer
authorAndreas Sandberg <andreas.sandberg@arm.com>
Fri, 17 Mar 2017 11:57:23 +0000 (11:57 +0000)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Mon, 3 Apr 2017 16:37:55 +0000 (16:37 +0000)
commitd2254e034e76dc23320ea1b300177a79e4818b61
tree342e9210684cc6f44b7a194382089f341585b8a0
parentd7aef8be964b5f7eee2dace0cfc347fb23fa7ab2
dev, arm: Fix multi-core KVM race in the generic timer

The generic timer sometimes needs to access global state. This can
lead to race conditions when simulating a multi-core KVM system where
each core lives in its own thread. In that case, the setMiscReg and
readMiscReg methods are called from the thread owning the CPU and not
the global device thread.

Change-Id: Ie3e982258648c8562cce0b30a0c122dfbfaf42cd
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Gabor Dozsa <gabor.dozsa@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2460
Reviewed-by: Weiping Liao <weipingliao@google.com>
src/dev/arm/generic_timer.cc