mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: "Willy Tarreau" <w@1wt.eu>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will@kernel.org>, shuah <shuah@kernel.org>,
	"Mark Brown" <broonie@kernel.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kselftest@vger.kernel.org,
	Linux-Arch <linux-arch@vger.kernel.org>,
	linux-api@vger.kernel.org
Subject: Re: [PATCH 1/7] tools/nolibc: remove __nolibc_enosys() fallback from time64-related functions
Date: Tue, 07 Oct 2025 12:03:37 +0200	[thread overview]
Message-ID: <b554958d-1f38-4d61-8378-ce784c2bb188@app.fastmail.com> (raw)
In-Reply-To: <a5b8344e-8214-4946-8344-f34e969d30b2@t-8ch.de>

On Mon, Oct 6, 2025, at 22:14, Thomas Weißschuh wrote:
> On 2025-10-01 09:43:37+0200, Arnd Bergmann wrote:
>> On Thu, Aug 21, 2025, at 17:40, Thomas Weißschuh wrote:
>>  - the old types are often too short, both for the y2038
>>    overflow and for the file system types.
>
> So far this was not something we actively tried to support,
> especially with the restriction mentioned below.
>
>> I suspect the problem is that the kernel's uapi/linux/time.h
>> still defines the old types as the default, and nolibc
>> historically just picks it up from there.
>
> So far we have tried to keep nolibc compatible with the kernel UAPI when
> included in any order. This forced us to use 'struct timespec' from
> uapi/linux/time.h. With the upcoming implementation of signals in nolibc
> this guideline is relaxed a bit, so we should be able to use our own
> always-64-bit 'struct timespec'.

You can probably either "#define timespec __kernel_timespec" or
"#define __kernel_timespec timespec" before including
linux/time_types.h.

Note that there is no time64 variant of "struct timeval", so
any syscall that needs this has to be implemented in userspace
as a wrapper around the timespec based one, e.g. gettimeofday()
needs to call clock_gettime() on all 32-bit systems.

>> We should also consider drop the
>> legacy type definitions from uapi/linux/time.h and
>> require each libc to define their own.
>
> Can we even just drop them? Or should they also get some backwards
> compat guards?

This is the big question, and we kind of left this one open
to be decided later when we finished the actual binary interface.

I think simply dropping the old definition is one of several
options we have, because that does not change the ABI in an
incompatible way and just requires the few user space sources
that use this to either require old kernel headers or make
simple source-level changes that they should have done for
portability anyway.

I see multiple decisions we have to make in that option space
once we decide to do anything:

- do we change the headers for both 32-bit and 64-bit userspace
  for consistency, or only for 32-bit userspace to limit
  the impact to those users that care about 32-bit?

- do we remove only the type definitions (timespec, timeval,
  itimerspec, itimerval, timex) or also the syscall macros
  for the time32 syscalls using them?

- What method (if any) would be used to choose between the
  time32 definitions, the time64 definitions or none of them
  when including the kernel headers?

      Arnd

  reply	other threads:[~2025-10-07 10:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-21 15:40 [PATCH 0/7] tools/nolibc: reduce __nolibc_enosys() fallbacks Thomas Weißschuh
2025-08-21 15:40 ` [PATCH 1/7] tools/nolibc: remove __nolibc_enosys() fallback from time64-related functions Thomas Weißschuh
2025-10-01  7:43   ` Arnd Bergmann
2025-10-06 20:14     ` Thomas Weißschuh
2025-10-07 10:03       ` Arnd Bergmann [this message]
2025-08-21 15:40 ` [PATCH 2/7] tools/nolibc: remove __nolibc_enosys() fallback from *at() functions Thomas Weißschuh
2025-08-21 15:40 ` [PATCH 3/7] tools/nolibc: remove __nolibc_enosys() fallback from dup2() Thomas Weißschuh
2025-08-21 15:40 ` [PATCH 4/7] tools/nolibc: remove __nolibc_enosys() fallback from fork functions Thomas Weißschuh
2025-08-21 15:40 ` [PATCH 5/7] tools/nolibc: fold llseek fallback into lseek() Thomas Weißschuh
2025-08-21 15:40 ` [PATCH 6/7] kselftest/arm64: tpidr2: Switch to waitpid() over wait4() Thomas Weißschuh
2025-08-21 17:41   ` Mark Brown
2025-08-26 19:35   ` Catalin Marinas
2025-08-21 15:40 ` [PATCH 7/7] tools/nolibc: drop wait4() support Thomas Weißschuh
2025-08-23 10:28 ` [PATCH 0/7] tools/nolibc: reduce __nolibc_enosys() fallbacks Willy Tarreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b554958d-1f38-4d61-8378-ce784c2bb188@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=shuah@kernel.org \
    --cc=w@1wt.eu \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®