Re: [Qemu-devel] [PATCH v2 2/3] atomics: emit an smp_read_barrier_depends() barrier only for Sparc and Thread Sanitizer

2016-05-25 Thread Emilio G. Cota
On Wed, May 25, 2016 at 14:16:56 +0200, Paolo Bonzini wrote: > On 24/05/2016 22:06, Emilio G. Cota wrote: > > For correctness, smp_read_barrier_depends() is only required to > > emit a barrier on Sparc hosts. However, we are currently emitting > > a consume fence unconditionally. > > Let's say

Re: [Qemu-devel] [PATCH v2 2/3] atomics: emit an smp_read_barrier_depends() barrier only for Sparc and Thread Sanitizer

2016-05-25 Thread Paolo Bonzini
On 24/05/2016 22:06, Emilio G. Cota wrote: > For correctness, smp_read_barrier_depends() is only required to > emit a barrier on Sparc hosts. However, we are currently emitting > a consume fence unconditionally. Let's say why this is suboptimal: ... and most compilers currently treat consume

Re: [Qemu-devel] [PATCH v2 2/3] atomics: emit an smp_read_barrier_depends() barrier only for Sparc and Thread Sanitizer

2016-05-24 Thread Emilio G. Cota
On Tue, May 24, 2016 at 23:09:47 +0300, Sergey Fedorov wrote: > On 24/05/16 23:06, Emilio G. Cota wrote: > > For correctness, smp_read_barrier_depends() is only required to > > emit a barrier on Sparc hosts. However, we are currently emitting > > a consume fence unconditionally. > > > > Fix it by

Re: [Qemu-devel] [PATCH v2 2/3] atomics: emit an smp_read_barrier_depends() barrier only for Sparc and Thread Sanitizer

2016-05-24 Thread Sergey Fedorov
On 24/05/16 23:06, Emilio G. Cota wrote: > For correctness, smp_read_barrier_depends() is only required to > emit a barrier on Sparc hosts. However, we are currently emitting > a consume fence unconditionally. > > Fix it by keeping the consume fence if we're compiling with Thread > Sanitizer,

[Qemu-devel] [PATCH v2 2/3] atomics: emit an smp_read_barrier_depends() barrier only for Sparc and Thread Sanitizer

2016-05-24 Thread Emilio G. Cota
For correctness, smp_read_barrier_depends() is only required to emit a barrier on Sparc hosts. However, we are currently emitting a consume fence unconditionally. Fix it by keeping the consume fence if we're compiling with Thread Sanitizer, since this might help prevent false warnings. Otherwise,