From mboxrd@z Thu Jan 1 00:00:00 1970 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 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 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] linux-user: fix signal() syscall on x86_64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , "Wirth, Allan" Cc: "qemu-trivial@nongnu.org" , Riku Voipio , "qemu-devel@nongnu.org" , Timothy Pearson 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: --- 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 { Laurent