From: Richard Henderson Date: Tue, 31 Oct 2017 12:53:54 +0000 (+0100) Subject: linux-user/hppa: Fix cpu_clone_regs X-Git-Tag: v2.11.0-rc2~10^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc37dcfe1a049090e72fd3f4810f0b221cc5399c;p=thirdparty%2Fqemu.git linux-user/hppa: Fix cpu_clone_regs By failing to return from the syscall in the child, the child issues another clone syscall and hilarity ensues. Signed-off-by: Richard Henderson Signed-off-by: Riku Voipio --- diff --git a/linux-user/hppa/target_cpu.h b/linux-user/hppa/target_cpu.h index 1a5cecad3c4..e50522eae95 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)