qemu-e2k/linux-user
Peter Maydell 06065c451f 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>
2018-01-23 14:20:52 +01:00
..
aarch64 linux-user: Add separate aarch64_be uname 2018-01-11 13:25:31 +00:00
alpha
arm linux-user/arm/nwfpe: Check coprocessor number for FPA emulation 2018-01-11 13:25:39 +00:00
cris
host Replace 'struct ucontext' with 'ucontext_t' type 2017-07-20 10:10:28 +01:00
hppa linux-user/hppa: Fix typo for TARGET_NR_epoll_wait 2017-11-07 21:58:13 +02:00
i386
m68k
microblaze
mips
mips64
nios2
openrisc
ppc
s390x
sh4
sparc sparc: embed sparc_def_t into CPUSPARCState 2017-09-01 11:54:24 -03:00
sparc64
tilegx
unicore32
x86_64
elfload.c linux-user: Fix calculation of auxv length 2017-11-20 16:15:41 +02:00
errno_defs.h
flat.h
flatload.c
ioctls.h linux-user: Add some random ioctls 2017-10-16 21:00:04 +03:00
linux_loop.h
linuxload.c
m68k-sim.c
main.c linux-user: wrap fork() in a start/end exclusive section 2018-01-23 14:20:52 +01:00
Makefile.objs
mmap.c
qemu.h
safe-syscall.S
signal.c linux-user: Fix endianess of aarch64 signal trampoline 2018-01-11 13:25:31 +00:00
socket.h
strace.c linux-user: fix O_TMPFILE handling 2017-10-16 16:00:56 +03:00
strace.list linux-user: add rt_tgsigqueueinfo() strace 2017-05-29 14:56:08 +03:00
syscall_defs.h linux-user: Handle TARGET_MAP_STACK and TARGET_MAP_HUGETLB 2017-11-07 21:58:13 +02:00
syscall_types.h
syscall.c linux-user: Handle rt_sigaction correctly for SPARC 2017-11-07 21:59:51 +02:00
target_flat.h
trace-events trace-events: fix code style: print 0x before hex numbers 2017-08-01 12:13:07 +01:00
uaccess.c
uname.c
uname.h
vm86.c