target-arm/powerctl: defer cpu reset work to CPU context
commit062ba099e01ff1474be98c0a4f3da351efab5d9d
authorAlex Bennée <alex.bennee@linaro.org>
Thu, 23 Feb 2017 18:29:23 +0000 (23 18:29 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Fri, 24 Feb 2017 10:32:46 +0000 (24 10:32 +0000)
treef68acd0039cb955d536aacff5c3b177fcb53cf09
parentc3b9a07a33de8015726b397270485c3998e7f86a
target-arm/powerctl: defer cpu reset work to CPU context

When switching a new vCPU on we want to complete a bunch of the setup
work before we start scheduling the vCPU thread. To do this cleanly we
defer vCPU setup to async work which will run the vCPUs execution
context as the thread is woken up. The scheduling of the work will kick
the vCPU awake.

This avoids potential races in MTTCG system emulation.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/arm-powerctl.c
target/arm/arm-powerctl.h
target/arm/cpu.c
target/arm/cpu.h
target/arm/kvm.c
target/arm/machine.c
target/arm/psci.c