This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[RFC] x32 and syscall consolidation
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 12 Jul 2016 10:38:59 +0100
- Subject: [RFC] x32 and syscall consolidation
- Authentication-results: sourceware.org; auth=none
Hi all,
On recent syscall consolidation with off/off64_t arguments the new
preadv/pwritev tests triggered an issue on x32 and I believe recent
fix [1] is not really correct.
As stated by H.J Lu x32 passes 64-bit arguments in registers and,
different than MIPS, it does not use the compat syscall for
p{read,write}v{64}.
The problem for x32 is the {INTERNAL,INLINE}_SYSCALL C macros
explicit cast the arguments to 'long int', thus passing
as 32 bits arguments that should be passed to 64 bits.
Previous x32 implementation uses the auto-generated syscalls from
assembly macros (syscalls.list), so the {INTERNAL,INLINE}_SYSCALL
macros are never used with 64 bit argument in x32 (which are
internally broken for this ILP).
I see the most straightforward fix is just to re-enable the auto
generation is x32 syscalls list for the faulty syscalls. This
should fix current issues with the syscalls and the most safe
fix for 2.24.
However I would also like to enable {INTERNAL,INLINE}_SYSCALL
to work correctly with 64-bits arguments on x32 and potentially
on any ILP32 ports. The C binding macros currently throw warnings
if one try to cast a ILP32 pointer to 64 bit register argument,
so I am not really sure how to cleanup this kind of code.
[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=cf1ad5b3add36790cbf58a3972c492a8f1632929