diff mbox

[PULL,37/38] linux-user/signal.c: Use s390 target space address instead of host space

Message ID 1b924deb2ff634aca3bdea02c602b4c7b91559e3.1464153942.git.riku.voipio@linaro.org
State New
Headers show

Commit Message

Riku Voipio May 25, 2016, 10:32 a.m. UTC
From: Chen Gang <chengang@emindsoft.com.cn>

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/linux-user/signal.c b/linux-user/signal.c
index c75fb48..28ce921 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -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));
     }