On 15 June 2011 15:32, Richard Henderson <[email protected]> wrote:
> On 06/15/2011 01:35 AM, Alexander Graf wrote:
>>> -                abi_ulong arg5 = 0, arg6 = 0, arg7 = 0, arg8 = 0;
>>> +                abi_ulong arg5 = 0, arg6 = 0;
>>>
>>>                 nb_args = mips_syscall_args[syscall_num];
>>>                 sp_reg = env->active_tc.gpr[29];
>>>                 switch (nb_args) {
>>>                 /* these arguments are taken from the stack */
>>>                 /* FIXME - what to do if get_user() fails? */
>>> -                case 8: get_user_ual(arg8, sp_reg + 28);
>>> -                case 7: get_user_ual(arg7, sp_reg + 24);
>>> +                case 8: /* get_user_ual(arg8, sp_reg + 28); */
>>> +                case 7: /* get_user_ual(arg7, sp_reg + 24); */
>>
>> I'd prefer to see these and the respective variable definitions #if
>> 0'd with a comment, stating that they're currently unused.
>
> I'd prefer not to see if 0 code.  Better, I think, to mark the
> variables as __attribute__((unused)) with that same comment.

Ideally what we ought to be doing here is actually plumbing arg7
and arg8 through to do_syscall().

Two syscalls in the table, sys_fadvise64_64 and sys_sync_file_range,
take 7 arguments (and we can deduce that they're misimplemented in
do_syscall() for 32 bit MIPS targets, probably by not gluing
together two 32 bit arguments into a 64 bit value to pass to
the libc function); arg8 is needed in order to be able to invoke
these 7 argument syscalls via sys_syscall. (sys_syscall's entry
in the mips_syscall_args[] array says it takes zero arguments,
which I think is just broken.)

Actually fixing the 7-argument syscalls is a bit out of scope,
but I think widening do_syscall() to take 8 arguments is
straightforward enough.

(Incidentally this whole code looks a bit 32 bit specific,
do we support 64 bit mips targets in linux-user mode ?)

-- PMM
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to