Re: [Qemu-devel] [PATCH v2 4/9] seqlock: use atomic writes for the sequence

2016-09-22 Thread Richard Henderson
On 09/22/2016 03:13 AM, Alex Bennée wrote: From: Paolo Bonzini There is a data race if the sequence is written concurrently to the read. In C11 this has undefined behavior. Use atomic_set; the read side is already using atomic_read. Reported-by: Alex Bennée

Re: [Qemu-devel] [PATCH v2 4/9] seqlock: use atomic writes for the sequence

2016-09-22 Thread Paolo Bonzini
On 22/09/2016 17:38, Richard Henderson wrote: >> diff --git a/include/qemu/seqlock.h b/include/qemu/seqlock.h >> index 2e2be4c..8dee11d 100644 >> --- a/include/qemu/seqlock.h >> +++ b/include/qemu/seqlock.h >> @@ -31,7 +31,7 @@ static inline void seqlock_init(QemuSeqLock *sl) >> /* Lock out

[Qemu-devel] [PATCH v2 4/9] seqlock: use atomic writes for the sequence

2016-09-22 Thread Alex Bennée
From: Paolo Bonzini There is a data race if the sequence is written concurrently to the read. In C11 this has undefined behavior. Use atomic_set; the read side is already using atomic_read. Reported-by: Alex Bennée Signed-off-by: Paolo Bonzini