From: Heiko Carstens <hca@linux.ibm.com>
To: Sven Schnelle <svens@linux.ibm.com>
Cc: "Vasily Gorbik" <gor@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>,
"H. Peter Anvin" <hpa@zytor.com>,
"Thomas Gleixner" <tglx@kernel.org>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Michal Suchánek" <msuchanek@suse.de>,
"Peter Zijlstra" <peterz@infradead.org>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] s390/syscall: Keep syscall number in extra ptregs member
Date: Wed, 15 Jul 2026 15:59:49 +0200 [thread overview]
Message-ID: <20260715135949.100936A27-hca@linux.ibm.com> (raw)
In-Reply-To: <20260715133830.2619853-3-svens@linux.ibm.com>
On Wed, Jul 15, 2026 at 03:38:30PM +0200, Sven Schnelle wrote:
> Move the syscall number from ptregs::int_code to another union member
> called syscall_nr. This simplifies the code a bit.
>
> Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
> ---
> arch/s390/include/asm/ptrace.h | 2 +-
> arch/s390/include/asm/syscall.h | 8 +++++---
> arch/s390/kernel/ptrace.c | 2 +-
> arch/s390/kernel/signal.c | 12 +++++-------
> arch/s390/kernel/syscall.c | 11 ++++-------
> 5 files changed, 16 insertions(+), 19 deletions(-)
...
> diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
> index 125ca4c4e30c..00e825d01504 100644
> --- a/arch/s390/kernel/ptrace.c
> +++ b/arch/s390/kernel/ptrace.c
> @@ -349,7 +349,7 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data)
> addr == offsetof(struct user, regs.gprs[2])) {
> struct pt_regs *regs = task_pt_regs(child);
>
> - regs->int_code = 0x20000 | (data & 0xffff);
> + regs->syscall_nr = data;
This breaks peek_user(). So handling for that needs to be added too.
> - regs->psw.addr =
> - __rewind_psw(regs->psw,
> - regs->int_code >> 16);
> + regs->psw.addr = __rewind_psw(regs->psw, SVC_LEN);
Why? This is unrelated to what you want to achieve, and it is broken
if the svc instruction is executed via exrl. Plus, let's not use
hardcoded instruction lengths if the CPU provides you the correct
length anyway.
Besides that it _seems_ to be ok. :)
next prev parent reply other threads:[~2026-07-15 14:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 13:38 [PATCH RFC 0/2] s390: keep syscall number / return value in separate pt_regs members Sven Schnelle
2026-07-15 13:38 ` [PATCH 1/2] s390/syscall: Keep syscall return in extra ptregs member Sven Schnelle
2026-07-15 14:04 ` sashiko-bot
2026-07-15 13:38 ` [PATCH 2/2] s390/syscall: Keep syscall number " Sven Schnelle
2026-07-15 13:59 ` Heiko Carstens [this message]
2026-07-15 14:10 ` sashiko-bot
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=20260715135949.100936A27-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=msuchanek@suse.de \
--cc=peterz@infradead.org \
--cc=svens@linux.ibm.com \
--cc=tglx@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.