qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] rcutorture: fix compilation on 32-bit ppc


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] rcutorture: fix compilation on 32-bit ppc
Date: Mon, 23 Mar 2015 13:09:56 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0


On 21/03/2015 16:44, Peter Maydell wrote:
> On 21 March 2015 at 15:34, Paolo Bonzini <address@hidden> 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 via email to

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