diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-21 01:41:10 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-21 01:41:10 +0000 |
commit | 0fb60bd6ab16336e9f7d91b90beb7d6766cfce78 (patch) | |
tree | 8306c1a98cbc08e5c99e04c9ab6278ac6e1099be /linux-user/mips | |
parent | 189efbd987bc39889f71d307ed22f56fe2c6bd54 (diff) | |
download | qemu-0fb60bd6ab16336e9f7d91b90beb7d6766cfce78.tar.gz qemu-0fb60bd6ab16336e9f7d91b90beb7d6766cfce78.tar.bz2 qemu-0fb60bd6ab16336e9f7d91b90beb7d6766cfce78.zip |
MIPS signal handling fixes.
Also fixes a register corruption bug in do_sigreturn. When "returning"
from sigreturn we are actually restoring the virtual cpu state from the
signal frame. This is actually surprisingly hard to observe in practice.
Typically an thread be blocked in a FUTEX_WAIT call when the signal arrives,
so the effect is a spurious syscall success and the introduction of a
subtle race condition.
On x86/arm a syscall modifies a single word sized register, so
do_sigreturn can just return that value. On MIPS a syscall clobbers
multiple registers, so we need additional smarts. My solution is to
invent a magic errno value that means "don't touch CPU state".
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7194 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/mips')
-rw-r--r-- | linux-user/mips/syscall.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/linux-user/mips/syscall.h b/linux-user/mips/syscall.h index 9dfcc1f205..3deb862cc4 100644 --- a/linux-user/mips/syscall.h +++ b/linux-user/mips/syscall.h @@ -221,4 +221,7 @@ struct target_pt_regs { +/* Nasty hack: define a fake errno value for use by sigreturn. */ +#define TARGET_QEMU_ESIGRETURN 255 + #define UNAME_MACHINE "mips" |