qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 0/7] NPTL support for PPC, v2


From: Nathan Froyd
Subject: [Qemu-devel] [PATCH 0/7] NPTL support for PPC, v2
Date: Mon, 3 Aug 2009 08:43:22 -0700

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.

malc asked me to compare the approach taken in this patch series versus
an mprotect-based approach.  I did so, and found that there was no
difference between the two and that this approach was faster (no
surprise).

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

This is an update to the patch series I sent a month or so ago; the
changes are rather trivial: a formatting fix or two and a fix for a
ppc64 compilation error.

-Nathan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]