This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] mips/o32: fix internal_syscall5/6/7



On 16/08/2017 11:46, Maciej W. Rozycki wrote:
> On Wed, 16 Aug 2017, Adhemerval Zanella wrote:
> 
>> +ENTRY(__libc_do_syscall)
>> +        move    $2, $4
>> +        move    $4, $5
>> +        move    $5, $6
>> +        move    $6, $7
> 
>  I'm not very keen on having a nested syscall function call, but if you do 
> that, then please at least arrange the wrapper's arguments such that you 
> don't have to shuffle them, i.e. I suggest placing the syscall number 
> last.

I aimed for simplicity here since to avoid shuffle it would require three
specialized wrapper, one for each syscall convention (5/6/7).  I can do it,
but I still prefer to have only one entry point, since I think the possible
performance gains are not worth the extra maintenance burden.

> 
>  For historical reasons you may want to initialise $2 right before the 
> SYSCALL instruction, although I take it we don't anymore support Linux 
> kernels old enough to require it for the syscall restart convention (so it 
> would mainly serve as a reference for those who need to write their own 
> code supporting those old kernels, as people often blindly copy & paste 
> existing pieces).

Do you know which is the kernel version which this was not really required?
I actually tested on a 3.2 on qemu (as it is the minimum one supported
currently).

> 
>  Also the MIPS16 wrappers may require adjustment then in order not to 
> execute a doubly nested function call unnecessarily, i.e. call 
> `__libc_do_syscall' directly rather than through another wrapper.

I did not actually tested MIPS16, neither build for it.  I would appreciate
any help here, since my mips abi knowledge is limited.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]