From: "Arnd Bergmann" <arnd@arndb.de>
To: "Thomas Weißschuh" <linux@weissschuh.net>,
"Willy Tarreau" <w@1wt.eu>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Will Deacon" <will@kernel.org>, shuah <shuah@kernel.org>
Cc: "Mark Brown" <broonie@kernel.org>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH 1/7] tools/nolibc: remove __nolibc_enosys() fallback from time64-related functions
Date: Wed, 01 Oct 2025 09:43:37 +0200 [thread overview]
Message-ID: <cec27d94-c99d-4c57-9a12-275ea663dda8@app.fastmail.com> (raw)
In-Reply-To: <20250821-nolibc-enosys-v1-1-4b63f2caaa89@weissschuh.net>
On Thu, Aug 21, 2025, at 17:40, Thomas Weißschuh wrote:
> These fallbacks where added when no explicit fallbacks for time64 was
> implemented. Now that these fallbacks are in place, the additional
> fallback to __nolibc_enosys() is superfluous.
>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Hi Thomas,
I just saw these fly by as they made it into mainline and
I noticed that there is still something wrong here:
> @@ -39,10 +39,8 @@ int sys_poll(struct pollfd *fds, int nfds, int
> timeout)
> t.tv_nsec = (timeout % 1000) * 1000000;
> }
> return my_syscall5(__NR_ppoll_time64, fds, nfds, (timeout >= 0) ? &t
> : NULL, NULL, 0);
> -#elif defined(__NR_poll)
> - return my_syscall3(__NR_poll, fds, nfds, timeout);
> #else
> - return __nolibc_enosys(__func__, fds, nfds, timeout);
> + return my_syscall3(__NR_poll, fds, nfds, timeout);
> #endif
> }
The change is fine, as there is always at least one of the
time64 or the old syscalls implemented, for any of the affected
calls.
However, the problem here is the default to the old time
types on 32-bit targets, for two reasons:
- this fails when turning off CONFIG_COMPAT_32BIT_TIME
- the old types are often too short, both for the y2038
overflow and for the file system types.
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.
The proper solution I think would be to do the same thing
that klibc has and use sane defaults for all the types
along with the modern syscalls. At least __kernel_time_t,
__kernel_timespec, __kernel_ino_t, __kernel_loff_t and
probably a few more. We should also consider drop the
legacy type definitions from uapi/linux/time.h and
require each libc to define their own.
Arnd
next prev parent reply other threads:[~2025-10-01 7:44 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 [this message]
2025-10-06 20:14 ` Thomas Weißschuh
2025-10-07 10:03 ` Arnd Bergmann
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=cec27d94-c99d-4c57-9a12-275ea663dda8@app.fastmail.com \
--to=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--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®