[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] linux-user/i386: Emulate x86_64 vsyscalls
From: |
Alex Bennée |
Subject: |
Re: [PATCH 3/3] linux-user/i386: Emulate x86_64 vsyscalls |
Date: |
Thu, 16 Jan 2020 20:15:04 +0000 |
User-agent: |
mu4e 1.3.6; emacs 28.0.50 |
Richard Henderson <address@hidden> writes:
> On 1/16/20 6:26 AM, Alex Bennée wrote:
>>> + /*
>>> + * Perform the syscall. None of the vsyscalls should need restarting,
>>> + * and all faults should have been caught above.
>>> + */
>>> + ret = do_syscall(env, syscall, env->regs[R_EDI], env->regs[R_ESI],
>>> + env->regs[R_EDX], env->regs[10], env->regs[8],
>>> + env->regs[9], 0, 0);
>>
>> How come the register ABI to the syscall is different to the others. I
>> can see why syscall doesn't come from EAX but the others are a different
>> set to normal syscalls which might be why:
>
> Cut and paste error, I assume.
>
> That said, the three syscalls have a maximum of 2 arguments,
> so I could really just pass EDI and ESI and 0 for the rest...
>
>> I'm seeing a EFAULT on the gettimeofday failure:
>
> What getttimeofday failure? Is this related to the mention of /sbin/ldconfig
> in your previous message?
No - the buster x86064 ldconfig seg is unrelated to this series. It has
however spawned an additional bug in gdbstub while it was at it ;-)
>
>> #0 do_syscall (cpu_env=cpu_env@entry=0x5555577d2b10, num=num@entry=96,
>> arg1=0, arg2=0, arg3=4211016, arg4=8, arg5=274888677184, arg6=274886295415,
>> arg7=0, arg8=0) at /home/alex/lsrc/qemu.git/linux-user/syscall.c:12076
>>
>> #1 0x0000555555609b6e in emulate_vsyscall (env=0x5555577d2b10) at
>> /home/alex/lsrc/qemu.git/linux-user/x86_64/../i386/cpu_loop.c:180
>> #2 cpu_loop (env=0x5555577d2b10) at
>> /home/alex/lsrc/qemu.git/linux-user/x86_64/../i386/cpu_loop.c:246
>>
>> #3 0x000055555559640e in main (argc=<optimized out>, argv=<optimized
>> #out>, envp=<optimized out>) at
>> #/home/alex/lsrc/qemu.git/linux-user/main.c:865
>>
>> arg1/arg2 don't seem right here.
>
> Why? NULL value for arg1 is legal, though semi-useless.
>
> Ah, I see that our implementation of gettimeofday doesn't honor NULL.
>
>
> r~
--
Alex Bennée
- Re: [PATCH 1/3] target/i386: Renumber EXCP_SYSCALL, (continued)
- Re: [PATCH 0/3] linux-user: Implement x86_64 vsyscalls, Paolo Bonzini, 2020/01/14
- Re: [PATCH 0/3] linux-user: Implement x86_64 vsyscalls, Laurent Desnogues, 2020/01/15
- Re: [PATCH 0/3] linux-user: Implement x86_64 vsyscalls, Laurent Vivier, 2020/01/15
- Re: [PATCH 0/3] linux-user: Implement x86_64 vsyscalls, Alex Bennée, 2020/01/16
- Re: [PATCH 0/3] linux-user: Implement x86_64 vsyscalls, Alex Bennée, 2020/01/16