qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH] linux-user: fix signal() syscall


From: Laurent Vivier
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] linux-user: fix signal() syscall on x86_64
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


Le 01/07/2016 à 15:35, Peter Maydell a écrit :
> On 1 July 2016 at 12:59, Wirth, Allan <address@hidden> 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 <address@hidden>
>> ---
>>  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]