[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251209121701.1856271-6-hca@linux.ibm.com>
Date: Tue, 9 Dec 2025 13:16:57 +0100
From: Heiko Carstens <hca@...ux.ibm.com>
To: Alexander Gordeev <agordeev@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Peter Zijlstra <peterz@...radead.org>,
Mark Rutland <mark.rutland@....com>, Arnd Bergmann <arnd@...db.de>,
Jens Remus <jremus@...ux.ibm.com>,
Stefan Schulze Frielinghaus <stefansf@...ux.ibm.com>,
Juergen Christ <jchrist@...ux.ibm.com>
Cc: linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org
Subject: [PATCH 5/9] s390/traps: Copy monitor code to pt_regs
In case of a monitor call program check the CPU stores the monitor code to
lowcore. Let the program check handler copy it to the pt_regs structure so
it can be used by the monitor call exception handler.
Instead of increasing the pt_regs size add a union which contains both
orig_gpr2 and monitor_code, since orig_gpr2 is not used in case of a
program check.
Signed-off-by: Heiko Carstens <hca@...ux.ibm.com>
---
arch/s390/include/asm/ptrace.h | 5 ++++-
arch/s390/kernel/traps.c | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/s390/include/asm/ptrace.h b/arch/s390/include/asm/ptrace.h
index 962cf042c66d..f3c3a4ee263c 100644
--- a/arch/s390/include/asm/ptrace.h
+++ b/arch/s390/include/asm/ptrace.h
@@ -120,7 +120,10 @@ struct pt_regs {
unsigned long gprs[NUM_GPRS];
};
};
- unsigned long orig_gpr2;
+ union {
+ unsigned long orig_gpr2;
+ unsigned long monitor_code;
+ };
union {
struct {
unsigned int int_code;
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index de63e98e724b..b2d6d7cc3b17 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -298,6 +298,7 @@ void noinstr __do_pgm_check(struct pt_regs *regs)
teid.val = lc->trans_exc_code;
regs->int_code = lc->pgm_int_code;
regs->int_parm_long = teid.val;
+ regs->monitor_code = lc->monitor_code;
/*
* In case of a guest fault, short-circuit the fault handler and return.
* This way the sie64a() function will return 0; fault address and
--
2.51.0
Powered by blists - more mailing lists