summaryrefslogtreecommitdiffstats
path: root/linux-user/signal.c
Commit message (Collapse)AuthorAgeFilesLines
* linux-user/tilegx: Implement tilegx signal featuresChen Gang2015-10-071-1/+158
| | | | | | | | [rth: Remove the spreg[EX1] handling, as it's irrelevant to user-mode.] Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Message-Id: <1443312618-13641-1-git-send-email-gang.chen.5i5j@gmail.com> Signed-off-by: Richard Henderson <rth@twiddle.net>
* linux-user/signal.c: Use setup_rt_frame() instead of setup_frame() for ↵Chen Gang2015-10-011-7/+2
| | | | | | | | | | | | target openrisc qemu has already considered about some targets may have no traditional signals. And openrisc's setup_frame() is dummy, but it can be supported by setup_rt_frame(). Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* maint: remove unused include for assert.hDaniel P. Berrange2015-09-111-1/+0
| | | | | | | | | A number of files were including assert.h but not using any of the functions it provides Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* translate-all: Change tb_flush() env argument to cpuPeter Crosthwaite2015-07-091-1/+1
| | | | | | | | | | | | | | | All of the core-code usages of this API have the cpu pointer handy so pass it in. There are only 3 architecture specific usages (2 of which are commented out) which can just use ENV_GET_CPU() locally to get the cpu pointer. The reduces core code usage of the CPU env, which brings us closer to common-obj'ing these core files. Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* s390x: Common access to floating point registersEric Farman2015-05-271-2/+2
| | | | | | | | | | Provide a routine to access the correct floating point register, to simplify future expansion. Suggested-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
* linux-user: Fix broken m68k signal handling on 64 bit hostsPeter Maydell2015-01-271-3/+3
| | | | | | | | | | | | | | | The m68k signal frame setup code which writes the signal return trampoline code to the stack was assuming that a 'long' was 32 bits; on 64 bit systems this meant we would end up writing the 32 bit (2 insn) trampoline sequence to retaddr+4,retaddr+6 instead of the intended retaddr+0,retaddr+2, resulting in a guest crash when it tried to execute the invalid zero-bytes at retaddr+0. Fix by using uint32_t instead; also use uint16_t rather than short for consistency. This fixes bug LP:1404690. Reported-by: Michel Boaventura Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user/signal.c: Remove unnecessary wrapper copy_siginfo_to_userPeter Maydell2015-01-271-17/+11
| | | | | | | | | | | | | | | | | The function copy_siginfo_to_user() just calls tswap_siginfo(), so call the latter function directly and delete the wrapper function. The wrapper is actually misleading since it implies that the semantics are like the kernel function with the same name which copies the data to a guest user-space address. In fact tswap_siginfo() just does data-structure conversion between two structures whose addresses are host addresses (the copy to userspace is handled in QEMU by the lock_user/unlock_user calls). This also fixes clang complaints about the wrapper being unused in some configs. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user/signal.c: Remove current_exec_domain_sig()Peter Maydell2015-01-271-25/+6
| | | | | | | | | | | | | | | | | | | | | Remove the function current_exec_domain_sig(), which always returns its argument. This was intended as a stub for supporting the kernel's exec_domain handling, but: * we don't have any of the other code for execution domains * in the kernel this handling is architecture-specific, not generic * we only call this function in the x86, ppc and sh4 signal code paths, and the PPC one is wrong anyway because the PPC kernel doesn't have this signal-remapping code So it's best to simply delete the function; any future attempt to implement exec domains will be better served by adding the correct code from scratch based on the kernel sources at that time. This change also fixes some clang warnings about the function being defined but not used for some target architectures. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: Handle PPC64 ELFv2 Function PointersTom Musta2014-09-081-10/+30
| | | | | | | | | | | | Function pointers in the 64-bit ELFv2 PowerPC ABI are actual (internal) entry point addresses. However, when invoking a function via a function pointer, GPR 12 must also be set to this address so that the TOC may be handled properly. Add this support to the invocation of a signal handler. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* linux-user: Implement do_setcontext for PPC64Tom Musta2014-09-081-5/+5
| | | | | | | | | Eliminate the stub for the do_setcontext() function for TARGET_PPC64. The implementation re-uses the existing TARGET_PPC32 code with the only change being the computation of the address of the register save area. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* linux-user: Properly Dereference PPC64 ELFv1 Signal Handler PointerTom Musta2014-09-081-0/+29
| | | | | | | | | | Properly dereference 64-bit PPC ELF V1 ABIT function pointers to signal handlers. On this platform, function pointers are pointers to structures and the first 64 bits of such a structure contains the function's entry point. The second 64 bits contains the TOC pointer, which must be placed into GPR 2. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* linux-user: Enable Signal Handlers on PPC64Tom Musta2014-09-081-48/+73
| | | | | | | | | | | | | | | | | | | | | | | | Enable the 64-bit PowerPC signal handling code that was previously disabled via #ifdefs. Specifically: - Move the target_mcontext (register save area) structure and append it to the 64-bit target_sigcontext structure. This provides the space on the stack for saving and restoring context. - Define the target_rt_sigframe for 64-bit. - Adjust the setup_frame and setup_rt_frame routines to properly select the target_mcontext area and trampoline within the stack frame; tthis is different for 32-bit and 64-bit implementations. - Adjust the do_setcontext stub for 64-bit so that it compiles without warnings. The 64-bit signal handling code is still not functional after this change; but the 32-bit code is. Subsequent changes will address specific issues with the 64-bit code. Signed-off-by: Tom Musta <tommusta@gmail.com> [agraf: fix build on 32bit hosts, ppc64abi32] Signed-off-by: Alexander Graf <agraf@suse.de>
* linux-user: Split PPC Trampoline Encoding from Register SaveTom Musta2014-09-081-6/+12
| | | | | | | | | | Split the encoding of the PowerPC sigreturn trampoline from the saving of register state onto the signal handler stack. This will make it easier in subsequent patches to deal with variations in the stack frame layouts between 32 and 64 bit PowerPC. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* linux-user: Fix Stack Pointer Bug in PPC setup_rt_frameTom Musta2014-09-081-1/+1
| | | | | | | | | | | | | | The code that sets the stack frame back pointer is incorrect for the setup_rt_frame() code; qemu will abort (SIGSEGV) in some environments. The setup_frame code was fixed in commit beb526b12134a6b6744125deec5a7fe24a8f92e3 but the setup_rt_frame code was not. Make the setup_rt_frame code consistent with the setup_frame code. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* linux-user: Minimum Sig Handler Stack Size for PPC64 ELF V2Tom Musta2014-08-221-1/+11
| | | | | | | | The ELF V2 ABI for PPC64 defines MINSIGSTKSZ as 4096 bytes whereas it was 2048 previously. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: use TARGET_SA_ONSTACK in get_sigframeRiku Voipio2014-07-151-3/+4
| | | | | | | | | | | | As reported by Laurent, which should use TARGET_SA_ONSTACK on arm, microblaze and openrisc targets like we do on all others. Practical matter is minimal as for almost all archs SA_ONSTACK is 0x08000000: http://lxr.free-electrons.com/ident?i=SA_ONSTACK Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* signal/ppc/do_setcontext remove __get_user return checkRiku Voipio2014-06-171-2/+1
| | | | | | | | The last remaining check for return value of __get_user. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Cc: Alexander Graf <agraf@suse.de>
* signal/sparc64_set_context: remove __get_user checksRiku Voipio2014-06-171-9/+3
| | | | | | | | Remove checks of __get_user and the err variable used to control flow with it. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
* signal/ppc/{save,restore}_user_regs remove __put/get error checksRiku Voipio2014-06-171-85/+41
| | | | | | | | | | As __get_user and __put_user do not return errors, remove the if checks from around them. This allows making the save/restore functions void. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Cc: Alexander Graf <agraf@suse.de>
* signal/all/setup_frame remove __put_user checksRiku Voipio2014-06-171-72/+25
| | | | | | | | | | | | | | Remove "if(__put_user" checks and their related error paths for all architecture's setup_frame, setup_rt_frame and similar. Remove the unlock_user_struct when the only way to end up there is from failed lock_user_struct. Remove err variable if there are no users for it in the function anymore. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
* signal/all/do_sigreturn - remove __get_user checksRiku Voipio2014-06-171-41/+18
| | | | | | | | | | | Remove "if(__get_user" checks and their related error paths for all architecture's do_sigreturn. Remove the unlock_user_struct when the only way to end up there is from failed lock_user_struct. v3: remove unneccesary sigsegv label as suggested by Peter Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
* signal/all/do_sigaltstack remove __get_user value checkRiku Voipio2014-06-171-4/+5
| | | | | | | | Access is already checked in the lock_user_struct call before. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
* signal/sparc/restore_fpu_state: removeRiku Voipio2014-06-171-37/+0
| | | | | | | | | A function never called from anywhere, obviously half-complete. Remove function and if someone wants to complete this, please check the old version out of git history. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
* signal/all: remove return value from restore_sigcontextRiku Voipio2014-06-171-31/+12
| | | | | | | | | | | | | | | | make most implementations of restore_sigcontext void and remove checking it's return value from functions calling restore_sigcontext. The exception is the X86 version of the function that is too different from others to deal in this way, and arm version, to keep possibility of erroring out from failed valid_user_regs. v3: keep arm valid_user_regs for filling in near future. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
* signal/all: remove return value from setup_sigcontextRiku Voipio2014-06-171-44/+21
| | | | | | | | | Make all implementations of setup_sigcontext void and remove checking it's return value from functions calling setup_sigcontext. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
* signal/all: remove return value from copy_siginfo_to_userRiku Voipio2014-06-171-19/+9
| | | | | | | | Since copy_siginfo_to_user always returns 0, make it void and remove any checks for return value from calling functions. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
* signal/x86/setup_frame: __put_user cleanupRiku Voipio2014-06-171-12/+4
| | | | | | | | | | | | | Remove the remaining check for __put_user return value, and all the checks for err variable which isn't set anywhere anymore. No we can only end up in give_sigsegv due to failed lock_user_struct - thus we remove the unlock_user_struct to avoid unlocking a region never locked. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
* signal/all: remove __get/__put_user return value readingRiku Voipio2014-06-171-370/+364
| | | | | | | | | | | | | | Remove all the simple cases of reading the return value of __get_user and __put_user. We set err = 0 in sparc versions of do_sigreturn and sparc64_set_context to avoid compile error, but else this patch is just general removal of err |= __get_user ... idiom. v2: remove err variable from target_rt_restore_ucontext Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
* linux-user/signal.c: Set fault address in AArch64 signal infoPeter Maydell2014-05-021-2/+1
| | | | | | | | Set the fault address correctly in the signal information passed to a signal handler for AArch64 guests. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: remove duplicate statementPrasad Joshi2014-03-271-2/+0
| | | | | | Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com> Acked-by: Riku Voipio <riku.voipio@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* linux-user: Don't allow guest to block SIGSEGVPeter Maydell2014-03-171-1/+61
| | | | | | | | | | | | | | | | | | | | | Don't allow the linux-user guest to block SIGSEGV -- QEMU needs this signal to detect accesses to pages which it has marked read-only because it has cached translated code from them. We implement this by making the do_sigprocmask() wrapper suppress SIGSEGV when doing the host process signal mask manipulation; instead we store the current state of SIGSEGV in the TaskState struct. If we get a SIGSEGV for the guest when the guest has blocked the signal, we treat it as if the default SEGV handler was in place, as the kernel does for forced SIGSEGV delivery. This patch is based on an idea by Alex Barcelo, but rather than simply lying to the guest about the SIGSEGV state we track it. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reported-by: Alex Barcelo <abarcelo@ac.upc.edu> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* signal: added a wrapper for sigprocmask functionAlex Barcelo2014-03-171-24/+34
| | | | | | | | | | | | | | | | | | Create a wrapper for signal mask changes initiated by the guest; (this includes syscalls and also the sigreturns from signal.c) this will give us a place to put code which prevents the guest from changing the handling of signals used by QEMU itself internally. The wrapper is called from all the guest-initiated sigprocmask, but is not called from internal qemu sigprocmask calls. Signed-off-by: Alex Barcelo <abarcelo@ac.upc.edu> [PMM: Added calls to wrapper for sigprocmask uses in signal.c when setting the signal mask on entry and exit from signal handlers, since these also are guest-provided signal masks.] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user/signal.c: Correct error path for AArch64 do_rt_sigreturnPeter Maydell2014-03-171-1/+1
| | | | | | | | | | | The error path in AArch64 do_rt_sigreturn() which fails before attempting lock_user_struct() was doing an unlock_user_struct() on an uninitialized variable. Initialize frame to NULL so we can use the same error-exit path in all cases (unlock of NULL is permitted and does nothing). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* cpu: Move opaque field from CPU_COMMON to CPUStateAndreas Färber2014-03-131-6/+11
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move exception_index field from CPU_COMMON to CPUStateAndreas Färber2014-03-131-3/+4
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* linux-user: AArch64: Implement SA_RESTORER for signal handlersMichael Matz2014-03-031-6/+10
| | | | | | | | | | | Implement support for signal handlers with the SA_RESTORER flag set. Signed-off-by: Michael Matz <matz@suse.de> [PMM: minor tweaks to make patch apply to current master] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net>
* linux-user/signal.c: Fix AArch64 big-endian FP register restorePeter Maydell2014-03-031-2/+8
| | | | | | | | | | Fix the loop restoring the FP registers from the signal frame to match the one used when setting up the signal frame, so that it handles TARGET_WORDS_BIGENDIAN being set. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net>
* linux-user/signal.c: Don't pass sigaction uninitialised sa_flagsPeter Maydell2014-02-181-0/+1
| | | | | | | | | When forcing a fatal signal, we weren't initialising the sa_flags field in the struct sigaction we used to reset the signal handler to SIG_DFL. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: Fix trampoline code for CRISStefan Weil2014-02-031-4/+4
| | | | | | | | | | | | | | | | | | | __put_user can write bytes, words (2 bytes) or longwords (4 bytes). Here obviously words should have been written, but bytes were written, so values like 0x9c5f were truncated to 0x5f. Fix this by changing retcode from uint8_t to to uint16_t in target_signal_frame and also in the unused rt_signal_frame. This problem was reported by static code analysis (smatch). Cc: qemu-stable@nongnu.org Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
* Merge remote-tracking branch 'mjt/trivial-patches' into stagingAnthony Liguori2014-01-091-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * mjt/trivial-patches: acpi unit-test: Remove temporary disk after test mainstone: Fix duplicate array values for key 'space' pxa27x: Add 'const' attribute to keyboard maps pxa27x: Reduce size of keyboard matrix mapping doc: Mention chardev:id in available devices for -serial configure: Python tests must be done before help message configure: Rewrite code for help message fix -boot strict regressed in commit 6ef4716 vl: make boot_strict variable static (not used outside vl.c) x86: only allow real mode to access 32bit without LMA linux-user: Use macro TARGET_NSIG_WORDS where possible exynos4210: Use macro ARRAY_SIZE where possible ui/cocoa: Use macro ARRAY_SIZE where possible misc: Use macro ARRAY_SIZE where possible openrisc: Fix spelling in comment (transaltion -> translation) hw/arm/highbank: Simplify code (memory region in device state) Message-id: 1388182050-10270-1-git-send-email-mjt@msgid.tls.msk.ru Signed-off-by: Anthony Liguori <aliguori@amazon.com>
| * linux-user: Use macro TARGET_NSIG_WORDS where possibleStefan Weil2013-12-231-4/+4
| | | | | | | | | | | | | | | | | | This improves readability and simplifies the code. Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* | linux-user: AArch64: Use correct values for FPSR/FPCR in sigcontextWill Newton2014-01-081-3/+7
|/ | | | | | | | | Use the helpers provided for getting the correct FPSR and FPCR values for the signal context. Signed-off-by: Will Newton <will.newton@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net>
* target-arm: Clean up handling of AArch64 PSTATEPeter Maydell2013-12-171-2/+4
| | | | | | | | | | | | | | | | | | The env->pstate field is a little odd since it doesn't strictly speaking represent an architectural register. However it's convenient for QEMU to use it to hold the various PSTATE architectural bits in the same format the architecture specifies for SPSR registers (since this is the same format the kernel uses for signal handlers and the KVM register). Add some structure to how we deal with it: * document what env->pstate is * add some #defines for various bits in it * add helpers for reading/writing it taking account of caching of NZCV, and use them where appropriate * reset it on startup Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1385645602-18662-3-git-send-email-peter.maydell@linaro.org Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
* linux-user: Add signal handling for AArch64Andreas Schwab2013-09-101-0/+260
| | | | | | | | | | | | | | | This patch adds signal handling for AArch64. The code is based on the respective 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> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1378235544-22290-17-git-send-email-peter.maydell@linaro.org Message-id: 1368505980-17151-10-git-send-email-john.rigby@linaro.org [PMM: fixed style nits: tabs, long lines; pulled target_signal.h in from a later patch; it fits better here] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* linux-user/signal.c: Avoid using uninitialized data in ARM sigreturnPeter Maydell2013-07-291-16/+20
| | | | | | | | | | | | | | | Rephrase code used in ARM sigreturn functions to avoid using uninitialized variables. This fixes one genuine problem ('frame' would not be initialized if we took the error-exit path because our stackpointer was misaligned) and one which is clang being alarmist (frame_addr wouldn't be initialized, though this is harmless since unlock_user_struct ignores its second argument in these cases; however since we don't generally make use of this not-really-documented effect it's better avoided). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1375095632-13735-3-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* linux-user/signal.c: PPC: Silence clang uninitialized-use warningPeter Maydell2013-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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] if (!lock_user_struct(VERIFY_READ, sc, sc_addr, 1)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/petmay01/linaro/qemu-from-laptop/qemu/linux-user/signal.c:4636:28: note: uninitialized use occurs here unlock_user_struct(sr, sr_addr, 1); ^~~~~~~ /home/petmay01/linaro/qemu-from-laptop/qemu/linux-user/qemu.h:442:27: note: expanded from macro 'unlock_user_struct' unlock_user(host_ptr, guest_addr, (copy) ? sizeof(*host_ptr) : 0) ^ This happens when we unlock a user struct which we never attempted to lock. Strictly, clang is actually wrong here -- it hasn't been able to spot that unlock_user_struct() doesn't use its second argument if the first is NULL. However it doesn't seem too unreasonable to demand that we pass in initialized values to it. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1375095632-13735-2-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* gdbstub: Change gdb_handlesig() argument to CPUStateAndreas Färber2013-07-231-1/+2
| | | | | | 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 stagingAnthony Liguori2013-07-101-5/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QOM CPUState refactorings * Fix for OpenRISCCPU subclasses * Fix for gdbstub CPU selection * Move linux-user CPU functions into new header * CPUState part 10 refactoring: first_cpu, next_cpu, cpu_single_env et al. * Fix some targets to consistently inline TCG code generation * Centrally log CPU reset # gpg: Signature made Wed 10 Jul 2013 07:52:39 AM CDT using RSA key ID 3E7E013F # gpg: Can't check signature: public key not found # By Andreas Färber (41) and others # Via Andreas Färber * afaerber/tags/qom-cpu-for-anthony: (43 commits) cpu: Move reset logging to CPUState target-ppc: Change LOG_MMU_STATE() argument to CPUState target-i386: Change LOG_PCALL_STATE() argument to CPUState log: Change log_cpu_state[_mask]() argument to CPUState target-i386: Change do_smm_enter() argument to X86CPU target-i386: Change do_interrupt_all() argument to X86CPU target-xtensa: Change gen_intermediate_code_internal() arg to XtensaCPU target-unicore32: Change gen_intermediate_code_internal() signature target-sparc: Change gen_intermediate_code_internal() argument to SPARCCPU target-sh4: Change gen_intermediate_code_internal() argument to SuperHCPU target-s390x: Change gen_intermediate_code_internal() argument to S390CPU target-ppc: Change gen_intermediate_code_internal() argument to PowerPCCPU target-mips: Change gen_intermediate_code_internal() argument to MIPSCPU target-microblaze: Change gen_intermediate_code_internal() argument types target-m68k: Change gen_intermediate_code_internal() argument to M68kCPU target-lm32: Change gen_intermediate_code_internal() argument to LM32CPU target-i386: Change gen_intermediate_code_internal() argument to X86CPU target-cris: Change gen_intermediate_code_internal() argument to CRISCPU target-arm: Change gen_intermediate_code_internal() argument to ARMCPU target-alpha: Change gen_intermediate_code_internal() argument to AlphaCPU ...
| * linux-user: Change thread_env to CPUStateAndreas Färber2013-07-091-5/+7
| | | | | | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* | linux-user: fix signal number range checkAndreas Schwab2013-07-051-2/+2
|/ | | | | | | | | When translating between host and target signal numbers keep negative numbers unchanged, avoiding access beyond array bounds. Signed-off-by: Andreas Schwab <schwab@linux-m68k.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 878v2b8sek.fsf@igel.home
OpenPOWER on IntegriCloud