qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ulrich Hecht <uli@suse.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] i386-linux-user NPTL
Date: Tue, 3 Feb 2009 17:50:33 +0100	[thread overview]
Message-ID: <200902031750.33777.uli@suse.de> (raw)

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)

                 reply	other threads:[~2009-02-03 16:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200902031750.33777.uli@suse.de \
    --to=uli@suse.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).