On 20/03/2017 16:34, Alex Bennée wrote: > static inline void tlb_set_dirty1(CPUTLBEntry *tlb_entry, target_ulong vaddr) > { > +#if TCG_OVERSIZED_GUEST > if (tlb_entry->addr_write == (vaddr | TLB_NOTDIRTY)) { > tlb_entry->addr_write = vaddr; > } > +#else > + uintptr_t orig_addr = atomic_mb_read(&tlb_entry->addr_write);
atomic_read is enough, since we don't care at all about cases where the address doesn't match. Otherwise Reviewed-by: Paolo Bonzini <pbonz...@redhat.com> Paolo > + if (orig_addr == (vaddr | TLB_NOTDIRTY)) { > + atomic_cmpxchg(&tlb_entry->addr_write, orig_addr, vaddr); > + } > +#endif > }