]> git.proxmox.com Git - qemu.git/commit
Handle CPU interrupts by inline checking of a flag
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 9 May 2013 15:30:30 +0000 (19:30 +0400)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 14 May 2013 20:48:21 +0000 (15:48 -0500)
commit2ebcc590c9e2f7af963794d699fb248c29be9643
treed48a35631bd80ed8ca24abaccc4efae4c4b3f2f0
parent69001b31458560ca7cf18151cad279714fd443c1
Handle CPU interrupts by inline checking of a flag

Fix some of the nasty TCG race conditions and crashes by implementing
cpu_exit() as setting a flag which is checked at the start of each TB.
This avoids crashes if a thread or signal handler calls cpu_exit()
while the execution thread is itself modifying the TB graph (which
may happen in system emulation mode as well as in linux-user mode
with a multithreaded guest binary).

This fixes the crashes seen in LP:668799; however there are another
class of crashes described in LP:1098729 which stem from the fact
that in linux-user with a multithreaded guest all threads will
use and modify the same global TCG date structures (including the
generated code buffer) without any kind of locking. This means that
multithreaded guest binaries are still in the "unsupported"
category.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
(cherry picked from commit 378df4b23753a11be650af7664ca76bc75cb9f01)

Conflicts:
exec.c
include/qom/cpu.h
translate-all.c
include/exec/gen-icount.h

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Conflicts:
cpu-exec.c

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
cpu-exec.c
exec.c
include/exec/cpu-defs.h
include/exec/gen-icount.h
tcg/tcg.h
translate-all.c