# 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 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2026/10/17793543
- Thread: https://ratatoskr.run/linuxppc-dev/2026/07/17227033/t/2.md

```text
On Thu, Oct 22 2026 at 17:22, H. Peter Anvin wrote:
> On October 22, 2026 2:34:08 PM PDT, Thomas Gleixner [ref] wrote:
>>-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




```
