]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/traps: Copy monitor code to pt_regs
authorHeiko Carstens <hca@linux.ibm.com>
Fri, 9 Jan 2026 15:31:40 +0000 (16:31 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 27 Jan 2026 11:16:16 +0000 (12:16 +0100)
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.

Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/ptrace.h
arch/s390/kernel/traps.c

index e6ec0ccf3d737dfb144876942d200004b1fae470..aaceb1d9110a4dd16d9bec9231a6912044855146 100644 (file)
@@ -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;
index de63e98e724bf66b6d22bd6118e156fe300fec44..b2d6d7cc3b176d5fce21f8f8282f1bf28fb1ef82 100644 (file)
@@ -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