From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kd9Pd-0008KU-Tj for qemu-devel@nongnu.org; Tue, 09 Sep 2008 16:02:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kd9Pc-0008Jo-BA for qemu-devel@nongnu.org; Tue, 09 Sep 2008 16:02:09 -0400 Received: from [199.232.76.173] (port=36982 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kd9Pc-0008Jj-6A for qemu-devel@nongnu.org; Tue, 09 Sep 2008 16:02:08 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:41906) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kd9Pb-00037R-9X for qemu-devel@nongnu.org; Tue, 09 Sep 2008 16:02:07 -0400 From: Paul Brook Subject: Re: [Qemu-devel] user emulation status? Date: Tue, 9 Sep 2008 21:01:59 +0100 References: <48C43986.3030903@wpkg.org> <20080909183443.GH4829@genesis.frugalware.org> <48C6D16C.1080102@5etech.eu> In-Reply-To: <48C6D16C.1080102@5etech.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200809092102.00238.paul@codesourcery.com> 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 Cc: Martin Mohring > > AFAIK NPTL only works fine only on ARM ATM. > > The guys porting BSD user mode told us that was astonished that syscall > handling in linux does not use common code. Now I am a bit stonished > too. Are things like syscalls and even more nptl not handled in common > code? Or is the non common code just not implemented? The kenrel/userspace interface for NPTL is actually very small. There's a few extra arguments to clone, TLS register handling and synchronization primitives. The clone arguments are pretty much the same on all architectures. Variations tend to be minor tweaks to do with passing a large number of arguments to a syscall. Pretty much every architecture has its own mechanism for providing a TLS register. Some have dedicated hardware registers for this purpose, others use a variety of tricks to provide the value. qemu needs to support this before even single threaded NPTL applications will work. Synchronisation primitives operations come in two halves. futex syscalls which are the same on all targets, and atomic operations which are different for each architecture. To make multithreaded applications work you need to ensure these atomic operations actually appear atomic. Paul