On 16/10/2018 18:40, Emilio G. Cota wrote:
>> +#define SMP_CACHE_BYTES      64
>> +#define ____cacheline_aligned_in_smp \
>> +        __attribute__((__aligned__(SMP_CACHE_BYTES)))
> You could use QEMU_ALIGNED() here.
> 
>> +
>> +#define WRITE_ONCE(ptr, val) \
>> +    (*((volatile typeof(ptr) *)(&(ptr))) = (val))
>> +#define READ_ONCE(ptr) (*((volatile typeof(ptr) *)(&(ptr))))
> Why not atomic_read/set, like in the rest of the QEMU code base?

Or even atomic_rcu_read/atomic_rcu_set, which includes the necessary
barriers.

Also, please do not use __ identifiers in QEMU code.
____cacheline_aligned_in_smp can become just QEMU_ALIGNED(SMP_CACHE_BYTES).

Paolo

Reply via email to