From: Sven Schnelle <svens@linux.ibm.com>
To: Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Janosch Frank <frankja@linux.ibm.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
borntraeger@linux.ibm.com, linux-s390@vger.kernel.org
Subject: [PATCH 2/2] s390/syscalls: Use define instead of '1' to indicate PER trap
Date: Thu, 9 Jul 2026 21:55:00 +0200 [thread overview]
Message-ID: <20260709195500.1241833-3-svens@linux.ibm.com> (raw)
In-Reply-To: <20260709195500.1241833-1-svens@linux.ibm.com>
Make the code a bit easier to read by defining SYSCALL_PER_TRAP
instead of passing '1' to __do_syscall().
Suggested-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
---
arch/s390/kernel/entry.S | 2 +-
arch/s390/kernel/entry.h | 3 ++-
arch/s390/kernel/syscall.c | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index d70eef7a0b29..10dd9bbdf985 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -368,7 +368,7 @@ SYM_CODE_START(pgm_check_handler)
mvc __LC_RETURN_PSW(8,%r13),__LC_SVC_NEW_PSW(%r13)
larl %r14,.Lsysc_per
stg %r14,__LC_RETURN_PSW+8(%r13)
- lghi %r14,1
+ lghi %r14,SYSCALL_FLAG_PER_TRAP
LBEAR __LC_PGM_LAST_BREAK(%r13)
LPSWEY __LC_RETURN_PSW,__LC_RETURN_LPSWE # branch to .Lsysc_per
SYM_CODE_END(pgm_check_handler)
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h
index d18a9a63f6b8..dc84ab497251 100644
--- a/arch/s390/kernel/entry.h
+++ b/arch/s390/kernel/entry.h
@@ -3,6 +3,7 @@
#define _ENTRY_H
#define PGM_FLAG_GUEST_FAULT 1
+#define SYSCALL_FLAG_PER_TRAP 1
#ifndef __ASSEMBLER__
@@ -26,7 +27,7 @@ void early_pgm_check_handler(void);
struct task_struct *__switch_to_asm(struct task_struct *prev, struct task_struct *next);
void __ret_from_fork(struct task_struct *prev, struct pt_regs *regs);
void __do_pgm_check(struct pt_regs *regs, unsigned long flags);
-void __do_syscall(struct pt_regs *regs, int per_trap);
+void __do_syscall(struct pt_regs *regs, unsigned long flags);
void __do_early_pgm_check(struct pt_regs *regs);
void do_protection_exception(struct pt_regs *regs);
diff --git a/arch/s390/kernel/syscall.c b/arch/s390/kernel/syscall.c
index 75d5a3cab14e..b6c643756a7c 100644
--- a/arch/s390/kernel/syscall.c
+++ b/arch/s390/kernel/syscall.c
@@ -93,7 +93,7 @@ SYSCALL_DEFINE0(ni_syscall)
return -ENOSYS;
}
-void noinstr __do_syscall(struct pt_regs *regs, int per_trap)
+void noinstr __do_syscall(struct pt_regs *regs, unsigned long flags)
{
unsigned long nr;
@@ -106,7 +106,7 @@ void noinstr __do_syscall(struct pt_regs *regs, int per_trap)
current->thread.last_break = regs->last_break;
local_irq_enable();
regs->orig_gpr2 = regs->gprs[2];
- if (unlikely(per_trap))
+ if (unlikely(flags & SYSCALL_FLAG_PER_TRAP))
set_thread_flag(TIF_PER_TRAP);
regs->flags = 0;
set_pt_regs_flag(regs, PIF_SYSCALL);
--
2.53.0
next prev parent reply other threads:[~2026-07-09 19:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 19:54 [PATCH 0/2] s390: Remove PIF_GUEST_FAULT and add PER trap flag Sven Schnelle
2026-07-09 19:54 ` [PATCH 1/2] s390/traps: Remove PIF_GUEST_FAULT Sven Schnelle
2026-07-09 19:55 ` Sven Schnelle [this message]
2026-07-10 7:43 ` [PATCH 0/2] s390: Remove PIF_GUEST_FAULT and add PER trap flag Heiko Carstens
2026-07-10 8:40 ` Vasily Gorbik
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=20260709195500.1241833-3-svens@linux.ibm.com \
--to=svens@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=linux-s390@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox