On Wed, Nov 18, 2026 at 03:11:26PM +0100, Renzo Davoli wrote:
> On Wed, Nov 18, 2026 at 02:33:56PM +0100, Michal Suchánek wrote:
> > As I understand it the new s390 code resolves the problem by storing the
> > syscall number outside of the registers. Then the return value can be
> > set directly. It does not depend on using the generic entry but on the
> > architecture adding storage for the syscall number in struct pt_regs,
> > and implementing the code to determine where to get/set the syscall
> > value depending on the syscall stage.
> 
> Right, thanks for the correction: what matters is a separate storage
> for the syscall number on the architectures where it shares a register
> with the return value, not the generic entry code.
> 
> > However, it seems that extending struct pt_regs breaks userspace ABI
> > (probably because kernel refuses to transfer partial pt_regs to/fom
> > userspace) which makes it unclear how the int_code that is used by this
> > new code could be added to the s390 struct pt_regs in the first place.
> 
> On s390 int_code is not new: it has been in the kernel-only part of
> struct pt_regs, after user_pt_regs, since aa33c8cbbae2 ("[S390] cleanup
> trap handling"), and the user ABI (s390_regs, user_regs_struct) does
> not include it. Heiko's patch only redirects the ptrace accesses to
> gpr2.
> 
> On architectures where struct pt_regs is itself the user ABI (e.g.
> alpha), the storage does not need to be in pt_regs: MIPS already keeps
> the syscall number in thread_info.
> 
> This is also why this series uses a per-task flag at the seccomp stop:
> it does not depend on where the architecture stores the syscall
> number.

It does not have to know where the architecture stores the syscall
number when using syscall_get_nr and syscall_set_nr. However, the
storage for the syscall number has to be somewhere, and for powerpc
there is AFAIK no such storage.

Thanks

Michal

Reply via email to