All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH] rcutorture: fix compilation on 32-bit ppc
Date: Mon, 23 Mar 2015 13:09:56 +0100	[thread overview]
Message-ID: <55100294.8040204@redhat.com> (raw)
In-Reply-To: <CAFEAcA8k+isJXAepJo0oD=nSSd49KP12vS2AQWttjn-yEBdQLA@mail.gmail.com>



On 21/03/2015 16:44, Peter Maydell wrote:
> On 21 March 2015 at 15:34, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> 32-bit PPC cannot do atomic operations on long long.  Inside the loops,
>> we are already using local counters that are summed at the end of
>> the run---with one exception in rcu_read_stress_test: fix it to use
>> the same technique.  Then, use a mutex to protect the global counts.
>> Performance does not matter there because every thread will only enter
>> the critical section once.
>>
>> Remaining uses of atomic instructions are for ints or pointers.
> 
> I don't suppose there's a way to make the atomic functions
> enforce that 'not for anything that larger than pointer type',
> is there? It would be nice if this kind of bug caused compile
> failures on all 32-bit systems rather than only ppc-32...

Yes, it should be possible (e.g. with __builtin_choose_expr or with a
statement expression that includes QEMU_BUILD_BUG_ON).

Paolo

  reply	other threads:[~2015-03-23 12:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-21 15:34 [Qemu-devel] [PATCH] rcutorture: fix compilation on 32-bit ppc Paolo Bonzini
2015-03-21 15:44 ` Peter Maydell
2015-03-23 12:09   ` Paolo Bonzini [this message]
2015-03-21 16:42 ` Andreas Färber

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=55100294.8040204@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=peter.maydell@linaro.org \
    --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 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.