From patchwork Wed May 31 13:08:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 100751 Delivered-To: patch@linaro.org Received: by 10.182.202.35 with SMTP id kf3csp294125obc; Wed, 31 May 2017 06:11:33 -0700 (PDT) X-Received: by 10.55.44.199 with SMTP id s190mr29486295qkh.211.1496236293036; Wed, 31 May 2017 06:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496236293; cv=none; d=google.com; s=arc-20160816; b=bDjRQtqNrdLwuL3TAg9OG0GBERW9Si7r2dAl4u9PeDB79Lnh2RIzB4qgKj9Ra1PUoW d7Hdu3nMXp8T+o81fZJy1tOjrWJvTv35AzGhZ0BRM+GQYx2QJPAoJ6QxsxFp89Ft3+xr 7ZHhNCqfWPmV0X1VUjJW/NClVI90ZLv69ZFLqiBiDqXy/DwKQ3i9EfN0VwjQOTr8I60l xOtt0x5W66VAXUeVCZrlQaqzzUd9wtshI3Kx+hPbrekaC3GLlt5DdKbYFLbI+YjjJekO 84xOB+V9x4I1fJWhD/qTsmsCka51ylWZfpWR2EiiwMROB3OJUKwQ+0CdfK0JdTwhk6+/ VJkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=Un363IfAX6y9hiVbXegmwIPScrZmfJR7QE/OxkIGBIg=; b=Z8lSDE+ZnEGk2puqF34+KjAQ7L7oJTjvdhFe/7yLWn/6Ls3Ws8oiRin57gzwBRY2Y3 FQAgKJR3eFSQAc1SCJTuxw5pEA3nbZ7moWdT6gC7idjX1mzsEWt4wF+uViZAo8VTgI5J naXeksLk8V2mFEVcvuJJkadN2y467iAKbDOegmieQH45nvKV1qevW07/j/eBwpfcxWcP sT96sRbNu0jSf2Oq3Cr4m/1sSyf2y6ErZIfowF/khqJ8PGAdgfGML5sK0iTqD/BY3hjw qrwd0BZsSs5gCABBBufrNMKLRVunBtg41l3jAzi22zujLai/busYejDGlV7peQhTNjid CCVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k15si16100559qta.66.2017.05.31.06.11.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 31 May 2017 06:11:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG3PO-0001CK-CD for patch@linaro.org; Wed, 31 May 2017 09:11:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG3Mp-0007eU-4Z for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dG3Mo-0003fj-20 for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:51 -0400 Received: from mail-lf0-x22e.google.com ([2a00:1450:4010:c07::22e]:36000) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dG3Mn-0003fb-Qp for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:49 -0400 Received: by mail-lf0-x22e.google.com with SMTP id h4so8619342lfj.3 for ; Wed, 31 May 2017 06:08:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Un363IfAX6y9hiVbXegmwIPScrZmfJR7QE/OxkIGBIg=; b=fPTf0BSViFqtliHCibpEJLgx27ZLwl8OrNZVvu19NtRwXYWwxbh0lSMn+c93O1XjqK yYzzddL4HWJkmYJewswaLFp0s1QETTy9y9w5jbzL21GqDsVcMAciGnA5suGq5ok5Ooe4 /OdvIszr7qTo0uE4lGyPb7KIyve+XRF2dzJqU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Un363IfAX6y9hiVbXegmwIPScrZmfJR7QE/OxkIGBIg=; b=Pt3rKbzxTT+SK2Z1hxJalSZGvKr6BuJL/1ubi18KeJz/XdypuOzf/IZjQObVxCy9H4 3Z/P+IzvfcWAQk4bb3nE3gYaBbEm7FvaT+7P3bEkSbrkZoog7BMXIoATAcRsaWg51p6r vng2xf3Ec5G7odVOC/rnkzkMg/k512alsHISLqW8P2LaDY4iokcXAynv627+TqRJ5/5A YyXVpgV4o382YhccRE0Vz6E7hbeJo+XgXBSHuIEiHspdUg8dI9jWFC+uwDeVcQtK02zI +z990gQSTS1c1YAVON6rq0W2mkzBaomQ6M1ghb4H90tNVRh3K42XC4TTGU48pNw2dRiP ir2A== X-Gm-Message-State: AODbwcBEqzT50Sbern5QlNMJjrbp67l+nyo2IK2Z75SJhfXnee98sX+b PlxWpk9Vkj4S/TT1UIKW8A== X-Received: by 10.25.196.207 with SMTP id u198mr7600383lff.20.1496236128299; Wed, 31 May 2017 06:08:48 -0700 (PDT) Received: from localhost.localdomain (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id o101sm3741766lfg.3.2017.05.31.06.08.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 May 2017 06:08:47 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 31 May 2017 16:08:24 +0300 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::22e Subject: [Qemu-devel] [PULL 12/15] linux-user: add support for rt_tgsigqueueinfo() system call 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: peter.maydell@linaro.org, =?utf-8?b?TWlsb8WhIFN0b2phbm92acSH?= , stefanha@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Miloš Stojanović Add a new system call: rt_tgsigqueueinfo(). This system call is similar to rt_sigqueueinfo(), but instead of sending the signal and data to the whole thread group with the ID equal to the argument tgid, it sends it to a single thread within that thread group. The ID of the thread is specified by the tid argument. The implementation is based on the rt_sigqueueinfo() in linux-user mode, where the tid is added as the second argument and the previous second and third argument become arguments three and four, respectively. Signed-off-by: Miloš Stojanović Conflicts: linux-user/syscall.c Signed-off-by: Riku Voipio --- linux-user/syscall.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.11.0 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 3373853bb9..925ae11ea6 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -238,6 +238,7 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \ #define __NR_sys_getdents64 __NR_getdents64 #define __NR_sys_getpriority __NR_getpriority #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo +#define __NR_sys_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo #define __NR_sys_syslog __NR_syslog #define __NR_sys_futex __NR_futex #define __NR_sys_inotify_init __NR_inotify_init @@ -275,6 +276,8 @@ _syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo, loff_t *, res, uint, wh); #endif _syscall3(int, sys_rt_sigqueueinfo, pid_t, pid, int, sig, siginfo_t *, uinfo) +_syscall4(int, sys_rt_tgsigqueueinfo, pid_t, pid, pid_t, tid, int, sig, + siginfo_t *, uinfo) _syscall3(int,sys_syslog,int,type,char*,bufp,int,len) #ifdef __NR_exit_group _syscall1(int,exit_group,int,error_code) @@ -8872,6 +8875,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, ret = get_errno(sys_rt_sigqueueinfo(arg1, arg2, &uinfo)); } break; + case TARGET_NR_rt_tgsigqueueinfo: + { + siginfo_t uinfo; + + p = lock_user(VERIFY_READ, arg4, sizeof(target_siginfo_t), 1); + if (!p) { + goto efault; + } + target_to_host_siginfo(&uinfo, p); + unlock_user(p, arg4, 0); + ret = get_errno(sys_rt_tgsigqueueinfo(arg1, arg2, arg3, &uinfo)); + } + break; #ifdef TARGET_NR_sigreturn case TARGET_NR_sigreturn: if (block_signals()) {