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

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

2018-09-03 Thread Emilio G. Cota
Using atomics here is a mistake since they're not guaranteed to compile. Signed-off-by: Emilio G. Cota --- util/qsp.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/util/qsp.c b/util/qsp.c index b0c2575d10..a1ee03b84b 100644 --- a/util/qsp.c +++ b/util/qsp.