From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O7CUM-00079W-Bm for qemu-devel@nongnu.org; Wed, 28 Apr 2010 15:00:03 -0400 Received: from [140.186.70.92] (port=42202 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O7CUF-00067F-Ta for qemu-devel@nongnu.org; Wed, 28 Apr 2010 14:59:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O7CRC-0008SH-FC for qemu-devel@nongnu.org; Wed, 28 Apr 2010 14:56:47 -0400 Received: from are.twiddle.net ([75.149.56.221]:34889) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O7CRC-0008S6-98 for qemu-devel@nongnu.org; Wed, 28 Apr 2010 14:56:46 -0400 Message-ID: <4BD884EC.3060403@twiddle.net> Date: Wed, 28 Apr 2010 11:56:44 -0700 From: Richard Henderson MIME-Version: 1.0 Subject: Re: [Qemu-devel] NPTL user mode fixes References: <015e01cae594$3de6d920$b9b48b60$@ucsc.edu> In-Reply-To: <015e01cae594$3de6d920$b9b48b60$@ucsc.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Munday Cc: qemu-devel@nongnu.org On 04/26/2010 04:00 PM, David Munday wrote: > I starting to work with qemu to enable NPTL dependent binaries to run in > user mode. I see that currently NPTL is not supported for SPARC or x86. > > What is still left to do for NPTL support? The thing that's missing to enable the compile with NPTL is cpu_set_tls. For Sparc I believe this is merely an assignment to %g7. For x86, you need to arrange for a call to do_set_thread_area, which is currently private to linux-user/syscall.c. However, the other thing that will need to be fixed is that neither port implements its atomic operations atomically -- the implementations merely assume that only one thread is active. See do_store_exclusive in linux-user/main.c for how several ports handle their atomic operations. It'll be a bit different for Sparc singe it has LDSTUB and SWAP as well as CAS. It'll be lots different for x86, since quite a few read-modify-write operations can be made atomic by use of the LOCK prefix (this could be quite an undertaking, actually). r~