From nobody Mon Feb 9 11:51:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494860902551223.6712821721552; Mon, 15 May 2017 08:08:22 -0700 (PDT) Received: from localhost ([::1]:37295 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAHbf-0005Lw-5M for importer@patchew.org; Mon, 15 May 2017 11:08:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAHZC-0003Tl-SD for qemu-devel@nongnu.org; Mon, 15 May 2017 11:05:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dAHZ8-0006QX-A0 for qemu-devel@nongnu.org; Mon, 15 May 2017 11:05:46 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:46755 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dAHZ8-0006Pp-2G for qemu-devel@nongnu.org; Mon, 15 May 2017 11:05:42 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id A88551A4562; Mon, 15 May 2017 17:05:40 +0200 (CEST) Received: from rtrkw488-lin.domain.local (unknown [10.10.14.90]) by mail.rt-rk.com (Postfix) with ESMTPSA id 8548C1A2413; Mon, 15 May 2017 17:05:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: =?UTF-8?q?Milo=C5=A1=20Stojanovi=C4=87?= To: qemu-devel@nongnu.org, riku.voipio@iki.fi Date: Mon, 15 May 2017 16:59:50 +0200 Message-Id: <1494860396-24930-11-git-send-email-Milos.Stojanovic@rt-rk.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1494860396-24930-1-git-send-email-Milos.Stojanovic@rt-rk.com> References: <1494860396-24930-1-git-send-email-Milos.Stojanovic@rt-rk.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v2 10/16] [RFC] linux-user: add support for tracking the target signal mask X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Miodrag.Dinic@rt-rk.com, laurent@vivier.eu, Petar.Jovanovic@rt-rk.com, Aleksandar.Markovic@rt-rk.com, yongbok.kim@imgtec.com, Milos.Stojanovic@rt-rk.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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=C5=A1 Stojanovi=C4=87 --- 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; =20 diff --git a/linux-user/signal.c b/linux-user/signal.c index 3d18d1b..54c3be7 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -485,6 +485,9 @@ void signal_init(void) =20 /* 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_ma= sk); +#endif =20 /* 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 fl= ags, abi_ulong newsp, ts->bprm =3D parent_ts->bprm; ts->info =3D parent_ts->info; ts->signal_mask =3D parent_ts->signal_mask; +#ifdef TRACK_TARGET_SIGMASK + ts->target_signal_mask =3D parent_ts->target_signal_mask; +#endif =20 if (flags & CLONE_CHILD_CLEARTID) { ts->child_tidptr =3D child_tidptr; --=20 1.9.1