linux-user/signal.c: Use s390 target space address instead of host space
authorChen Gang <chengang@emindsoft.com.cn>
Tue, 24 May 2016 11:54:32 +0000 (14:54 +0300)
committerRiku Voipio <riku.voipio@linaro.org>
Fri, 27 May 2016 11:50:40 +0000 (14:50 +0300)
The return address is in target space, so the restorer address needs to
be target space, too.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
linux-user/signal.c

index c75fb48..28ce921 100644 (file)
@@ -4159,8 +4159,8 @@ static void setup_frame(int sig, struct target_sigaction *ka,
         env->regs[14] = (unsigned long)
                 ka->sa_restorer | PSW_ADDR_AMODE;
     } else {
-        env->regs[14] = (unsigned long)
-                frame->retcode | PSW_ADDR_AMODE;
+        env->regs[14] = (frame_addr + offsetof(sigframe, retcode))
+                        | PSW_ADDR_AMODE;
         __put_user(S390_SYSCALL_OPCODE | TARGET_NR_sigreturn,
                    (uint16_t *)(frame->retcode));
     }