qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/7] target-ppc/linux-user: NPTL support
@ 2009-06-04 18:51 Nathan Froyd
  2009-06-04 18:51 ` [Qemu-devel] [PATCH 1/7] linux-user: initialize mmap_mutex properly Nathan Froyd
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Nathan Froyd @ 2009-06-04 18:51 UTC (permalink / raw)
  To: qemu-devel

This patch series adds NPTL support in Linux user-mode emulation to
32-bit PowerPC targets.

The main complication comes from implementing atomic instructions
properly.  We chose to implement a simplistic model:

- reserved loads record the value loaded;

- conditional stores check that the memory at the effective address
  contains the value loaded by the previous reserved load, in addition
  to all other checks.  if so, the store succeeds; otherwise, it fails.

It is possible to implement something more sophisticated using mprotect:

- reserved loads write-protect the page from which the value is loaded;

- regular stores to the page (through SIGSEGV handling) remove the write
  protection (which is roughly how the architecture really works);

- conditional stores fail if the page was not write-protected, in
  addition to all other checks.  If the store succeeds, then the page is
  unprotected.

but the simple scheme works well enough and should be somewhat faster.
The simple scheme is what's already done for system mode, too; it's even
slightly dumber in system mode because we don't check for equality of
values.

The patch series has been tested against the glibc testsuite, where it
passes a good chunk (90%+) of the testsuite.  The other 10% are
basically things that are not going to work in QEMU anytime soon
(e.g. sharing futexes between multiple processes, using clone(2)
directly, etc.).  I should note that proper testing requires a patch to
use a correct exit status for uncaught signals; such a patch has been
posted to this list before by Riku Voipio.  (I have a different local
version that I used instead.)  Testing with recent glibc also requires
adding support for private futexes and a few other futex operations;
again, a patch for this has been posted by Riku and I used a slightly
different local version.

-Nathan

Nathan Froyd (7):
  linux-user: initialize mmap_mutex properly
  target-ppc: fix cpu_clone_regs
  target-ppc: add cpu_set_tls
  target-ppc: retain l{w,d}arx loaded value
  target-ppc: add exceptions for conditional stores
  linux-user: handle POWERPC_EXCP_STCX
  enable NPTL for ppc-linux-user targets in configure

 configure              |    2 +
 linux-user/main.c      |   68 ++++++++++++++++++++++++++++++++++++++
 linux-user/mmap.c      |    2 +-
 target-ppc/cpu.h       |   24 +++++++++++--
 target-ppc/helper.c    |    2 +-
 target-ppc/machine.c   |    4 +-
 target-ppc/op_helper.c |    4 +-
 target-ppc/translate.c |   84 ++++++++++++++++++++++++++++++++++--------------
 8 files changed, 156 insertions(+), 34 deletions(-)

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2009-07-06 15:29 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-04 18:51 [Qemu-devel] [PATCH 0/7] target-ppc/linux-user: NPTL support Nathan Froyd
2009-06-04 18:51 ` [Qemu-devel] [PATCH 1/7] linux-user: initialize mmap_mutex properly Nathan Froyd
2009-06-04 18:51 ` [Qemu-devel] [PATCH 2/7] target-ppc: fix cpu_clone_regs Nathan Froyd
2009-06-04 18:51 ` [Qemu-devel] [PATCH 3/7] target-ppc: add cpu_set_tls Nathan Froyd
2009-06-04 18:51 ` [Qemu-devel] [PATCH 4/7] target-ppc: retain l{w,d}arx loaded value Nathan Froyd
2009-06-10 15:59   ` Riku Voipio
2009-06-04 18:52 ` [Qemu-devel] [PATCH 5/7] target-ppc: add exceptions for conditional stores Nathan Froyd
2009-06-04 18:52 ` [Qemu-devel] [PATCH 6/7] linux-user: handle POWERPC_EXCP_STCX Nathan Froyd
2009-06-04 18:52 ` [Qemu-devel] [PATCH 7/7] enable NPTL for ppc-linux-user targets in configure Nathan Froyd
2009-06-05 23:04 ` [Qemu-devel] [PATCH 0/7] target-ppc/linux-user: NPTL support malc
2009-06-06  2:56   ` Paul Brook
2009-07-06 15:28   ` Nathan Froyd
2009-06-09 23:37 ` Miklos Vajna
2009-06-10  0:24   ` Daniel Jacobowitz
2009-06-10  0:30     ` Miklos Vajna
2009-06-10  2:49       ` Daniel Jacobowitz
2009-06-10  9:31         ` Miklos Vajna
2009-06-10  0:57   ` Laurent Vivier
2009-06-10  9:28     ` Miklos Vajna

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).