Re: [patch 16/18] x86/entry: Get rid of the sys_ni_syscall() indirection

From
Thomas Gleixner <tglx@kernel.org>
Date
2026-10-23 13:09:10
Also in
linux-alpha, linux-arch, linux-doc, linux-m68k, linux-mips, linux-riscv, linux-s390, linux-sh, linux-um, lkml, loongarch, sparclinux
Reply to
H. Peter Anvin, 2026-10-23
On Thu, Oct 22 2026 at 17:22, H. Peter Anvin wrote:
On October 22, 2026 2:34:08 PM PDT, Thomas Gleixner [off-list ref] wrote:
quoted
-static __always_inline void do_syscall_x32(struct pt_regs *regs, unsigned long nr)
+static __always_inline bool do_syscall_x32(struct pt_regs *regs, unsigned long nr)
{
+	if (!IS_ENABLED(CONFIG_X86_X32_ABI))
+		return false;
+
+	/* Preserve the historic insanity of treating -1 special on x32 */
+	if (nr == ULONG_MAX)
+		return true;
It was never limited to x32...
Tired brain misread the test output:

[RUN]   Running tests under ptrace: modifying the default return
[RUN]       Checking system calls with msb = 0 (0x0)
[OK]                x32 syscalls 0:-64..-2 returned -ENOSYS as expected
[OK]                x32 syscall 0:-1 returned MODIFIED_BY_PTRACE as expected
[OK]                x64 syscalls 0:-64..-1 returned -ENOSYS as expected

But that's because the "-1" on x32 is actually 0xFFFFFFFF while on x64
it's 0x7FFFFFFF.

The whole mess comes from using -1 as indicator for syscall abort which
is undistinguishable from a syscall(nr=-1).

Bah. Let me restore this nonsense.

Thanks,

        tglx



Thread (125 messages) 125 messages, 17 authors, last reply 6d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help