diff mbox series

[PULL,03/15] linux-user/hppa: Fix cpu_clone_regs

Message ID fc37dcfe1a049090e72fd3f4810f0b221cc5399c.1511212753.git.riku.voipio@linaro.org
State Accepted
Commit fc37dcfe1a049090e72fd3f4810f0b221cc5399c
Headers show
Series late linux-user fixes for 2.11 | expand

Commit Message

Riku Voipio Nov. 20, 2017, 9:21 p.m. UTC
From: Richard Henderson <rth@twiddle.net>


By failing to return from the syscall in the child, the child
issues another clone syscall and hilarity ensues.

Signed-off-by: Richard Henderson <rth@twiddle.net>

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>

---
 linux-user/hppa/target_cpu.h | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.14.2
diff mbox series

Patch

diff --git a/linux-user/hppa/target_cpu.h b/linux-user/hppa/target_cpu.h
index 1a5cecad3c..e50522eae9 100644
--- a/linux-user/hppa/target_cpu.h
+++ b/linux-user/hppa/target_cpu.h
@@ -24,7 +24,11 @@  static inline void cpu_clone_regs(CPUHPPAState *env, target_ulong newsp)
     if (newsp) {
         env->gr[30] = newsp;
     }
+    /* Indicate child in return value.  */
     env->gr[28] = 0;
+    /* Return from the syscall.  */
+    env->iaoq_f = env->gr[31];
+    env->iaoq_b = env->gr[31] + 4;
 }
 
 static inline void cpu_set_tls(CPUHPPAState *env, target_ulong newtls)