History | View | Annotate | Download (168.9 kB)
target-arm: Clean up handling of AArch64 PSTATE
The env->pstate field is a little odd since it doesn't strictlyspeaking represent an architectural register. However it's convenientfor QEMU to use it to hold the various PSTATE architectural bitsin the same format the architecture specifies for SPSR registers...
linux-user: Add signal handling for AArch64
This patch adds signal handling for AArch64. The code is based on therespective source in the Linux kernel.
Signed-off-by: Andreas Schwab <schwab@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: John Rigby <john.rigby@linaro.org>...
linux-user/signal.c: PPC: Silence clang uninitialized-use warning
Silence a clang warning in a PPC signal return function:
/home/petmay01/linaro/qemu-from-laptop/qemu/linux-user/signal.c:4611:9: error: variable 'sr_addr' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]...
linux-user/signal.c: Avoid using uninitialized data in ARM sigreturn
Rephrase code used in ARM sigreturn functions to avoid usinguninitialized variables. This fixes one genuine problem ('frame'would not be initialized if we took the error-exit path because...
gdbstub: Change gdb_handlesig() argument to CPUState
Prepares for changing GDBState::c_cpu to CPUState.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging
QOM CPUState refactorings
linux-user: Change thread_env to CPUState
linux-user: fix signal number range check
When translating between host and target signal numbers keep negativenumbers unchanged, avoiding access beyond array bounds.
Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
cpu: Change cpu_exit() argument to CPUState
It no longer depends on CPUArchState, so move it to qom/cpu.c.
linux-user: Fix MIPS ISA transitions during signal handling
Processors supporting the MIPS16 or microMIPS ISAs set bit 0 in targetaddresses to indicate that the target is written using a compressed ISA.
During signal handling, when jumping to or returning from a signal...
linux-user: Save the correct resume address for MIPS signal handling
The current ISA mode needs to be saved in bit 0 of the resume address.If the current instruction happens to be in a branch delay slot, thenthe address of the preceding jump instruction should be stored instead....
mips-linux-user: Save and restore fpu and dsp from sigcontext
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
mips-linux-user: Share o32 code for n32 and n64 signals
Signed-off-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
mips-linux-user: Delete n32 and n64 signal stubs
Deleting these first makes the next patch much easier to read.This doesn't cause any sort of compilation failure because wehave not yet enabled n32/n64 compilation. This is dead code.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf
alpha-linux-user: Fix sigaction
Unconditional bswap replaced by _get_user/_put_user.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
PPC: linux-user: Calculate context pointer explicitly
Peter Maydell recommended the change to be more proper. The result was testedand shows coming up with the same proper value.
Signed-off-by: Samuel Seay <LightningTH@GMail.com>[agraf: change subject]...
PPC: fix segfault in signal handling code
Removed h2g() macro around the ka->_sa_handler due to the _sa_handler being aguest memory address.
Changed the __put_user to put_user as it was attempting to put a value at thestack address but the new address is a guest memory address, __put_user is...
linux-user: Fix siginfo handling
Compare signal numbers in the proper domain.Convert all of the fields for SIGIO and SIGCHLD.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
cleanup useless return sentence
This patch cleans up return sentences in the end of void functions.
Reported-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Amos Kong <akong@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
sparc: fix expression with uninitialized initial value
err was uninitialized, it's not OK to use |=. Spotted by Clangcompiler.
Fix by implementing the earlier statement which initializes the variable.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Replace 'struct siginfo' with 'siginfo_t'.
glibc 2.16 will remove the undocumented definition of 'struct siginfo'from <bits/siginfo.h>.
This change is already present in glibc 2.15.90, so qemu compilationof certain targets (eg. cris-user) breaks.
This struct was always typedef'd to be the same as 'siginfo_t' which...
target-or32: Add linux user support
Add QEMU OpenRISC linux user support.
Signed-off-by: Jia Liu <proljc@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qemu-log: cleanup
Don't use global variables directly but via accessor functions. Rename globals.
Convert macros to functions, add GCC format attributes.
Bad zero comparison for sas_ss_flags on powerpc
All architectures work the same way, and all check for sas_ss_flags ==0. The powerpc lines are wrong, and do the check the other way round(it's a qemu internal check, which is done wrong only for thisarchitecture, it's more a typo than a bug). It's NOT ppc specific,...
Rename CPUState -> CPUArchState
Scripted conversion: for file in .[hc] hw/.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do sed -i "s/CPUState/CPUArchState/g" $file done...
linux-user: Don't overuse CPUState
In target-specific code use CPU*State.
While at it, fix indentation on those lines.
Spelling fixes in comments (it's -> its)
Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Stefan Weil <sw@weilnetz.de>...
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 <khansa@kics.edu.pk>Suggested-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Andreas Färber <afaerber@suse.de>...
fix spelling in linux-user sub directory
Cc: Riku Voipio <riku.voipio@iki.fi>Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging
linux-user: fix abi_(u)long, target_ulong mismatch
abi_(u)long might be different from target_ulong, so don't use tswaplbut introduce a new tswapal
Signed-off-by: Matthias Braun <matze@braunis.de>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
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 stillaccess the individual pieces of the double.
Signed-off-by: Richard Henderson <rth@twiddle.net>
linux-user: Remove unused code
The code is unused since 8 years, so remove it.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
linux-user: Correct a few missuses of host addresses
Fix a few cases where we were passing host pointers to theguest.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
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...
linux-user/signal.c: Remove only-ever-set variable fpu_save_addr
Move the access of fpu_save into the commented out skeleton code forrestoring FPU registers on SPARC sigreturn, thus silencing a gcc4.6 "variable set but never used" warning.(This doesn't affect the calculation of 'err' because in fact...
linux-user/signal.c: Remove unused fenab
Remove fenab as it is only written, never used. Add a FIXMEcomment about the discrepancy between our behaviour and thatof the Linux kernel for this routine.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
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 <mj.mccormack@samsung.com>...
Fix compilation warning due to missing header for sigaction (followup)
This patch removes all references to signal.h when qemu-common.h is includedas they become redundant.
Signed-off-by: Alexandre Raymond <cerbere@gmail.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
s390x: s390x-linux-user support
This patch adds support for running s390x binaries in the linux-user emulationcode.
Signed-off-by: Ulrich Hecht <uli@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
Fix typo in comment (dieing -> dying)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
linux-user/arm: fix compilation failures using softfloat's struct types
Add uses of the float32/float64 boxing and unboxing macros so thatthe ARM linux-user targets will compile with USE_SOFTFLOAT_STRUCT_TYPESenabled.
linux-user: avoid gcc array overrun warning for sparc
Suppress a gcc array bounds overrun warning when filling in the SPARCsignal frame by adjusting our definition of the structure so that thefp and callers_pc membes are part of the ins[] array rather than...
linux-user: ARM: clear the IT bits when invoking a signal handler
When invoking a signal handler for an ARM target, make sure the ITbits in the CPSR are cleared. (This would otherwise cause incorrectexecution if the IT state was non-zero when an exception occured....
ARM: linux-user: Correct size of padding in target_ucontext_v2
The padding in the target_ucontext_v2 is defined by the size ofthe target's sigset_t type, not the host's. (This bug only causesproblems when we start using the uc_regspace[] array to expose...
ARM: linux-user: Expose VFP registers to signal handlers
For ARM linux-user mode signal handlers, fill in the ucontext withVFP register contents in the same way that the kernel does. We onlydo this for v2 format sigframe (2.6.12 and above); this is actually...
ARM: linux-user: Restore VFP state from ucontext on sigreturn
Restore the VFP registers from the ucontext on return from a signalhandler in linux-user mode. This means that signal handlers cannotaccidentally corrupt the interrupted code's VFP state, and allows...
ARM: linux-user: Expose iWMMXT registers to signal handlers
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
ARM: linux-user: Restore iWMMXT state from ucontext on sigreturn
microblaze: target-ify target_ucontext
Rename the members of target_ucontext so that they don't conflictwith possible host macros for ucontext members. This has alreadybeen done for the other targets.
microblaze: Pass a ucontext * as 3rd sighandler arg
There is disagreement between microblaze glibc and the kernelto what the third arg of signal handlers should point to.
Change QEMU linux-user to match the kernel port. glibc patchesare pending.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
microblaze: Correct signal frame setup.
Pass the context in r7.
sparc: Fix lazy flag calculation on interrupts, refactor
Recalculate Sparc64 CPU flags on interrupts, otherwise some earlierflags could be stored to pstate.
Refactor PSR/CCR/CWP handling: concentrate the actualfunctions to op_helper.c.
Thanks to Igor Kovalenko for reporting....
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...
Replace assert(0) with abort() or cpu_abort()
When building with -DNDEBUG, assert(0) will not stop executionso it must not be used for abnormal termination.
Use cpu_abort() when in CPU context, abort() otherwise.
Fix build with -DNDEBUG in CFLAGS
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 <takasi-y@ops.dti.ne.jp>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
alpha-linux-user: Implement signals.
Move userland PALcode handling into linux-user main loop so thatwe can send signals from there. This also makes alpha_palcode.csystem-level only, so don't build it for userland. Add definesfor GENTRAP PALcall mapping to signals....
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 isjust for cleanup and improving consistency.
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
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 wrongat least on MIPS were _NSIG is 128.
Based on a patch from Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
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. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
m68k, linux-user: add setup_rt_frame
This patch implements setup_rt_frame().
Signed-off-by: Laurent Vivier <laurent@vivier.eu>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
m68k,linux-user: add setup_frame
This patch adds signals management for linux-user.
It implements setup_frame() which allows to call the user signalhandler.
setup_rt_frame() is always unimplemented.
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' * /* *//*
Avoid name clashes with symbols that leak from system headers
Update to a hopefully more future proof FSF address
MIPS signal handling fix
Add explicit padding to MIPS signal frame structures.
Signed-off-by: Paul Brook <paul@codesourcery.com>
linux-user: implemented ELF coredump support for ARM target
When target process is killed with signal (such signal thatshould dump core) a coredump file is created. This file issimilar than coredump generated by Linux (there are few exceptionsthough)....
microblaze: linux-user support.
linux-user: ppc signal handling
Implement setup_{,rt_}frame and do_{,rt_}sigreturn for PPC 32-bit. Usethe same TARGET_QEMU_ESIGRETURN hack as for MIPS to avoid clobberingregister state on a sigreturn.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>...
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 thesignal frame. This is actually surprisingly hard to observe in practice.
Typically an thread be blocked in a FUTEX_WAIT call when the signal arrives,...
Translate signal values in exit status.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7131 c046a42c-6fe2-441c-8c8c-71466251a162
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....
Use a dedicated function to request exit from execution loop
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6762 c046a42c-6fe2-441c-8c8c-71466251a162
The _exit syscall is used for both thread termination in NPTL applications,and process termination in legacy applications. Try to guess which we wantbased on the presence of multiple threads.
Also implement locking when modifying the CPU list.
Signed-off-by: Paul Brook <paul@codesourcery.com>...
Replace noreturn with QEMU_NORETURN
Thanks to Robert Riebisch for analysis [1]
[1] http://marc.info/?l=qemu-devel&m=123352293319271&w=2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6492 c046a42c-6fe2-441c-8c8c-71466251a162
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'...
Add noreturn function attribute
Introduce noreturn attribute and attach it to cpu_loop_exit as well asinterrupt/exception helpers for i386. This avoids a bunch of gcc4warnings.
[ Note that this patch comes with a workaround to include qemu-common.heven in cases where is currently causes conflicts with dyngen-exec.h....
Fix more FSF addresses
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6192 c046a42c-6fe2-441c-8c8c-71466251a162
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 currenttest 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...
User-mode GDB stub improvements - handle signals
Handle signals in the user-mode GDB stub. Report them to GDB, andallow it to change or cancel them. Also correct the protocol numbering;it happens to match Linux numbering for SIGINT and SIGTRAP, but that's...
linux-user: Add support for STOP/CONT signals.
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5802 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user: sig is target signal.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5801 c046a42c-6fe2-441c-8c8c-71466251a162
CRIS: linux-user signals dont need ERP compensation after break anymore.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5450 c046a42c-6fe2-441c-8c8c-71466251a162
Make target_sigaltstack_used static
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5428 c046a42c-6fe2-441c-8c8c-71466251a162
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://svn.savannah.nongnu.org/qemu/trunk@5234 c046a42c-6fe2-441c-8c8c-71466251a162
Fix some warnings that would be generated by gcc -Wmissing-prototypes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5022 c046a42c-6fe2-441c-8c8c-71466251a162
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://svn.savannah.nongnu.org/qemu/trunk@4877 c046a42c-6fe2-441c-8c8c-71466251a162
More efficient target register / TC accesses.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4794 c046a42c-6fe2-441c-8c8c-71466251a162
Multithreaded locking fixes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4692 c046a42c-6fe2-441c-8c8c-71466251a162
Make signal queues per thread.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4635 c046a42c-6fe2-441c-8c8c-71466251a162
Fix usermode build.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4634 c046a42c-6fe2-441c-8c8c-71466251a162
Copy siginfo.si_code.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4632 c046a42c-6fe2-441c-8c8c-71466251a162
Translate whole of target_sigset. Use host sigset accessors.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4631 c046a42c-6fe2-441c-8c8c-71466251a162
Perform target->host signal mapping for *kill syscalls.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4625 c046a42c-6fe2-441c-8c8c-71466251a162
Update ARM non-rt sigframe layout.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4385 c046a42c-6fe2-441c-8c8c-71466251a162
Update ARM rt_frame layout.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4365 c046a42c-6fe2-441c-8c8c-71466251a162
Fix Thumb signal handlers.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4089 c046a42c-6fe2-441c-8c8c-71466251a162