linux-user: Honor CLONE_SETTLS for openrisc
authorRichard Henderson <rth@twiddle.net>
Thu, 9 Feb 2017 20:56:34 +0000 (06:56 +1000)
committerRichard Henderson <rth@twiddle.net>
Mon, 13 Feb 2017 21:14:59 +0000 (08:14 +1100)
Threads work much better when you set the TLS register.
This was fixed in the upstream kernel for Linux 4.9.

Signed-off-by: Richard Henderson <rth@twiddle.net>
linux-user/openrisc/target_cpu.h

index a21ed1aff883dbb0e7337a61c69b48a713b0e315..f283d96a9353ed85b2316e5b1eddd8bab26fd41e 100644 (file)
@@ -30,9 +30,7 @@ static inline void cpu_clone_regs(CPUOpenRISCState *env, target_ulong newsp)
 
 static inline void cpu_set_tls(CPUOpenRISCState *env, target_ulong newtls)
 {
-    /* Linux kernel 3.10 does not pay any attention to CLONE_SETTLS
-     * in copy_thread(), so QEMU need not do so either.
-     */
+    env->gpr[10] = newtls;
 }
 
 #endif