Re: [PATCH 1/8] qatomic: add smp_mb__before/after_rmw()

2023-03-06 Thread David Hildenbrand
On 06.03.23 14:21, David Hildenbrand wrote: On 03.03.23 18:19, Paolo Bonzini wrote: On ARM, seqcst loads and stores (which QEMU does not use) are compiled respectively as LDAR and STLR instructions. Even though STLR is also used for store-release operations, STLR followed by LDAR provides store

Re: [PATCH 1/8] qatomic: add smp_mb__before/after_rmw()

2023-03-06 Thread David Hildenbrand
On 03.03.23 18:19, Paolo Bonzini wrote: On ARM, seqcst loads and stores (which QEMU does not use) are compiled respectively as LDAR and STLR instructions. Even though STLR is also used for store-release operations, STLR followed by LDAR provides store-against-load ordering, which is stronger tha

Re: [PATCH 1/8] qatomic: add smp_mb__before/after_rmw()

2023-03-05 Thread Paolo Bonzini
Il dom 5 mar 2023, 19:57 Richard Henderson ha scritto: > On 3/3/23 09:19, Paolo Bonzini wrote: > > This nasty difference between Linux and C11 read-modify-write operations > > has already caused issues in util/async.c and more are being found. > > Provide something similar to Linux smp_mb__before

Re: [PATCH 1/8] qatomic: add smp_mb__before/after_rmw()

2023-03-05 Thread Richard Henderson
On 3/3/23 09:19, Paolo Bonzini wrote: This nasty difference between Linux and C11 read-modify-write operations has already caused issues in util/async.c and more are being found. Provide something similar to Linux smp_mb__before/after_atomic(); this has the double function of documenting clearly

[PATCH 1/8] qatomic: add smp_mb__before/after_rmw()

2023-03-03 Thread Paolo Bonzini
On ARM, seqcst loads and stores (which QEMU does not use) are compiled respectively as LDAR and STLR instructions. Even though STLR is also used for store-release operations, STLR followed by LDAR provides store-against-load ordering, which is stronger than a store-release. Compare this to ARMv7,