diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-12-07 12:41:21 +0000 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2018-01-23 14:20:52 +0100 |
commit | 06065c451f10c7ef62cfb575a87f323a70ae1c9e (patch) | |
tree | d3c378e1c2edb830504a28487d14e0add05b9e2f /linux-user/syscall.c | |
parent | 024949caf32805f4cc3e7d363a80084b47aac1f6 (diff) | |
download | qemu-06065c451f10c7ef62cfb575a87f323a70ae1c9e.zip qemu-06065c451f10c7ef62cfb575a87f323a70ae1c9e.tar.gz qemu-06065c451f10c7ef62cfb575a87f323a70ae1c9e.tar.bz2 |
linux-user: wrap fork() in a start/end exclusive section
When we do a fork() in usermode emulation, we need to be in
a start/end exclusive section, so that we can ensure that no
other thread is in an RCU section. Otherwise you can get this
deadlock:
- fork thread: has mmap_lock, waits for rcu_sync_lock
(because rcu_init_lock() is registered as a pthread_atfork() hook)
- RCU thread: has rcu_sync_lock, waits for rcu_read_(un)lock
- another CPU thread: in RCU critical section, waits for mmap_lock
This can show up if you have a heavily multithreaded guest program
that does a fork().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reported-by: Stuart Monteith <stuart.monteith@linaro.org>
Message-Id: <1512650481-1723-1-git-send-email-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/syscall.c')
0 files changed, 0 insertions, 0 deletions