]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
linux-user/hppa: Fix cpu_clone_regs
authorRichard Henderson <rth@twiddle.net>
Tue, 31 Oct 2017 12:53:54 +0000 (13:53 +0100)
committerRiku Voipio <riku.voipio@linaro.org>
Tue, 7 Nov 2017 19:58:12 +0000 (21:58 +0200)
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

index 1a5cecad3c44e4f34a8af5fbf5fc4c9e1559189b..e50522eae953432f90f5ad414e4e4a3c01d6f51b 100644 (file)
@@ -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)