From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LUOTh-0003oE-RQ for qemu-devel@nongnu.org; Tue, 03 Feb 2009 11:50:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LUOTf-0003o2-DJ for qemu-devel@nongnu.org; Tue, 03 Feb 2009 11:50:24 -0500 Received: from [199.232.76.173] (port=49560 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LUOTf-0003nz-88 for qemu-devel@nongnu.org; Tue, 03 Feb 2009 11:50:23 -0500 Received: from mx2.suse.de ([195.135.220.15]:56139) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LUOTe-00084F-NX for qemu-devel@nongnu.org; Tue, 03 Feb 2009 11:50:23 -0500 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 499204772F for ; Tue, 3 Feb 2009 17:50:19 +0100 (CET) From: Ulrich Hecht Date: Tue, 3 Feb 2009 17:50:33 +0100 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Message-Id: <200902031750.33777.uli@suse.de> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] i386-linux-user NPTL Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi! This enables NPTL for the i386 target. If someone could comment on why th= e=20 cpu_x86_load_seg() call is necessary, I would appreciate it. It looks lik= e an elaborate nop to me. Signed-off-by: Ulrich Hecht Index: linux-user/syscall.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-user/syscall.c (revision 6501) +++ linux-user/syscall.c (working copy) @@ -2937,8 +2937,14 @@ flags &=3D ~CLONE_NPTL_FLAGS2; =20 /* 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 + } =20 /* 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 =3D (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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- configure (revision 6501) +++ configure (working copy) @@ -1583,6 +1591,7 @@ echo "KVM_CFLAGS=3D$kvm_cflags" >> $config_mak echo "#define CONFIG_KVM 1" >> $config_h fi + target_nptl=3D"yes" ;; x86_64) echo "TARGET_ARCH=3Dx86_64" >> $config_mak --=20 SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG N=FCrnberg)