| Branch: | Revision:

root / linux-user / signal.c @ 93148aa5

History | View | Annotate | Download (155.4 kB)

# Date Author Comment
93148aa5 03/08/2012 05:22 pm Stefan Weil

Spelling fixes in comments (it's -> its)

  • it's -> its (fixed for all files)
  • dont -> don't (only fixed in a line which was touched by the previous fix)
  • distrub -> disturb (fixed in the same line)

Reviewed-by: Andreas Färber <>
Signed-off-by: Stefan Weil <>...

f78b0f05 02/02/2012 05:51 pm Andreas Färber

linux-user: Fix sa_flags byte swaps for mips

sa_flags is uint32_t for mips{,n32,64}, so don't use tswapal().

edited by Riku Voipio: likewise on alpha

Reported-by: Khansa Butt <>
Suggested-by: Richard Henderson <>
Signed-off-by: Andreas Färber <>...

b4916d7b 12/02/2011 12:50 pm Dong Xu Wang

fix spelling in linux-user sub directory

Cc: Riku Voipio <>
Signed-off-by: Dong Xu Wang <>
Signed-off-by: Stefan Hajnoczi <>

ff74c5a9 10/31/2011 10:05 pm Anthony Liguori

Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging

cbb21eed 10/27/2011 02:42 pm Matthias Braun

linux-user: fix abi_(u)long, target_ulong mismatch

abi_(u)long might be different from target_ulong, so don't use tswapl
but introduce a new tswapal

Signed-off-by: Matthias Braun <>
Signed-off-by: Riku Voipio <>

30038fd8 10/26/2011 11:55 pm Richard Henderson

target-sparc: Change fpr representation to doubles.

This allows a more efficient representation for 64-bit hosts.
It should be about the same for 32-bit hosts, as we can still
access the individual pieces of the double.

Signed-off-by: Richard Henderson <>

ca8a277c 10/05/2011 11:26 am Stefan Weil

linux-user: Remove unused code

The code is unused since 8 years, so remove it.

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

cb9c6268 08/26/2011 08:59 am Edgar E. Iglesias

linux-user: Correct a few missuses of host addresses

Fix a few cases where we were passing host pointers to the

Signed-off-by: Edgar E. Iglesias <>

6fea2ea4 07/13/2011 05:39 pm Peter Maydell

linux-user/signal.c: Rename s390 target_ucontext fields to fix ia64

The ia64 sys/ucontext.h defines macros 'uc_link', 'uc_sigmask' and
'uc_stack'. Rename the s390 target_ucontext struct members to tuc_*,
bringing them into line with the other targets and fixing a compile...

2aec3a27 06/21/2011 08:30 pm Peter Maydell

linux-user/signal.c: Remove only-ever-set variable fpu_save_addr

Move the access of fpu_save into the commented out skeleton code for
restoring FPU registers on SPARC sigreturn, thus silencing a gcc
4.6 "variable set but never used" warning.
(This doesn't affect the calculation of 'err' because in fact...

c7b016ba 06/21/2011 08:30 pm Peter Maydell

linux-user/signal.c: Remove unused fenab

Remove fenab as it is only written, never used. Add a FIXME
comment about the discrepancy between our behaviour and that
of the Linux kernel for this routine.

Signed-off-by: Peter Maydell <>...

9a826d78 06/20/2011 05:00 pm Mike McCormack

Don't translate pointer when in restore_sigcontext

Fixes crash in i386 when user emulation base address is non-zero.

21797 rt_sigreturn(8,1082124603,1,0,1082126048,1082126248)Exit reason and status: signal 11

Signed-off-by: Mike McCormack <>...

9bf0960a 06/08/2011 11:04 am Alexandre Raymond

Fix compilation warning due to missing header for sigaction (followup)

This patch removes all references to signal.h when qemu-common.h is included
as they become redundant.

Signed-off-by: Alexandre Raymond <>
Signed-off-by: Stefan Hajnoczi <>

a4c075f1 05/20/2011 06:35 pm Ulrich Hecht

s390x: s390x-linux-user support

This patch adds support for running s390x binaries in the linux-user emulation

Signed-off-by: Ulrich Hecht <>
Signed-off-by: Alexander Graf <>

0c58751c 05/08/2011 12:02 pm Stefan Weil

Fix typo in comment (dieing -> dying)

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

005e1a0a 02/10/2011 09:18 pm Peter Maydell

linux-user/arm: fix compilation failures using softfloat's struct types

Add uses of the float32/float64 boxing and unboxing macros so that
the ARM linux-user targets will compile with USE_SOFTFLOAT_STRUCT_TYPES

Signed-off-by: Peter Maydell <>...

e321c34a 02/01/2011 07:03 pm Peter Maydell

linux-user: avoid gcc array overrun warning for sparc

Suppress a gcc array bounds overrun warning when filling in the SPARC
signal frame by adjusting our definition of the structure so that the
fp and callers_pc membes are part of the ins[] array rather than...

964413d9 01/14/2011 09:39 pm Peter Maydell

linux-user: ARM: clear the IT bits when invoking a signal handler

When invoking a signal handler for an ARM target, make sure the IT
bits in the CPSR are cleared. (This would otherwise cause incorrect
execution if the IT state was non-zero when an exception occured....

5f0b7c88 12/03/2010 03:09 pm Peter Maydell

ARM: linux-user: Correct size of padding in target_ucontext_v2

The padding in the target_ucontext_v2 is defined by the size of
the target's sigset_t type, not the host's. (This bug only causes
problems when we start using the uc_regspace[] array to expose...

0d871bdb 12/03/2010 03:09 pm Peter Maydell

ARM: linux-user: Expose VFP registers to signal handlers

For ARM linux-user mode signal handlers, fill in the ucontext with
VFP register contents in the same way that the kernel does. We only
do this for v2 format sigframe (2.6.12 and above); this is actually...

5f9099d9 12/03/2010 03:09 pm Peter Maydell

ARM: linux-user: Restore VFP state from ucontext on sigreturn

Restore the VFP registers from the ucontext on return from a signal
handler in linux-user mode. This means that signal handlers cannot
accidentally corrupt the interrupted code's VFP state, and allows...

08e11256 12/03/2010 03:09 pm Peter Maydell

ARM: linux-user: Expose iWMMXT registers to signal handlers

Signed-off-by: Peter Maydell <>
Signed-off-by: Riku Voipio <>

a59d69da 12/03/2010 03:09 pm Peter Maydell

ARM: linux-user: Restore iWMMXT state from ucontext on sigreturn

Signed-off-by: Peter Maydell <>
Signed-off-by: Riku Voipio <>

f711df67 11/23/2010 11:04 am Richard Henderson

microblaze: target-ify target_ucontext

Rename the members of target_ucontext so that they don't conflict
with possible host macros for ucontext members. This has already
been done for the other targets.

Signed-off-by: Richard Henderson <>...

b2178704 07/23/2010 10:30 am Edgar E. Iglesias

microblaze: Pass a ucontext * as 3rd sighandler arg

There is disagreement between microblaze glibc and the kernel
to what the third arg of signal handlers should point to.

Change QEMU linux-user to match the kernel port. glibc patches
are pending.

Signed-off-by: Edgar E. Iglesias <>

187b4e08 07/15/2010 04:32 pm Edgar E. Iglesias

microblaze: Correct signal frame setup.

Pass the context in r7.

Signed-off-by: Edgar E. Iglesias <>

5a834bb4 05/09/2010 11:19 pm Blue Swirl

sparc: Fix lazy flag calculation on interrupts, refactor

Recalculate Sparc64 CPU flags on interrupts, otherwise some earlier
flags could be stored to pstate.

Refactor PSR/CCR/CWP handling: concentrate the actual
functions to op_helper.c.

Thanks to Igor Kovalenko for reporting....

60e99246 04/01/2010 10:51 pm Aurelien Jarno

linux-user/ia64: workaround ia64 strangenesses

ia64 has some strangenesses that need to be workaround:
- it has a __clone2() syscall instead of the using clone() one, with
different arguments, and which is not declared in the usual headers.
- ucontext.uc_sigmask is declared with type long int, while it is...

43dc2a64 03/18/2010 08:41 pm Blue Swirl

Replace assert(0) with abort() or cpu_abort()

When building with -DNDEBUG, assert(0) will not stop execution
so it must not be used for abnormal termination.

Use cpu_abort() when in CPU context, abort() otherwise.

Signed-off-by: Blue Swirl <>

a6c6f76c 03/13/2010 04:18 pm Blue Swirl

Fix build with -DNDEBUG in CFLAGS

Signed-off-by: Blue Swirl <>

d8714436 03/06/2010 08:37 pm

linux-user: Save/restore fpu registers to signal context on sh4

As "todo" comment in source code.
And modify restore_sigcontext() to have three args as kernel's does.

Signed-off-by: Takashi YOSHII <>
Signed-off-by: Aurelien Jarno <>

6049f4f8 02/28/2010 06:54 pm Richard Henderson

alpha-linux-user: Implement signals.

Move userland PALcode handling into linux-user main loop so that
we can send signals from there. This also makes alpha_palcode.c
system-level only, so don't build it for userland. Add defines
for GENTRAP PALcall mapping to signals....

66393fb9 12/19/2009 08:45 pm Riku Voipio

linux-user: cleanup force_sig() calls

Force_sig should be always called with TARGET_ signals.
Not that it really matters with SEGV, so this patch is
just for cleanup and improving consistency.

Signed-off-by: Riku Voipio <>
Signed-off-by: Aurelien Jarno <>

3ca05588 11/24/2009 08:51 pm Arnaud Patard

linux-user: remove hardcoded value of _NSIG in signal.c

In a bunch of places, 64 is used as value of _NSIG but it's wrong
at least on MIPS were _NSIG is 128.

Based on a patch from Arnaud Patard <>

Signed-off-by: Aurelien Jarno <>

c227f099 10/02/2009 12:12 am Anthony Liguori

Revert "Get rid of _t suffix"

In the very least, a change like this requires discussion on the list.

The naming convention is goofy and it causes a massive merge problem. Something
like this must be presented on the list first so people can provide input...

99a0949b 10/01/2009 09:45 pm malc

Get rid of _t suffix

Some not so obvious bits, slirp and Xen were left alone for the time

Signed-off-by: malc <>

7181155d 08/25/2009 05:15 pm Laurent Vivier

m68k, linux-user: add setup_rt_frame

This patch implements setup_rt_frame().

Signed-off-by: Laurent Vivier <>
Signed-off-by: Riku Voipio <>

492a8744 08/25/2009 05:15 pm Laurent Vivier

m68k,linux-user: add setup_frame

This patch adds signals management for linux-user.

It implements setup_frame() which allows to call the user signal

setup_rt_frame() is always unimplemented.

Signed-off-by: Laurent Vivier <>
Signed-off-by: Riku Voipio <>

0bf9e31a 07/20/2009 08:19 pm Blue Swirl

Fix most warnings (errors with -Werror) when debugging is enabled

I used the following command to enable debugging:
perl -p -i -e 's/^\/\/#define DEBUG/#define DEBUG/g' * /* *//*

Signed-off-by: Blue Swirl <>

3efa9a67 07/18/2009 12:16 pm malc

Avoid name clashes with symbols that leak from system headers

Signed-off-by: malc <>

8167ee88 07/16/2009 11:47 pm Blue Swirl

Update to a hopefully more future proof FSF address

Signed-off-by: Blue Swirl <>

94c5495d 07/09/2009 08:40 pm Paul Brook

MIPS signal handling fix

Add explicit padding to MIPS signal frame structures.

Signed-off-by: Paul Brook <>

edf8e2af 06/16/2009 04:56 pm Mika Westerberg

linux-user: implemented ELF coredump support for ARM target

When target process is killed with signal (such signal that
should dump core) a coredump file is created. This file is
similar than coredump generated by Linux (there are few exceptions

b779e29e 05/26/2009 10:10 pm Edgar E. Iglesias

microblaze: linux-user support.

Signed-off-by: Edgar E. Iglesias <>

bcd4933a 05/16/2009 12:36 am Nathan Froyd

linux-user: ppc signal handling

Implement setup_{,rt_}frame and do_{,rt_}sigreturn for PPC 32-bit. Use
the same TARGET_QEMU_ESIGRETURN hack as for MIPS to avoid clobbering
register state on a sigreturn.

Signed-off-by: Nathan Froyd <>...

0b1bcb00 04/21/2009 04:41 am pbrook

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,...

1d9d8b55 04/16/2009 06:17 pm pbrook

Translate signal values in exit status.

Signed-off-by: Paul Brook <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

603e4fd7 04/15/2009 07:18 pm aurel32

linux-user: proper exit code for uncaught signals

The proper exit code for dieing from an uncaught signal is -<signal>.
The kernel doesn't allow exit() or _exit() to pass a negative value.
To get the proper exit code we need to actually die from an uncaught signal....

3098dba0 03/07/2009 11:28 pm aurel32

Use a dedicated function to request exit from execution loop

Signed-off-by: Aurelien Jarno <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

c2764719 03/07/2009 05:24 pm pbrook

The _exit syscall is used for both thread termination in NPTL applications,
and process termination in legacy applications. Try to guess which we want
based on the presence of multiple threads.

Also implement locking when modifying the CPU list.

Signed-off-by: Paul Brook <>...

a5e50b26 02/02/2009 12:19 am malc

Replace noreturn with QEMU_NORETURN

Thanks to Robert Riebisch for analysis [1]


git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

dc7eea67 01/30/2009 10:15 pm aurel32

linux-user: fix signal.c warning

This patch fixes:

linux-user/signal.c:1403: warning: no previous prototype for 'do_sigreturn_v1'
linux-user/signal.c:1473: warning: no previous prototype for 'do_sigreturn_v2'
linux-user/signal.c:1511: warning: no previous prototype for 'do_rt_sigreturn_v1'...

7d99a001 01/14/2009 09:00 pm blueswir1

Add noreturn function attribute

Introduce noreturn attribute and attach it to cpu_loop_exit as well as
interrupt/exception helpers for i386. This avoids a bunch of gcc4

[ Note that this patch comes with a workaround to include qemu-common.h
even in cases where is currently causes conflicts with dyngen-exec.h....

530e7615 01/05/2009 08:11 pm blueswir1

Fix more FSF addresses

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

eaa449b9 01/03/2009 03:14 pm aurel32

Fix qemu endless loop when raising a SIGSEGV/SIGBUS signal with gdbstub in user emulation

When a SIGSEGV signal is raised in user mode emulation the current
test to know whether the signal is sent by the kernel is wrong :

info->si_code == SI_KERNEL

according to /usr/include/bits/siginfo.h it should be...

ca587a8e 12/19/2008 12:44 am aurel32

User-mode GDB stub improvements - handle signals

Handle signals in the user-mode GDB stub. Report them to GDB, and
allow it to change or cancel them. Also correct the protocol numbering;
it happens to match Linux numbering for SIGINT and SIGTRAP, but that's...

60b19691 11/27/2008 05:47 pm ths

linux-user: Add support for STOP/CONT signals.

Signed-off-by: Riku Voipio <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

2a913eb1 11/27/2008 05:46 pm ths

linux-user: sig is target signal.

Signed-off-by: Riku Voipio <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

235262cf 10/08/2008 05:39 pm edgar_igl

CRIS: linux-user signals dont need ERP compensation after break anymore.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

249c4c32 10/05/2008 02:09 pm blueswir1

Make target_sigaltstack_used static

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

ac509d88 09/16/2008 04:36 pm balrog

Move offsetof to osdep.h, remove local defintions.

With this container_of can actually be used without causing build errors.
Reformat container_of.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

8fcd3692 08/17/2008 11:26 pm blueswir1

Fix some warnings that would be generated by gcc -Wmissing-prototypes

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

526ccb7a 07/16/2008 03:13 pm balrog

Fix a bunch of type mismatch-related warnings (Jan Kiszka).

Fix a typo in my previous comming (spotted by Laurent Desnouges).

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

b5dc7732 06/27/2008 01:02 pm ths

More efficient target register / TC accesses.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

d5975363 06/07/2008 11:50 pm pbrook

Multithreaded locking fixes.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

624f7979 05/31/2008 07:11 pm pbrook

Make signal queues per thread.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

afd7cd92 05/31/2008 03:14 pm pbrook

Fix usermode build.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

c4d91807 05/31/2008 01:57 am pbrook

Copy siginfo.si_code.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

f5545b5c 05/31/2008 01:37 am pbrook

Translate whole of target_sigset. Use host sigset accessors.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

4cb05961 05/30/2008 09:05 pm pbrook

Perform target->host signal mapping for *kill syscalls.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

a8c33204 05/08/2008 02:22 am pbrook

Update ARM non-rt sigframe layout.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

a745ec6d 05/06/2008 06:36 pm pbrook

Update ARM rt_frame layout.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

75b680e5 03/21/2008 06:07 pm pbrook

Fix Thumb signal handlers.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

9664d928 03/04/2008 12:23 am edgar_igl CRIS signals:
  • Save $mof across signals.
  • Cleaned up frame accesses.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

b6d3abda 02/28/2008 01:29 pm edgar_igl

First try at supporting ordinary signals for CRIS linux-user guests.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

d0dc7dc3 02/12/2008 11:01 pm ths

Make MIPS MT implementation more cache friendly.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

c3b5bc8a 12/02/2007 08:31 am ths

SH4: Signal handling for the user space emulator, by Magnus Damm.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

f8b0aa25 11/12/2007 01:03 am bellard

fixed more invalid pointer usage

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

28be6234 11/12/2007 12:23 am bellard

user access fixes

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

459a4017 11/11/2007 09:45 pm bellard

removed warnings - improved sparc32/64 signal frame setup - disabled x86 frame setup for x86_64

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

775b58d8 11/11/2007 06:22 pm bellard

removed warnings - fixed arm stack copy bug

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

579a97f7 11/11/2007 04:26 pm bellard

Linux user memory access API change (initial patch by Thayne Harbaugh)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

d26bc211 11/08/2007 08:05 pm ths

Clean out the N32 macros from target-mips, and introduce MIPS ABI specific
defines for linux-user.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

ec6338ba 11/08/2007 04:25 pm bellard

removed obsolete x86 code copy support

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

0da46a6e 10/20/2007 11:23 pm ths

Syscall target errno fixes, by Thayne Harbaugh.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

992f48a0 10/14/2007 07:27 pm blueswir1

Support for 32 bit ABI on 64 bit targets (only enabled Sparc64)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

5bfb56b2 10/05/2007 08:01 pm blueswir1

Implement sparc64_[gs]et_context

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

540635ba 09/30/2007 04:58 am ths

Code provision for n32/n64 mips userland emulation. Not functional yet.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

a04e134a 09/27/2007 04:57 pm ths

linux-user sigaltstack() syscall, by Thayne Harbaugh.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

3b46e624 09/17/2007 11:09 am ths

find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in the regex.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

5fafdf24 09/17/2007 12:08 am ths

find -type f | xargs sed -i 's/[\t ]$//g' # on most files

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

ead9360e 09/06/2007 03:18 am ths

Partial support for 34K multithreading, not functional yet.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

7f7f7c84 07/12/2007 02:02 pm ths

Sigio fd passing, by Alexander Graf.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

aa1f17c1 07/12/2007 01:48 am ths

Spelling fixes, by Stefan Weil.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

388bb21a 05/13/2007 04:58 pm ths

MIPS linux-user update.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

84409ddb 04/06/2007 11:56 am j_mayer

Code provision for x86_64 and PowerPC 64 linux user mode support.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

0aeaa8ce 03/31/2007 10:29 pm ths

Don't let sigaction handle SIGKILL/SIGSTOP, by Stuart Anderson.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

fafffaef 10/28/2006 03:09 pm bellard

removed invalid code

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

74ccb34e 07/19/2006 12:23 am bellard

Sparc64 host support (Blue Swirl)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

106ec879 06/28/2006 12:08 am bellard

initial MIPS signal handling (initial patch by Raphael Rigo)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162