From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeAjK-0005KN-7l for qemu-devel@nongnu.org; Thu, 20 Aug 2009 12:43:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeAjF-0005AS-Ip for qemu-devel@nongnu.org; Thu, 20 Aug 2009 12:43:13 -0400 Received: from [199.232.76.173] (port=38989 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeAjF-0005AC-CK for qemu-devel@nongnu.org; Thu, 20 Aug 2009 12:43:09 -0400 Received: from mx20.gnu.org ([199.232.41.8]:52041) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MeAjF-0005ae-1J for qemu-devel@nongnu.org; Thu, 20 Aug 2009 12:43:09 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MeAjC-0004RI-DJ for qemu-devel@nongnu.org; Thu, 20 Aug 2009 12:43:06 -0400 Date: Thu, 20 Aug 2009 09:43:04 -0700 From: Nathan Froyd Subject: Re: [Qemu-devel] [PATCH] i386-linux-user NPTL support Message-ID: <20090820164304.GP29075@codesourcery.com> References: <1250785143-24969-1-git-send-email-uli@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1250785143-24969-1-git-send-email-uli@suse.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ulrich Hecht Cc: Riku Voipio , qemu-devel@nongnu.org On Thu, Aug 20, 2009 at 06:19:03PM +0200, Ulrich Hecht wrote: > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > - 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 > + } Why not just stick things in cpu_set_tls in target-i386/cpu.h like so: #if defined(TARGET-I386) && defined(TARGET_ABI32) static inline void cpu_set_tls(CPUState *env, target_ulong newtls) { do_set_thread_area(env, newtls); cpu_x86_load_seg(env, R_GS, env->segs[R_GS].selector); } #endif Less duplicated code and fewer #ifdefs that way and it's still clear that x86-64 linux-user emulation doesn't support NPTL. -Nathan