For SIGILL, SIGFPE and SIGTRAP the PSW must point after the
instruction, and at the instruction for other signals. Currently under
qemu-user it always points at the instruction.
Fix by advancing psw.addr for these signals.
Buglink: https://gitlab.com/qemu-project/qemu/-/issues/319
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Co-developed-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
---
linux-user/s390x/cpu_loop.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/linux-user/s390x/cpu_loop.c b/linux-user/s390x/cpu_loop.c
index 30568139df..230217feeb 100644
--- a/linux-user/s390x/cpu_loop.c
+++ b/linux-user/s390x/cpu_loop.c
@@ -133,6 +133,11 @@ void cpu_loop(CPUS390XState *env)
do_signal_pc:
addr = env->psw.addr;
+ /*
+ * For SIGILL, SIGFPE and SIGTRAP the PSW must point after the
+ * instruction.
+ */
+ env->psw.addr += env->int_pgm_ilen;