qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: qemu-devel@nongnu.org
Cc: Paul Brook <paul@codesourcery.com>
Subject: Re: [Qemu-devel] [PATCH]ish NPTL support.
Date: Thu, 14 Dec 2006 02:16:23 +0000	[thread overview]
Message-ID: <20061214021623.GA3597@mail.shareable.org> (raw)
In-Reply-To: <1166032256.5253.766.camel@pmac.infradead.org>

David Woodhouse wrote:
> - sys_futex():
> 
> We have to translate these into calls to the host's sys_futex() anyway.

I don't think it's necessary to translate to the host's sys_futex(),
unless the guest will be doing futex operations on memory which the
host _also_ does futex operations on.

CLONE_CHILD_CLEARTID is one of those, if it's simply relayed to the host.
So are locks in shared memory, if they are to work between host and
guest processes.  But I guess they are not expected to work.

The atomicity, queueing etc. semantics, provided they are only among
threads of a single qemu process, can be guaranteed using normal
pthreads locking and atomic operations, analogous to the way the host
kernel maps futex calls to its own waitqueues, semaphores, and atomic
ops.

However, it is probably easier to use the host's, than to write the
equivalent (basically duplicating the kernel's futex code in qemu, the
hashed locks and wait queues etc.).

On the other hand, using the host's makes it hard to run Linux guest
binaries on non-Linux hosts (those which don't have futex), or newer
Linux guest binaries on older Linux hosts which have fewer futex ops,
or none at all.

-- Jamie

  parent reply	other threads:[~2006-12-14  2:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-09 22:38 [Qemu-devel] [PATCH]ish NPTL support David Woodhouse
2006-12-13 16:02 ` Mulyadi Santosa
2006-12-13 17:01   ` David Woodhouse
2006-12-13 17:22     ` Paul Brook
2006-12-13 17:32       ` David Woodhouse
2006-12-13 17:42         ` Paul Brook
2006-12-13 17:50           ` David Woodhouse
2006-12-13 18:07             ` Paul Brook
2006-12-13 18:44               ` Fabrice Bellard
2006-12-14  2:16             ` Jamie Lokier [this message]
2006-12-16 13:26               ` David Woodhouse
2006-12-16 15:17                 ` Paul Brook
2006-12-16 18:48                 ` Jamie Lokier
2006-12-13 17:35     ` Thiemo Seufer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061214021623.GA3597@mail.shareable.org \
    --to=jamie@shareable.org \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).