]> Git Repo - qemu.git/commitdiff
target/s390x: Fix SIGILL and SIGFPE psw.addr reporting
authorIlya Leoshkevich <[email protected]>
Mon, 5 Jul 2021 21:04:33 +0000 (23:04 +0200)
committerThomas Huth <[email protected]>
Tue, 3 Aug 2021 13:17:32 +0000 (15:17 +0200)
For SIGILL, SIGFPE and SIGTRAP the PSW must point after the
instruction, and at the instruction for other signals. Currently under
qemu-user for SIGFILL and SIGFPE it points at the instruction.

Fix by advancing psw.addr for these signals.

Co-developed-by: Ulrich Weigand <[email protected]>
Signed-off-by: Ilya Leoshkevich <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Buglink: https://gitlab.com/qemu-project/qemu/-/issues/319
Message-Id: <20210705210434[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
linux-user/s390x/cpu_loop.c

index f2d1215fb1bb821a392ac5194d1ddd073e3d3d1e..22f2e89c623ce321e626245c73dbabf5071ae50d 100644 (file)
@@ -64,7 +64,13 @@ void cpu_loop(CPUS390XState *env)
         case EXCP_DEBUG:
             sig = TARGET_SIGTRAP;
             n = TARGET_TRAP_BRKPT;
-            goto do_signal_pc;
+            /*
+             * For SIGTRAP the PSW must point after the instruction, which it
+             * already does thanks to s390x_tr_tb_stop(). si_addr doesn't need
+             * to be filled.
+             */
+            addr = 0;
+            goto do_signal;
         case EXCP_PGM:
             n = env->int_pgm_code;
             switch (n) {
@@ -132,6 +138,10 @@ void cpu_loop(CPUS390XState *env)
 
         do_signal_pc:
             addr = env->psw.addr;
+            /*
+             * For SIGILL and SIGFPE the PSW must point after the instruction.
+             */
+            env->psw.addr += env->int_pgm_ilen;
         do_signal:
             info.si_signo = sig;
             info.si_errno = 0;
This page took 0.025923 seconds and 4 git commands to generate.