From patchwork Wed Jun 8 13:29:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 9164673 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 73F0B60467 for ; Wed, 8 Jun 2016 13:40:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6742120410 for ; Wed, 8 Jun 2016 13:40:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B1F7282DC; Wed, 8 Jun 2016 13:40:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FSL_HELO_HOME, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D9A6F20410 for ; Wed, 8 Jun 2016 13:40:10 +0000 (UTC) Received: from localhost ([::1]:57054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdiL-0004JF-Kp for patchwork-qemu-devel@patchwork.kernel.org; Wed, 08 Jun 2016 09:40:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZC-00046H-HC for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:30:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAdZA-0005g5-GF for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:30:41 -0400 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]:33839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZA-0005fN-8h for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:30:40 -0400 Received: by mail-lf0-x230.google.com with SMTP id s186so5868650lfs.1 for ; Wed, 08 Jun 2016 06:30:40 -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; bh=CxM5bS5Ph2xbRn6HmsWZPm/rFoNpUX8+Sxz4TuTr4zM=; b=ILKN6koEe6Hyk+uv4T1E1HLzu3FkuVHvydW3PljGjbgH73ngpln2uKHsgPKcOMMUOu pGS6BS5WG3G2J0V0yOlHHg22weO6Jt4q4oZdJHCyaCU30aWzecgaT+97o/EugopqVY3y Gal8fgTqSlKiOfw2Dqk1fXsfHFm1FQokjPPAk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CxM5bS5Ph2xbRn6HmsWZPm/rFoNpUX8+Sxz4TuTr4zM=; b=YxaOjKGEkiorR5auzmb8L7Sh8kBgPD2Q+kkA8v0zHsGv9wKJpd/Gtuy6GcpKr51HAb 3tDjoAky0ip/gOFWaUFEH3p/EHfs4n63GlCce71u8DJYKufFjhVhI3O9dUya/nouyjp2 zmxI77NKyz+kd3a7QAi195g7dRwxM3NT/5Yda0NWBiVzgFBkJIDkwlHuI/f49sKIjlvf JLU2rZRw2BVBjQ6YVrSSgLq4F7T7mproP/vYofzJEKyqrGBYlIbF5d/9v0v4qvZWlFd1 n1w9TPlyx1VTsN34UWkXQVGkLu50IjIp4asdUOUpXamYpZkukYI5Pmwc9SMqbU+xEvhy XizQ== X-Gm-Message-State: ALyK8tJbLWs4XaFDchgfMVJSK5WRM9FGwvpPBUlMRq46s8Z2fxIR/br2lDhdiW82C64ZZA6f X-Received: by 10.25.73.136 with SMTP id w130mr646545lfa.172.1465392639544; Wed, 08 Jun 2016 06:30:39 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id 2sm139854lja.37.2016.06.08.06.30.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 06:30:38 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 8 Jun 2016 16:29:51 +0300 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::230 Subject: [Qemu-devel] [PULL 10/44] linux-user: Define macro for size of host kernel sigset_t 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 Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Maydell Some host syscalls take an argument specifying the size of a host kernel's sigset_t (which isn't necessarily the same as that of the host libc's type of that name). Instead of hardcoding _NSIG / 8 where we do this, define and use a SIGSET_T_SIZE macro. Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Signed-off-by: Riku Voipio --- linux-user/syscall.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9cc9a35..d2749a6 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -124,6 +124,10 @@ int __clone2(int (*fn)(void *), void *child_stack_base, #define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct linux_dirent [2]) #define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct linux_dirent [2]) +/* This is the size of the host kernel's sigset_t, needed where we make + * direct system calls that take a sigset_t pointer and a size. + */ +#define SIGSET_T_SIZE (_NSIG / 8) #undef _syscall0 #undef _syscall1 @@ -7862,7 +7866,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, /* Extract the two packed args for the sigset */ if (arg6) { sig_ptr = &sig; - sig.size = _NSIG / 8; + sig.size = SIGSET_T_SIZE; arg7 = lock_user(VERIFY_READ, arg6, sizeof(*arg7) * 2, 1); if (!arg7) { @@ -8916,7 +8920,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, set = NULL; } - ret = get_errno(sys_ppoll(pfd, nfds, timeout_ts, set, _NSIG/8)); + ret = get_errno(sys_ppoll(pfd, nfds, timeout_ts, + set, SIGSET_T_SIZE)); if (!is_error(ret) && arg3) { host_to_target_timespec(arg3, timeout_ts);