ILP32 for ARM64
Subsystems (2)
Quoted 4 lines · Geert Uytterhoeven
Quoted 3 lines · Yury Norov
v6:
-time_t,__kenel_off_tand other types turned to be 32-bit for compatibility reasons (after v5 discussion);
Introducing a new arch today with y2038 problems is not a good idea. Linus said so with appropriately pointy words in 2011.
Quoted 5 lines
What makes you think these "applications that can’t readily be migrated to LP64 because they were written assuming an ILP32 data model, and that will never become suitable for a LP64 data model and will remain locked into ILP32 operating environments" are more likely to be fixed for y2038 later, than for LP64 now?
Such broken applications already have plenty of bogus architecture detection code so you need porting anyway...
Quoted 7 lines
We're already closer to the (future) y2038 than to the (past) introduction of LP64...
These unfixable legacy applications have been spreading through x32 to the shiny new arm64 server architecture (does ppc64el also have an ILP32 mode, or is it planned)? Lots of resources are spent on maintaining the status quo, instead of on fixing the real problems.
As an x32 (userland) porter, I can tell you that time_t!=long _did_ cause non-trivial amounts of work. But that work is already done (at least in Debian), so you might as well benefit from it.
Signature · 1 line
A tit a day keeps the vet away.
Quoted 8 lines · Adam Borowski
Quoted 4 lines · Geert Uytterhoeven
Quoted 3 lines · Yury Norov
v6:
-time_t,__kenel_off_tand other types turned to be 32-bit for compatibility reasons (after v5 discussion);Introducing a new arch today with y2038 problems is not a good idea. Linus said so with appropriately pointy words in 2011.
This is the third time we had this discussion on time_t for ILP32. I had originally it as 32bit, then Catalin suggested I change it to 64bit and then Arnd (with his work for 2038 issue on 32bit arch) said ILP32 should match all other 32bit targets and the other 64bit time_t be fixed by the current work he was working on. Now you are suggesting we change it again.
Arnd can you please comment more on why we want 32bit time_t instead of the 64bit one? I Know there was some POSIX (or was it C90) violation but I suspect there is an easy way to workaround this inside the kernel but the discussion to move over to 32bit time_t was already made by the time I started to look into that.
Quoted 9 lines
Quoted 6 lines
What makes you think these "applications that can?t readily be migrated to LP64 because they were written assuming an ILP32 data model, and that will never become suitable for a LP64 data model and will remain locked into ILP32 operating environments" are more likely to be fixed for y2038 later, than for LP64 now?
Such broken applications already have plenty of bogus architecture detection code so you need porting anyway...
I don't disagree here; just see below ...
Quoted 4 lines
Quoted 4 lines
We're already closer to the (future) y2038 than to the (past) introduction of LP64...
Quoted 8 lines
Quoted 4 lines
These unfixable legacy applications have been spreading through x32 to the shiny new arm64 server architecture (does ppc64el also have an ILP32 mode, or is it planned)? Lots of resources are spent on maintaining the status quo, instead of on fixing the real problems.
As an x32 (userland) porter, I can tell you that time_t!=long _did_ cause non-trivial amounts of work. But that work is already done (at least in Debian), so you might as well benefit from it.
There is actually private code out there which uses timespec and timeval to pass time over the wire; yes I know bad coding style and all but they did it that way. This is code which was working for x86 and we are porting it to ARM64; a data center code by the way; not some networking code even. This means they have not ported the code to fully 64bit yet and they might never.
Thanks,
Andrew
Quoted 4 lines
--
A tit a day keeps the vet away.
Arnd Bergmann
maintainerQuoted 9 lines · Andrew Pinski
Quoted 8 lines · Adam Borowski
Quoted 4 lines · Geert Uytterhoeven
Quoted 3 lines · Yury Norov
v6:
-time_t,__kenel_off_tand other types turned to be 32-bit for compatibility reasons (after v5 discussion);Introducing a new arch today with y2038 problems is not a good idea. Linus said so with appropriately pointy words in 2011.
This was before we made the decision to fix the y2038 problem for all architectures.
Quoted 11 lines
This is the third time we had this discussion on
time_tfor ILP32. I had originally it as 32bit, then Catalin suggested I change it to 64bit and then Arnd (with his work for 2038 issue on 32bit arch) said ILP32 should match all other 32bit targets and the other 64bittime_tbe fixed by the current work he was working on. Now you are suggesting we change it again.
Arnd can you please comment more on why we want 32bittime_tinstead of the 64bit one? I Know there was some POSIX (or was it C90) violation but I suspect there is an easy way to workaround this inside the kernel but the discussion to move over to 32bittime_twas already made by the time I started to look into that.
x32 still runs into new problems today, and will continue to have problems with newly added drivers that pass time_t (or other __kernel_long_t) arguments through ioctl.
To avoid having to audit every new driver for interfaces that behave differently based on the __kernel_long_t definition, arm64 is not following the same route as x86 here and instead uses the normal 32-bit ABI like any other architecture. This means we use 32-bit time_t, aio_context_t, size_t and clock_t and share the system call implementation with the compat handling for arm (aarch32) mode.
Once we have the interfaces for 64-bit time_t in place in the kernel, we will be able to rebuild glibc on all 32-bit architectures including arm and arm64/ilp32 that way.
The POSIX and C99 incompatibility you mention is about struct timespec, which uses 'long' as the type for the tv_nsec member. This is vaguely related to the issue of 64-bit time_t, but is not the reason for starting out with 32-bit time_t for the new ABI here.
[side note:
How to precisely handle tv_nsec on 32-bit architectures is still an open issue that will have to be solved when we nail down the new system call interfaces:
The issue specifically is what happens when the upper half of the second 64-bit word in struct timespec argument passed into a system call is nonzero: the normal 64-bit syscalls must return an error, while the 32-bit user space expects the kernel to ignore the upper bits. This means something between the application and the native system call has to clear the bits, and this can either be done by copying the data inside of glibc (as done on x32) or by adding an extra system call entry point in the kernel.]
Quoted 12 lines
Quoted 11 lines
Quoted 7 lines
We're already closer to the (future) y2038 than to the (past) introduction of LP64...
These unfixable legacy applications have been spreading through x32 to the shiny new arm64 server architecture (does ppc64el also have an ILP32 mode, or is it planned)? Lots of resources are spent on maintaining the status quo, instead of on fixing the real problems.
As an x32 (userland) porter, I can tell you that time_t!=long _did_ cause non-trivial amounts of work. But that work is already done (at least in Debian), so you might as well benefit from it.
Quoted 6 lines
There is actually private code out there which uses timespec and timeval to pass time over the wire; yes I know bad coding style and all but they did it that way. This is code which was working for x86 and we are porting it to ARM64; a data center code by the way; not some networking code even. This means they have not ported the code to fully 64bit yet and they might never.
This code will run into the same problem on arm64/ilp32 when built against a future libc implementation that defines time_t as 64-bit, but at least the glibc maintainers so far plan to leave this as a per-application option for the forseeable future: even on a system that uses 64-bit time_t in user space and kernel by default, you should be able to build an application using a 32-bit time_t.
Arnd