[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 22/26] linux-user: Implement force_sigsegv() via forc
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 22/26] linux-user: Implement force_sigsegv() via force_sig() |
Date: |
Thu, 22 Sep 2016 15:13:42 +0300 |
From: Peter Maydell <address@hidden>
Now that we have a force_sig() with the semantics we need,
we can implement force_sigsegv() to call it rather than
open-coding the call to queue_signal().
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/signal.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 60fda18..900ee35 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -512,8 +512,7 @@ void signal_init(void)
}
}
-#if !defined(TARGET_OPENRISC) && !defined(TARGET_UNICORE32) && \
- !defined(TARGET_X86_64)
+#if !(defined(TARGET_X86_64) || defined(TARGET_UNICORE32))
/* Force a synchronously taken signal. The kernel force_sig() function
* also forces the signal to "not blocked, not ignored", but for QEMU
* that work is done in process_pending_signals().
@@ -531,9 +530,6 @@ static void force_sig(int sig)
info._sifields._kill._uid = 0;
queue_signal(env, info.si_signo, QEMU_SI_KILL, &info);
}
-#endif
-
-#if !(defined(TARGET_X86_64) || defined(TARGET_UNICORE32))
/* Force a SIGSEGV if we couldn't write to memory trying to set
* up the signal frame. oldsig is the signal we were trying to handle
@@ -541,22 +537,13 @@ static void force_sig(int sig)
*/
static void force_sigsegv(int oldsig)
{
- CPUState *cpu = thread_cpu;
- CPUArchState *env = cpu->env_ptr;
- target_siginfo_t info;
-
if (oldsig == SIGSEGV) {
/* Make sure we don't try to deliver the signal again; this will
* end up with handle_pending_signal() calling dump_core_and_abort().
*/
sigact_table[oldsig - 1]._sa_handler = TARGET_SIG_DFL;
}
- info.si_signo = TARGET_SIGSEGV;
- info.si_errno = 0;
- info.si_code = TARGET_SI_KERNEL;
- info._sifields._kill._pid = 0;
- info._sifields._kill._uid = 0;
- queue_signal(env, info.si_signo, QEMU_SI_KILL, &info);
+ force_sig(TARGET_SIGSEGV);
}
#endif
--
2.1.4
- [Qemu-devel] [PULL 15/26] linux-user: Use correct target SHMLBA in shmat(), (continued)
- [Qemu-devel] [PULL 15/26] linux-user: Use correct target SHMLBA in shmat(), riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 14/26] linux-user: Use glib malloc functions in load_symbols(), riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 12/26] linux-user: Fix error handling in flatload.c target_pread(), riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 16/26] linux-user: ppc64: set MSR_CM bit for BookE 2.06 MMU, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 17/26] linux-user: Recheck for pending synchronous signals too, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 18/26] linux-user: Pass si_type information to queue_signal() explicitly, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 24/26] linux-user: Sanity check clone flags, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 19/26] linux-user: SIGSEGV on signal entry need not be fatal, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 20/26] linux-user: ARM: Give SIGSEGV if signal frame setup fails, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 21/26] linux-user: SIGSEGV from sigreturn need not be fatal, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 22/26] linux-user: Implement force_sigsegv() via force_sig(),
riku . voipio <=
- [Qemu-devel] [PULL 23/26] linux-user: Remove unnecessary nptl_flags variable from do_fork(), riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 25/26] linux-user: Fix incorrect offset of tuc_stack in ARM do_sigframe_return_v2, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 26/26] linux-user: fix TARGET_NR_select, riku . voipio, 2016/09/22
- Re: [Qemu-devel] [PULL 00/26] linux-user update, no-reply, 2016/09/22
- Re: [Qemu-devel] [PULL 00/26] linux-user update, Peter Maydell, 2016/09/22