[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/16] [RFC] linux-user: add support for tracking th
From: |
Miloš Stojanović |
Subject: |
[Qemu-devel] [PATCH 10/16] [RFC] linux-user: add support for tracking the target signal mask |
Date: |
Fri, 12 May 2017 13:02:18 +0200 |
If TRACK_TARGET_SIGMASK is defined, add fields in the TaskState structure
which will hold the target signal and suspend mask and add support for
initialization and forking. No functional changes are being introduced in
this commit. The TRACK_TARGET_SIGMASK will be defined in a later commit
where the target signal masks will be needed in order to implement
multiplexing of real-time target signals which are out of the host range.
Currently, QEMU has a copy of the host signal and suspend masks and that
is usually enough, since most of the time the signal mask of the target
architecture is either the same length or narrower. If however the signal
mask is wider, then part of it won't be tracked.
This commit enables adding support for separately tracking the target
signal masks in the following commits.
Signed-off-by: Miloš Stojanović <address@hidden>
---
linux-user/qemu.h | 5 +++++
linux-user/signal.c | 3 +++
linux-user/syscall.c | 3 +++
3 files changed, 11 insertions(+)
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 4edd7d0..6ce0811 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -139,6 +139,11 @@ typedef struct TaskState {
* currently in the middle of such a syscall
*/
sigset_t sigsuspend_mask;
+#ifdef TRACK_TARGET_SIGMASK
+ /* Track the target signal and suspend masks. */
+ target_sigset_t target_signal_mask;
+ target_sigset_t target_sigsuspend_mask;
+#endif
/* Nonzero if we're leaving a sigsuspend and sigsuspend_mask is valid. */
int in_sigsuspend;
diff --git a/linux-user/signal.c b/linux-user/signal.c
index a67db04..2bc6669 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -485,6 +485,9 @@ void signal_init(void)
/* Set the signal mask from the host mask. */
sigprocmask(0, 0, &ts->signal_mask);
+#ifdef TRACK_TARGET_SIGMASK
+ host_to_target_sigset_internal(&ts->target_signal_mask, &ts->signal_mask);
+#endif
/* set all host signal handlers. ALL signals are blocked during
the handlers to serialize them. */
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d3b769e..94ecae3 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6279,6 +6279,9 @@ static int do_fork(CPUArchState *env, unsigned int flags,
abi_ulong newsp,
ts->bprm = parent_ts->bprm;
ts->info = parent_ts->info;
ts->signal_mask = parent_ts->signal_mask;
+#ifdef TRACK_TARGET_SIGMASK
+ ts->target_signal_mask = parent_ts->target_signal_mask;
+#endif
if (flags & CLONE_CHILD_CLEARTID) {
ts->child_tidptr = child_tidptr;
--
1.9.1
- [Qemu-devel] [PATCH 00/16] Augment support for signal handling, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 07/16] linux-user: add rt_tgsigqueueinfo() strace, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 13/16] [RFC] linux-user: add functions for working with the target signal mask, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 03/16] linux-user: fix ssetmask() system call, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 08/16] linux-user: fix inconsistent spaces in print_siginfo() output, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 12/16] [RFC] linux-user: fix sigismember() check, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 01/16] linux-user: add strace for getuid(), gettid(), getppid(), geteuid(), Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 10/16] [RFC] linux-user: add support for tracking the target signal mask,
Miloš Stojanović <=
- [Qemu-devel] [PATCH 05/16] linux-user: fix argument type declaration of rt_sigqueinfo() syscall, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 02/16] linux-user: add tkill(), tgkill() and rt_sigqueueinfo() strace, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 11/16] [RFC] linux-user: add target_sigdelset() and target_sigorset(), Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 06/16] linux-user: add support for rt_tgsigqueueinfo() system call, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 04/16] linux-user: fix mismatch of lock/unlock_user() invocations in rt_sigqueinfo() syscall, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 15/16] [RFC] linux-user: add support for multiplexing larger target signals, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 09/16] linux-user: add strace support for uinfo structure of rt_sigqueueinfo() and rt_tgsigqueueinfo(), Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 16/16] [RFC] linux-user: add support for multiplexing signals in rt_sigqueueinfo(), rt_tgsigqueueinfo(), kill() and tgkill() syscalls., Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 14/16] [RFC] linux-user: add functionality for tracking target signal mask, Miloš Stojanović, 2017/05/12
- Re: [Qemu-devel] [PATCH 00/16] Augment support for signal handling, no-reply, 2017/05/12