Thread (26 messages) flat view 26 messages, 5 authors, 2026-07-06

Re: [RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR

From: Sven Schnelle <svens@linux.ibm.com>
Date: 2026-07-03 11:40:18
Also in: linux-doc, linux-riscv, linux-s390, lkml, loongarch

Michal Suchánek [off-list ref] writes:
The same could be asked of syscall_enter_from_user_mode. I find it very
odd. Why does it conflate the syscall number with its return value?

It never uses the syscall number passed in except when returning it
unchanged. When it pokes the registers it reads the syscall number from
them.

If the caller of syscall_enter_from_user_mode only read the syscall
number from the registers when syscall_enter_from_user_mode returns and
indicates the syscall should be still executed this whole shenigan would
I agree. The fact that if (nr < NR_syscall) just works because -1 gets
casted to 0xffffffff and is therefore out of bounds is very odd.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help