From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org, x86@kernel.org,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Ingo Molnar <mingo@redhat.com>, Jonathan Corbet <corbet@lwn.net>,
Thomas Gleixner <tglx@kernel.org>
Subject: Re: [PATCH] x86: Start removing X86_X32_ABI
Date: Mon, 1 Jun 2026 23:44:56 +0200 [thread overview]
Message-ID: <20260601214456.NLyqoEer@linutronix.de> (raw)
In-Reply-To: <29bdbdc4-caef-4486-8816-84422c23bc20@app.fastmail.com>
On 2026-05-31 23:46:10 [+0200], Arnd Bergmann wrote:
> On Tue, May 26, 2026, at 22:43, Sebastian Andrzej Siewior wrote:
> > On 2026-05-26 08:54:56 [-0700], H. Peter Anvin wrote:
> >
> >> System call numbers or even mechanisms are in no wise tied to the ELF
> >> type. An x86-64 binary can issue x86-64, x32 or i386 system calls,
> >> even from 64-bit mode!
> >
> > But *why* have syscalls if nothing else works? It is not that you have a
> > natural environment where these things work and in a later kernel they
> > behave differently. It just not working.
>
> It's not about having the syscalls, it's whether we need to keep
> them as 'reserved' indefinitely, the same way we don't reuse
> any other number that ever did something.
>
> The problem is what happens when you run new userspace that calls
> a syscall >512 on a kernel before v5.4 with x32 enabled, see commit
> 6365b842aae4 ("x86/syscalls: Split the x32 syscalls into their own
> table").
Okay, that is point. That would be something like new Debian distro but
still the old kernel.
> The normal rule is that any new syscall should return -ENOSYS on
> old kernels to make it safe to detect from userspace whether it
> is available or not. On linux-5.4 or newer kernels, that is what
> happens. On older ones this would call one of the 35 x32 syscalls
> that were available at the time.
>
> Skipping these numbers is clearly annoying, given that we now
> synchronize them across all architectures, but it's probably
> the right thing to do, at least if C libraries that want to
> support future syscalls >511 also want to keep running on old
> kernels. glibc still officially supports linux-3.2 (2.6.32
> on x86), and musl tries to support even older versions.
I see. That is unfortunate then.
But just to check one thing: From the referenced commit "ioctl() is nr
16 on x86_64 but 514 on x32". So the kernel knows if it is x-64 or x-32?
But we can't reuse 514 on x-64 and return -1 on -x32 simply because the
pre v5.4 kernel do the ioctl() instead of an error?
> Arnd
Sebastian
next prev parent reply other threads:[~2026-06-01 21:44 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-23 9:37 Sebastian Andrzej Siewior
2026-05-23 21:43 ` H. Peter Anvin
2026-05-26 10:40 ` Sebastian Andrzej Siewior
2026-05-26 15:53 ` H. Peter Anvin
2026-05-26 15:54 ` H. Peter Anvin
2026-05-26 20:43 ` Sebastian Andrzej Siewior
2026-05-31 21:46 ` Arnd Bergmann
2026-06-01 21:44 ` Sebastian Andrzej Siewior [this message]
2026-06-01 22:45 ` Arnd Bergmann
2026-05-27 12:02 ` David Laight
2026-06-01 21:29 ` H. Peter Anvin
2026-06-04 20:27 ` Thomas Gleixner
2026-05-27 13:10 ` Sam James
2026-05-27 13:41 ` Neal Gompa
2026-05-27 15:57 ` John Paul Adrian Glaubitz
2026-06-01 21:12 ` Sebastian Andrzej Siewior
2026-06-01 21:14 ` H. Peter Anvin
2026-05-28 7:05 ` Tomas Glozar
2026-06-01 21:26 ` Sebastian Andrzej Siewior
2026-05-31 22:05 ` Arnd Bergmann
2026-06-02 16:02 ` Maciej W. Rozycki
2026-06-02 16:36 ` Arnd Bergmann
2026-06-05 3:35 ` H. Peter Anvin
2026-07-04 8:08 ` Sebastian Andrzej Siewior
2026-07-04 8:56 ` Arnd Bergmann
2026-06-02 9:48 ` Richard Purdie
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=20260601214456.NLyqoEer@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@kernel.org \
--cc=x86@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®