public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* CONFIG_COMPAT_32BIT_TIME in the kernel, x86 ABI on x86-64
@ 2023-07-23 15:16 Andreas K. Huettel
  2023-07-23 15:21 ` Andreas K. Huettel
  2023-07-23 18:46 ` Adhemerval Zanella Netto
  0 siblings, 2 replies; 6+ messages in thread
From: Andreas K. Huettel @ 2023-07-23 15:16 UTC (permalink / raw)
  To: libc-alpha, floppym, adhemerval.zanella

[-- Attachment #1: Type: text/plain, Size: 1243 bytes --]

Dear all, 

one of my Gentoo colleagues (Mike Gilbert, floppym) found this, so I'm forwarding
his notes:

===
Using utimensat as an example, the kernel interface is as follows:

When CONFIG_COMPAT_32BIT_TIME is enabled, the kernel provides both the legact 
32-bit interface (utimensat) and the 64-bit interface (utimensat_time64).
When CONFIG_COMPAT_32BIT_TIME is disabled, only the 64-bit interface 
(utimensat_time64) is provided. utimensat gives ENOSYS.

Behavior of utimensat64 libc function before b286eca5d4117b3e17c939e3df56e132ae623df1:

1. Try utimensat_time64
2. If ENOSYS, fall back to utimensat if the arguments are small enough to fit in 32-bits

Behavior of utimensat64 libc function after b286eca5d4117b3e17c939e3df56e132ae623df1:

1. If the arguments are small enough to fit in 32-bits, use utimensat
2. If the arguments are too large, use utimensat_time64

The new behavior fails when CONFIG_COMPAT_32BIT_TIME is disabled, since utimensat is 
unavailable.

Several other glibc functions were updated with similar behavior changes.
===

What's to do?

Cheers,
Andreas

-- 
Andreas K. Hüttel
dilfridge@gentoo.org
Gentoo Linux developer
(council, toolchain, base-system, perl, libreoffice)

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CONFIG_COMPAT_32BIT_TIME in the kernel, x86 ABI on x86-64
  2023-07-23 15:16 CONFIG_COMPAT_32BIT_TIME in the kernel, x86 ABI on x86-64 Andreas K. Huettel
@ 2023-07-23 15:21 ` Andreas K. Huettel
  2023-07-23 18:46 ` Adhemerval Zanella Netto
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas K. Huettel @ 2023-07-23 15:21 UTC (permalink / raw)
  To: libc-alpha, floppym, adhemerval.zanella; +Cc: Andreas K. Huettel

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

Am Sonntag, 23. Juli 2023, 17:16:55 CEST schrieb Andreas K. Huettel via Libc-alpha:
> Dear all, 
> 
> one of my Gentoo colleagues (Mike Gilbert, floppym) found this, so I'm forwarding
> his notes:
> 

PS. For clarity, this is the situation since glibc 2.34. 
(So not a (recent) regression and not directly relevant to the 2.38 release.)

-- 
Andreas K. Hüttel
dilfridge@gentoo.org
Gentoo Linux developer
(council, toolchain, base-system, perl, libreoffice)

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CONFIG_COMPAT_32BIT_TIME in the kernel, x86 ABI on x86-64
  2023-07-23 15:16 CONFIG_COMPAT_32BIT_TIME in the kernel, x86 ABI on x86-64 Andreas K. Huettel
  2023-07-23 15:21 ` Andreas K. Huettel
@ 2023-07-23 18:46 ` Adhemerval Zanella Netto
  2023-07-24 12:55   ` Carlos O'Donell
  1 sibling, 1 reply; 6+ messages in thread
From: Adhemerval Zanella Netto @ 2023-07-23 18:46 UTC (permalink / raw)
  To: Andreas K. Huettel, libc-alpha, floppym



On 23/07/23 12:16, Andreas K. Huettel wrote:
> Dear all, 
> 
> one of my Gentoo colleagues (Mike Gilbert, floppym) found this, so I'm forwarding
> his notes:
> 
> ===
> Using utimensat as an example, the kernel interface is as follows:
> 
> When CONFIG_COMPAT_32BIT_TIME is enabled, the kernel provides both the legact 
> 32-bit interface (utimensat) and the 64-bit interface (utimensat_time64).
> When CONFIG_COMPAT_32BIT_TIME is disabled, only the 64-bit interface 
> (utimensat_time64) is provided. utimensat gives ENOSYS.
> 
> Behavior of utimensat64 libc function before b286eca5d4117b3e17c939e3df56e132ae623df1:
> 
> 1. Try utimensat_time64
> 2. If ENOSYS, fall back to utimensat if the arguments are small enough to fit in 32-bits
> 
> Behavior of utimensat64 libc function after b286eca5d4117b3e17c939e3df56e132ae623df1:
> 
> 1. If the arguments are small enough to fit in 32-bits, use utimensat
> 2. If the arguments are too large, use utimensat_time64
> 
> The new behavior fails when CONFIG_COMPAT_32BIT_TIME is disabled, since utimensat is 
> unavailable.
> 
> Several other glibc functions were updated with similar behavior changes.
> ===
> 
> What's to do?

It has been already discussed [1], and not only glibc but musl creator Rich
agreed [2] that this option is a gratuitous userspace API/ABI stability policy 
breakage that Linux (at least Linus and some other maintainers) is adamant to 
not introduce.

At least for glibc we have the option to configure with a minimum 5.1 kernel
(--enable-kernel=5.1) which should disable the 32 bit syscall fallback.  This
should work with CONFIG_COMPAT_32BIT_TIME, although I have not actually
test it.

[1] https://sourceware.org/pipermail/libc-alpha/2022-November/143330.html
[2] https://sourceware.org/pipermail/libc-alpha/2022-November/143349.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CONFIG_COMPAT_32BIT_TIME in the kernel, x86 ABI on x86-64
  2023-07-23 18:46 ` Adhemerval Zanella Netto
@ 2023-07-24 12:55   ` Carlos O'Donell
  2023-07-24 13:16     ` Andreas Schwab
  2023-07-24 13:22     ` Adhemerval Zanella Netto
  0 siblings, 2 replies; 6+ messages in thread
From: Carlos O'Donell @ 2023-07-24 12:55 UTC (permalink / raw)
  To: Adhemerval Zanella Netto, Andreas K. Huettel, libc-alpha, floppym

On 7/23/23 14:46, Adhemerval Zanella Netto via Libc-alpha wrote:
> 
> 
> On 23/07/23 12:16, Andreas K. Huettel wrote:
>> Dear all, 
>>
>> one of my Gentoo colleagues (Mike Gilbert, floppym) found this, so I'm forwarding
>> his notes:
>>
>> ===
>> Using utimensat as an example, the kernel interface is as follows:
>>
>> When CONFIG_COMPAT_32BIT_TIME is enabled, the kernel provides both the legact 
>> 32-bit interface (utimensat) and the 64-bit interface (utimensat_time64).
>> When CONFIG_COMPAT_32BIT_TIME is disabled, only the 64-bit interface 
>> (utimensat_time64) is provided. utimensat gives ENOSYS.
>>
>> Behavior of utimensat64 libc function before b286eca5d4117b3e17c939e3df56e132ae623df1:
>>
>> 1. Try utimensat_time64
>> 2. If ENOSYS, fall back to utimensat if the arguments are small enough to fit in 32-bits
>>
>> Behavior of utimensat64 libc function after b286eca5d4117b3e17c939e3df56e132ae623df1:
>>
>> 1. If the arguments are small enough to fit in 32-bits, use utimensat
>> 2. If the arguments are too large, use utimensat_time64
>>
>> The new behavior fails when CONFIG_COMPAT_32BIT_TIME is disabled, since utimensat is 
>> unavailable.
>>
>> Several other glibc functions were updated with similar behavior changes.
>> ===
>>
>> What's to do?
> 
> It has been already discussed [1], and not only glibc but musl creator Rich
> agreed [2] that this option is a gratuitous userspace API/ABI stability policy 
> breakage that Linux (at least Linus and some other maintainers) is adamant to 
> not introduce.
> 
> At least for glibc we have the option to configure with a minimum 5.1 kernel
> (--enable-kernel=5.1) which should disable the 32 bit syscall fallback.  This
> should work with CONFIG_COMPAT_32BIT_TIME, although I have not actually
> test it.
> 
> [1] https://sourceware.org/pipermail/libc-alpha/2022-November/143330.html
> [2] https://sourceware.org/pipermail/libc-alpha/2022-November/143349.html
> 

Adhemerval,

Could you please review this release note?
https://sourceware.org/glibc/wiki/Release/2.38#Linux_kernel_config_option_CONFIG_COMPAT_32BIT_TIME_and_userspace_ABI

I want to have something that we can point distributions to as the official answer.

-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CONFIG_COMPAT_32BIT_TIME in the kernel, x86 ABI on x86-64
  2023-07-24 12:55   ` Carlos O'Donell
@ 2023-07-24 13:16     ` Andreas Schwab
  2023-07-24 13:22     ` Adhemerval Zanella Netto
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2023-07-24 13:16 UTC (permalink / raw)
  To: Carlos O'Donell via Libc-alpha
  Cc: Adhemerval Zanella Netto, Andreas K. Huettel, floppym,
	Carlos O'Donell

On Jul 24 2023, Carlos O'Donell via Libc-alpha wrote:

> https://sourceware.org/glibc/wiki/Release/2.38#Linux_kernel_config_option_CONFIG_COMPAT_32BIT_TIME_and_userspace_ABI

"In such a configured kernel" should be "With such a configured glibc",
I think.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CONFIG_COMPAT_32BIT_TIME in the kernel, x86 ABI on x86-64
  2023-07-24 12:55   ` Carlos O'Donell
  2023-07-24 13:16     ` Andreas Schwab
@ 2023-07-24 13:22     ` Adhemerval Zanella Netto
  1 sibling, 0 replies; 6+ messages in thread
From: Adhemerval Zanella Netto @ 2023-07-24 13:22 UTC (permalink / raw)
  To: Carlos O'Donell, Andreas K. Huettel, libc-alpha, floppym



On 24/07/23 09:55, Carlos O'Donell wrote:
> On 7/23/23 14:46, Adhemerval Zanella Netto via Libc-alpha wrote:
>>
>>
>> On 23/07/23 12:16, Andreas K. Huettel wrote:
>>> Dear all, 
>>>
>>> one of my Gentoo colleagues (Mike Gilbert, floppym) found this, so I'm forwarding
>>> his notes:
>>>
>>> ===
>>> Using utimensat as an example, the kernel interface is as follows:
>>>
>>> When CONFIG_COMPAT_32BIT_TIME is enabled, the kernel provides both the legact 
>>> 32-bit interface (utimensat) and the 64-bit interface (utimensat_time64).
>>> When CONFIG_COMPAT_32BIT_TIME is disabled, only the 64-bit interface 
>>> (utimensat_time64) is provided. utimensat gives ENOSYS.
>>>
>>> Behavior of utimensat64 libc function before b286eca5d4117b3e17c939e3df56e132ae623df1:
>>>
>>> 1. Try utimensat_time64
>>> 2. If ENOSYS, fall back to utimensat if the arguments are small enough to fit in 32-bits
>>>
>>> Behavior of utimensat64 libc function after b286eca5d4117b3e17c939e3df56e132ae623df1:
>>>
>>> 1. If the arguments are small enough to fit in 32-bits, use utimensat
>>> 2. If the arguments are too large, use utimensat_time64
>>>
>>> The new behavior fails when CONFIG_COMPAT_32BIT_TIME is disabled, since utimensat is 
>>> unavailable.
>>>
>>> Several other glibc functions were updated with similar behavior changes.
>>> ===
>>>
>>> What's to do?
>>
>> It has been already discussed [1], and not only glibc but musl creator Rich
>> agreed [2] that this option is a gratuitous userspace API/ABI stability policy 
>> breakage that Linux (at least Linus and some other maintainers) is adamant to 
>> not introduce.
>>
>> At least for glibc we have the option to configure with a minimum 5.1 kernel
>> (--enable-kernel=5.1) which should disable the 32 bit syscall fallback.  This
>> should work with CONFIG_COMPAT_32BIT_TIME, although I have not actually
>> test it.
>>
>> [1] https://sourceware.org/pipermail/libc-alpha/2022-November/143330.html
>> [2] https://sourceware.org/pipermail/libc-alpha/2022-November/143349.html
>>
> 
> Adhemerval,
> 
> Could you please review this release note?
> https://sourceware.org/glibc/wiki/Release/2.38#Linux_kernel_config_option_CONFIG_COMPAT_32BIT_TIME_and_userspace_ABI
> 
> I want to have something that we can point distributions to as the official answer.
> 

Sounds good to me modules Andreas remarks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-24 13:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-23 15:16 CONFIG_COMPAT_32BIT_TIME in the kernel, x86 ABI on x86-64 Andreas K. Huettel
2023-07-23 15:21 ` Andreas K. Huettel
2023-07-23 18:46 ` Adhemerval Zanella Netto
2023-07-24 12:55   ` Carlos O'Donell
2023-07-24 13:16     ` Andreas Schwab
2023-07-24 13:22     ` Adhemerval Zanella Netto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).