This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] off_t: fix register pair calculation for 64-bit case
- From: Arnd Bergmann <arnd at arndb dot de>
- To: libc-alpha at sourceware dot org
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, Yury Norov <ynorov at caviumnetworks dot com>, Mike Frysinger <vapier at gentoo dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>, Chris Metcalf <cmetcalf at tilera dot com>, Andrew Pinski <pinskia at gmail dot com>, cmetcalf at mellanox dot com
- Date: Fri, 24 Jun 2016 15:15:50 +0200
- Subject: Re: [PATCH] off_t: fix register pair calculation for 64-bit case
- Authentication-results: sourceware.org; auth=none
- References: <1466770980-18933-1-git-send-email-ynorov at caviumnetworks dot com> <20160624124113 dot GA18992 at yury-N73SV> <CAMe9rOrP2PTc5hiWrwhCVvijtWYqMk6vjnqUYcUWrnYqVu+ejQ at mail dot gmail dot com>
On Friday, June 24, 2016 5:57:26 AM CEST H.J. Lu wrote:
> On Fri, Jun 24, 2016 at 5:41 AM, Yury Norov <ynorov@caviumnetworks.com> wrote:
> > On Fri, Jun 24, 2016 at 05:30:32AM -0700, H.J. Lu wrote:
> >> On Fri, Jun 24, 2016 at 5:23 AM, Yury Norov <ynorov@caviumnetworks.com> wrote:
> >> > There are 3 syscall wrappers under sysdeps/unix/sysv/linux that
> >> > calculate register pair for off_t like this:
> >> > __LONG_LONG_PAIR (offset >> 31, offset)
> >> >
> >> > While it works for 32-bit off_t, new 32-bit APIs that use 64-bit
> >> > off_t will be broken with it. This patch redirects affected syscalls
> >> > to their 64-bit versions. It also saves few instructions and symbols
> >> > in glibc, as 32-bit syscall wrappers are not generated anymore.
> >>
> >> If you have 64-bit register, should you use wordsize-64, like
> >>
> >> sysdeps/unix/sysv/linux/wordsize-64
> >>
> >> H.J.
> >
> > Sometimes it's not possible. AARCh64/ILP32 requires to pass 64-bit
> > parameters as pair. (this is one of two options for ILP32 that is
> > under discussion)
>
> You should still use wordsize-64 and make special exceptions if needed.
Can the syscall ABI be a single exception then? I think at this
point the syscall interface for aarch64 ILP32 is exactly the same
as for 32-bit RISC-V.
I guess it makes sense to use sysdeps/wordsize-64/ and
sysdeps/ieee754/dbl-64/wordsize-64/, but the
sysdeps/unix/sysv/linux/wordsize-64/ directory seems to only
contain files for syscalls that differ between 32-bit and
64-bit architectures, so each one of them would otherwise
need a separate override that redirects to the normal 32-bit
syscall.
Arnd