Re: [Qemu-devel] [RFC PATCH V3] Use atomic cmpxchg to atomically check the exclusive value in a STREX

2015-06-19 Thread Mark Burton
> On 19 Jun 2015, at 09:42, Paolo Bonzini wrote: > > > > On 19/06/2015 09:40, Mark Burton wrote: >>> On 19/06/2015 09:29, Mark Burton wrote: Does anybody know if the current atomic_cmpxchg will support 64 bit on a (normal) 32 bit x86, or do we need to special case that with cmpx

Re: [Qemu-devel] [RFC PATCH V3] Use atomic cmpxchg to atomically check the exclusive value in a STREX

2015-06-19 Thread Paolo Bonzini
On 19/06/2015 09:40, Mark Burton wrote: >> On 19/06/2015 09:29, Mark Burton wrote: >>> Does anybody know if the current atomic_cmpxchg will support >>> 64 bit on a (normal) 32 bit x86, or do we need to special >>> case that with cmpxchg8b ? (I get the impression that it will >>> automatically use

Re: [Qemu-devel] [RFC PATCH V3] Use atomic cmpxchg to atomically check the exclusive value in a STREX

2015-06-19 Thread Mark Burton
> On 19 Jun 2015, at 09:31, Paolo Bonzini wrote: > > > > On 19/06/2015 09:29, Mark Burton wrote: >> Does anybody know if the current atomic_cmpxchg will support 64 bit >> on a (normal) 32 bit x86, or do we need to special case that with >> cmpxchg8b ? (I get the impression that it will automat

Re: [Qemu-devel] [RFC PATCH V3] Use atomic cmpxchg to atomically check the exclusive value in a STREX

2015-06-19 Thread Paolo Bonzini
On 19/06/2015 09:29, Mark Burton wrote: > Does anybody know if the current atomic_cmpxchg will support 64 bit > on a (normal) 32 bit x86, or do we need to special case that with > cmpxchg8b ? (I get the impression that it will automatically use > cmpxchg8b, but not cmpxchg16b - but I’m by no mean

Re: [Qemu-devel] [RFC PATCH V3] Use atomic cmpxchg to atomically check the exclusive value in a STREX

2015-06-19 Thread Mark Burton
> On 18 Jun 2015, at 21:53, Peter Maydell wrote: > > On 18 June 2015 at 19:32, Mark Burton wrote: >> for the 1<> a little worrying - I’ll check. >> >>> On 18 Jun 2015, at 17:56, Peter Maydell wrote: >>> >>> On 18 June 2015 at 16:44, wrote: +uint64_t oldval, *p; +p

Re: [Qemu-devel] [RFC PATCH V3] Use atomic cmpxchg to atomically check the exclusive value in a STREX

2015-06-18 Thread Peter Maydell
On 18 June 2015 at 19:32, Mark Burton wrote: > for the 1< little worrying - I’ll check. > >> On 18 Jun 2015, at 17:56, Peter Maydell wrote: >> >> On 18 June 2015 at 16:44, wrote: >>> +uint64_t oldval, *p; >>> +p = address_space_map(cs->as, paddr, &len, true); >>> +if (le

Re: [Qemu-devel] [RFC PATCH V3] Use atomic cmpxchg to atomically check the exclusive value in a STREX

2015-06-18 Thread Mark Burton
for the 1< On 18 Jun 2015, at 17:56, Peter Maydell wrote: > > On 18 June 2015 at 16:44, wrote: >> +uint64_t oldval, *p; >> +p = address_space_map(cs->as, paddr, &len, true); >> +if (len == 8 << size) { >> +oldval = (uint64_t)env->exclusive_val; >> +

Re: [Qemu-devel] [RFC PATCH V3] Use atomic cmpxchg to atomically check the exclusive value in a STREX

2015-06-18 Thread Peter Maydell
On 18 June 2015 at 16:44, wrote: > +uint64_t oldval, *p; > +p = address_space_map(cs->as, paddr, &len, true); > +if (len == 8 << size) { > +oldval = (uint64_t)env->exclusive_val; > +result = (atomic_cmpxchg(p, oldval, (uint64_t)newval) == oldval);

Re: [Qemu-devel] [RFC PATCH V3] Use atomic cmpxchg to atomically check the exclusive value in a STREX

2015-06-18 Thread Paolo Bonzini
On 18/06/2015 17:44, fred.kon...@greensocs.com wrote: > +hwaddr len = 8 << size; Should be 1 << size, and likewise below in the "if". Paolo > +hwaddr paddr; > +target_ulong page_size; > +int prot; > + > +arm_exclusive_lock(); > + > +if (env->exclusive_addr != addr) { >

[Qemu-devel] [RFC PATCH V3] Use atomic cmpxchg to atomically check the exclusive value in a STREX

2015-06-18 Thread fred . konrad
From: KONRAD Frederic This mechanism replaces the existing load/store exclusive mechanism which seems to be broken for multithread. It follows the intention of the existing mechanism and stores the target address and data values during a load operation and checks that they remain unchanged before