Re: [Qemu-devel] [PATCH 2/5] cpus: use atomic_read to read seqlock-protected variables

2016-10-13 Thread Paolo Bonzini
> Is tsan happy with the way seqlocks are written right now? I honestly don't know. But if there are tsan bugs there's not much we can do. The alternative below has overhead on ARM and PPC and does not quite fit in atomic.h. In any case, a bigger issue is that this patch breaks on 32-bit

Re: [Qemu-devel] [PATCH 2/5] cpus: use atomic_read to read seqlock-protected variables

2016-10-13 Thread Emilio G. Cota
On Mon, Oct 10, 2016 at 15:59:04 +0200, Paolo Bonzini wrote: > There is a data race if the variable is written concurrently to the > read. In C11 this has undefined behavior. Use atomic_read. The > write side does not need atomic_set, because it is protected by a > mutex. Is tsan happy with

Re: [Qemu-devel] [PATCH 2/5] cpus: use atomic_read to read seqlock-protected variables

2016-10-12 Thread Alex Bennée
Paolo Bonzini writes: > There is a data race if the variable is written concurrently to the > read. In C11 this has undefined behavior. Use atomic_read. The > write side does not need atomic_set, because it is protected by a > mutex. > > Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 2/5] cpus: use atomic_read to read seqlock-protected variables

2016-10-10 Thread Paolo Bonzini
There is a data race if the variable is written concurrently to the read. In C11 this has undefined behavior. Use atomic_read. The write side does not need atomic_set, because it is protected by a mutex. Signed-off-by: Paolo Bonzini --- cpus.c | 9 + 1 file