* [Qemu-devel] [PATCH] i386-linux-user NPTL
@ 2009-02-03 16:50 Ulrich Hecht
0 siblings, 0 replies; only message in thread
From: Ulrich Hecht @ 2009-02-03 16:50 UTC (permalink / raw)
To: qemu-devel
Hi!
This enables NPTL for the i386 target. If someone could comment on why the
cpu_x86_load_seg() call is necessary, I would appreciate it. It looks like
an elaborate nop to me.
Signed-off-by: Ulrich Hecht <uli@suse.de>
Index: linux-user/syscall.c
===================================================================
--- linux-user/syscall.c (revision 6501)
+++ linux-user/syscall.c (working copy)
@@ -2937,8 +2937,14 @@
flags &= ~CLONE_NPTL_FLAGS2;
/* TODO: Implement CLONE_CHILD_CLEARTID. */
- if (nptl_flags & CLONE_SETTLS)
+ if (nptl_flags & CLONE_SETTLS) {
+#if defined(TARGET_I386) && defined(TARGET_ABI32)
+ do_set_thread_area(new_env, newtls);
+ cpu_x86_load_seg(new_env, R_GS, new_env->segs[R_GS].selector);
+#else
cpu_set_tls (new_env, newtls);
+#endif
+ }
/* Grab a mutex so that thread setup appears atomic. */
pthread_mutex_lock(&clone_lock);
@@ -3009,8 +3015,14 @@
if (flags & CLONE_PARENT_SETTID)
put_user_u32(gettid(), parent_tidptr);
ts = (TaskState *)env->opaque;
- if (flags & CLONE_SETTLS)
+ if (flags & CLONE_SETTLS) {
+#if defined(TARGET_I386) && defined(TARGET_ABI32)
+ do_set_thread_area(env, newtls);
+ cpu_x86_load_seg(env, R_GS, env->segs[R_GS].selector);
+#else
cpu_set_tls (env, newtls);
+#endif
+ }
/* TODO: Implement CLONE_CHILD_CLEARTID. */
#endif
} else {
Index: configure
===================================================================
--- configure (revision 6501)
+++ configure (working copy)
@@ -1583,6 +1591,7 @@
echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
echo "#define CONFIG_KVM 1" >> $config_h
fi
+ target_nptl="yes"
;;
x86_64)
echo "TARGET_ARCH=x86_64" >> $config_mak
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-02-03 16:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-03 16:50 [Qemu-devel] [PATCH] i386-linux-user NPTL Ulrich Hecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.