All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH-RFC 0/3] qemu: memory barriers in virtio
Date: Tue, 22 Dec 2009 22:58:16 +0000	[thread overview]
Message-ID: <200912222258.16458.paul@codesourcery.com> (raw)
In-Reply-To: <20091222163437.GE18676@redhat.com>

> > Given this is supposed to be portable code, I wonder if we should have
> > atomic ordered memory accessors instead.
> >
> > Paul
> 
> Could you clarify please?
> 
> The infiniband bits I used as base are very portable,
> I know they build on a ton of platforms. I just stripped
> a couple of infiniband specific assumptions from there.
> 
> Do you suggest we use __sync_synchronize?
> Unfortunately this is broken or slow on many platforms.
> I do use it when it seems safe or when we see a platform
> we don't know about.

I mean have a single function that does both the atomic load/store and the 
memory barrier. Instead of:

  stw_phys(addr, val)
  barrier();

We do:

  stw_phys_barrier(addr, val).

This avoids issues in the future (multithreaded TCG) where atomic memory 
accesses may be nontrivial.

Paul

  reply	other threads:[~2009-12-22 22:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-08 16:18 [Qemu-devel] [PATCH-RFC 0/3] qemu: memory barriers in virtio Michael S. Tsirkin
2009-12-22 11:26 ` [Qemu-devel] " Michael S. Tsirkin
2009-12-22 14:51   ` Anthony Liguori
2009-12-22 16:25     ` Paul Brook
2009-12-22 16:34       ` Michael S. Tsirkin
2009-12-22 22:58         ` Paul Brook [this message]
2009-12-22 17:28       ` Avi Kivity
     [not found] ` <200912231704.19449.rusty@rustcorp.com.au>
     [not found]   ` <20091223163600.GD6588@redhat.com>
2010-01-04  2:07     ` Rusty Russell

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=200912222258.16458.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rusty@rustcorp.com.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.