summary refs log tree commit diff stats
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2022-08-09 10:55:14 +0100
committerPeter Maydell <peter.maydell@linaro.org>2022-08-09 10:55:14 +0100
commitc7f26ded6d5065e4116f630f6a490b55f6c5f58e (patch)
treefd61cf34b851f0634b7779c7d9e564f41f8b9069 /linux-user/syscall.c
parentca5f3d4df1b47d7f66a109cdb504e83dfd7ec433 (diff)
downloadfocaccia-qemu-c7f26ded6d5065e4116f630f6a490b55f6c5f58e.tar.gz
focaccia-qemu-c7f26ded6d5065e4116f630f6a490b55f6c5f58e.zip
icount: Take iothread lock when running QEMU timers
The function icount_prepare_for_run() is called with the iothread
unlocked, but it can call icount_notify_aio_contexts() which will
run qemu timer handlers. Those are supposed to be run only with
the iothread lock held, so take the lock while we do that.

Since icount mode runs everything on a single thread anyway,
not holding the lock is likely mostly not going to introduce
races, but it can cause us to trip over assertions that we
do hold the lock, such as the one reported in issue 1130.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1130
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Message-id: 20220801164527.3134765-1-peter.maydell@linaro.org
Diffstat (limited to 'linux-user/syscall.c')
0 files changed, 0 insertions, 0 deletions