All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Richard Henderson <rth@twiddle.net>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Torvald Riegel <triegel@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Andrew Haley <aph@redhat.com>, Liu Ping Fan <qemulist@gmail.com>,
	qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v3 1/2] add a header file for atomic operations
Date: Wed, 19 Jun 2013 18:42:47 +0200	[thread overview]
Message-ID: <51C1DF87.8090704@redhat.com> (raw)
In-Reply-To: <51C1DE62.9090308@twiddle.net>

Il 19/06/2013 18:37, Richard Henderson ha scritto:
>> > +#ifndef atomic_read
>> > +#define atomic_read(ptr)       (*(__typeof__(*ptr) *volatile) (ptr))
>> >  #endif
>> >  
>> > +#ifndef atomic_set
>> > +#define atomic_set(ptr, i)     ((*(__typeof__(*ptr) *volatile) (ptr)) = (i))
>> > +#endif
> I still think these should be enhanced to reject operations larger
> than word-size, so that we don't accidentally introduce bugs for our
> 32-bit hosts.  But that can be done as a follow-up.

Oops, forgot about that (and also using relaxed instead of volatile).

Will do as a follow-up.  Thanks!

Paolo

> Otherwise, everything looks consistent now.
> 
> Reviewed-by: Richard Henderson <rth@twiddle.net>

  reply	other threads:[~2013-06-19 16:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-19 20:59 [Qemu-devel] [PATCH v3 0/2] QEMUBH: make AioContext's bh re-entrant Liu Ping Fan
2013-06-19 20:59 ` [Qemu-devel] [PATCH v3 1/2] add a header file for atomic operations Liu Ping Fan
2013-06-19 16:37   ` Richard Henderson
2013-06-19 16:42     ` Paolo Bonzini [this message]
2013-06-19 20:39   ` Torvald Riegel
2013-06-19 20:44     ` Richard Henderson
2013-06-20  8:03       ` Paolo Bonzini
2013-06-19 20:59 ` [Qemu-devel] [PATCH v3 2/2] QEMUBH: make AioContext's bh re-entrant Liu Ping Fan
2013-06-20  7:39   ` Stefan Hajnoczi
2013-06-20  8:16     ` Paolo Bonzini
2013-06-20  9:12       ` liu ping fan
2013-06-20  9:19         ` Paolo Bonzini
2013-06-20  9:41       ` liu ping fan
2013-06-20  9:45         ` Paolo Bonzini
2013-06-21  4:35           ` liu ping fan

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=51C1DF87.8090704@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=aph@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemulist@gmail.com \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.com \
    --cc=triegel@redhat.com \
    /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.