Re: [Qemu-devel] [PATCH 1/6] qsp: drop atomics when using the seqlock

2018-09-11 Thread Paolo Bonzini
On 10/09/2018 17:44, Emilio G. Cota wrote: > On Mon, Sep 10, 2018 at 01:32:15 +0200, Paolo Bonzini wrote: >> On 03/09/2018 19:18, Emilio G. Cota wrote: >>> Using atomics here is a mistake since they're not guaranteed >>> to compile. >> >> But isn't it technically a C11 data race if you don't use at

Re: [Qemu-devel] [PATCH 1/6] qsp: drop atomics when using the seqlock

2018-09-10 Thread Emilio G. Cota
On Mon, Sep 10, 2018 at 01:32:15 +0200, Paolo Bonzini wrote: > On 03/09/2018 19:18, Emilio G. Cota wrote: > > Using atomics here is a mistake since they're not guaranteed > > to compile. > > But isn't it technically a C11 data race if you don't use atomics? Yes, it's undefined behaviour. > Could

Re: [Qemu-devel] [PATCH 1/6] qsp: drop atomics when using the seqlock

2018-09-09 Thread Paolo Bonzini
On 03/09/2018 19:18, Emilio G. Cota wrote: > Using atomics here is a mistake since they're not guaranteed > to compile. But isn't it technically a C11 data race if you don't use atomics? Could we make nocheck read/set degrade to just a volatile access when used on a variable that is bigger than po