From patchwork Sat Jul 2 08:20:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 9210735 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 6F097607D6 for ; Sat, 2 Jul 2016 08:21:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57D2B28568 for ; Sat, 2 Jul 2016 08:21:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B6C5286C7; Sat, 2 Jul 2016 08:21:34 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 84ED828568 for ; Sat, 2 Jul 2016 08:21:33 +0000 (UTC) Received: from localhost ([::1]:37375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJGB9-0000V3-VE for patchwork-qemu-devel@patchwork.kernel.org; Sat, 02 Jul 2016 04:21:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJGAq-0000Jy-G6 for qemu-devel@nongnu.org; Sat, 02 Jul 2016 04:21:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJGAn-0003eU-9Q for qemu-devel@nongnu.org; Sat, 02 Jul 2016 04:21:12 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:64972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJGAm-0003di-Uy; Sat, 02 Jul 2016 04:21:09 -0400 Received: from [192.168.100.1] ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0Ls3eJ-1bSMj03d9z-013sYL; Sat, 02 Jul 2016 10:20:50 +0200 To: Peter Maydell , "Wirth, Allan" References: <92770843-66C8-471B-BA9C-DA46E92817B9@akamai.com> From: Laurent Vivier Message-ID: <164e58f5-7dcc-bc9f-286f-98b5de56c1cb@vivier.eu> Date: Sat, 2 Jul 2016 10:20:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:2Du7QGfKpzfyZTPEt5UB5K2lBWfLZxbQ4V7UElxg4dr6vQ19Qu9 BtyzbUaH/6287oF+NsZGcqhowQeTrKLPsAf48Wzv6+0Fy8MYikxtSZLtK+TDx5D4IG1apKs uio3mVPmyVF7T4G2NdiWVCKGnBMBujR69i3zI9EXR2XrZbxCQqHXGyfljCbF/TQAnGC7nyS Cle/e1OJvIEWhcJIdk3Xg== X-UI-Out-Filterresults: notjunk:1; V01:K0:74/fkn5nQ0k=:weE4A5OHaZoMJ0u1M72kI3 r4Yr2UJDDibK5S77mkfgePAIDWUqYhzVkM4/Ao1yJOFVDHnvqOBVi2W4yLnKm7F2Te0Fc50Nd nY7o5Xl35kxcTiEa4qnv4vJ464h9zoEHUugfKHoz1SKNmeGcDaUzVRLA0wy6rYL8vothXe1SS wj8maXwSsZL+WCYHje8GSqqQWvNVMpdsjeB3Xo5DDf0bw0SNQrSNrgvAppEsKl0RWyBLZ7KAd frit4ogf6Eh7PJENKMisisdGKyyx0T8vpHN/184Yzgdu1bxpzmve5HlQ34qYoH7nyp1P2VMxA y6BqKBCnIcMEIUA4q7HQP9zPVg/JooNeeMrKnqCkF6yEQSUV1nLj2WU5Ws3+vjD44Rde7bYdZ ALpiXCqnwDkkwwgIJp4cRp89+XMMlPVDrZIxn9/O/dJF1QdVnyZ0yUla18Nqq2RPugrVF+2/I LLqRdPIhVtrGE7vb7ngKDipCjIx+uqJ53F5fWrQRj7tuVtAFrzomFqQmhskkjvfDlqRrpYMHf rIaNFo/w72hGqbeJCU9DAVO3zxFEleXJlf1kqnz6Z9rRQTkU3amRG+9Ax1iZwY/eZiklGtfy4 0UOKD8Onyt9fJPFBYrgIG13T0W4fIUNV8JcCYLWi/+ydZ2ymsiYBhSuSqAJZfdYPB66CpUD99 F6XaWV6DuFJEk3p8zel0Nd6sPqjRdXhJPVSqIaNzUhcEqa4QQazqMMihQyfwo8fCxZJ0EMOA/ UwmkjUssABYWWZYI X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.134 Subject: Re: [Qemu-devel] [PATCH] linux-user: fix signal() syscall on x86_64 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: "qemu-trivial@nongnu.org" , Timothy Pearson , Riku Voipio , "qemu-devel@nongnu.org" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Le 01/07/2016 à 15:35, Peter Maydell a écrit : > On 1 July 2016 at 12:59, Wirth, Allan wrote: >> Linux on X86_64 does not use sel_arg_struct for select(), the args are >> passed directly. This patch switches a define so X86_64 uses the correct >> calling convention. >> >> Signed-off-by: Allan Wirth >> --- >> linux-user/syscall.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/linux-user/syscall.c b/linux-user/syscall.c >> index 8bf6205..209b2a7 100644 >> --- a/linux-user/syscall.c >> +++ b/linux-user/syscall.c >> @@ -8002,7 +8002,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, >> break; >> #if defined(TARGET_NR_select) >> case TARGET_NR_select: >> -#if defined(TARGET_S390X) || defined(TARGET_ALPHA) >> +#if defined(TARGET_S390X) || defined(TARGET_ALPHA) || defined(TARGET_X86_64) >> ret = do_select(arg1, arg2, arg3, arg4, arg5); >> #else >> { > > There is a cleaner approach which we should use to fix this: > see my comments in reply to this recent patch trying to do > a similar thing: > https://patchwork.kernel.org/patch/9185927/ syscall_nr.h are copies of unistd.h from kernel, so kernel uses also __NR_select and __NR__newselect. I think the fix can be as simple as: { Laurent --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8372,7 +8372,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, break; #if defined(TARGET_NR_select) case TARGET_NR_select: -#if defined(TARGET_S390X) || defined(TARGET_ALPHA) +#if !defined(TARGET_NR__new_select) ret = do_select(arg1, arg2, arg3, arg4, arg5); #else