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? > #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~