Re: [PATCH] Add memory barriers to xbegin/xend/xabort

2014-11-18 Thread Richard Henderson
On 10/29/2014 04:31 AM, Andi Kleen wrote: > 2014-10-28 Andi Kleen > > PR target/63672 > * config/i386/i386.c (ix86_expand_builtin): Generate memory > barrier after abort. > * config/i386/i386.md (xbegin): Add memory barrier. > (xend): Rename to ... > (xend_1)

Re: [PATCH] Add memory barriers to xbegin/xend/xabort

2014-11-17 Thread H.J. Lu
On Mon, Nov 17, 2014 at 12:36 PM, Andi Kleen wrote: > "H.J. Lu" writes: > >> On Wed, Oct 29, 2014 at 11:07 PM, Andi Kleen wrote: Hmm, can't the insns themselves properly clobber/use memory? >>> >>> The transactions don't really use the memory. They just guard it, >>> like a lock. >>> >

Re: [PATCH] Add memory barriers to xbegin/xend/xabort

2014-11-17 Thread Andi Kleen
"H.J. Lu" writes: > On Wed, Oct 29, 2014 at 11:07 PM, Andi Kleen wrote: >>> >>> Hmm, can't the insns themselves properly clobber/use memory? >> >> The transactions don't really use the memory. They just guard it, >> like a lock. >> >> So the intrinsic doesn't know what memory is used inside the

Re: [PATCH] Add memory barriers to xbegin/xend/xabort

2014-11-17 Thread H.J. Lu
On Wed, Oct 29, 2014 at 11:07 PM, Andi Kleen wrote: >> >> Hmm, can't the insns themselves properly clobber/use memory? > > The transactions don't really use the memory. They just guard it, > like a lock. > > So the intrinsic doesn't know what memory is used inside the transaction, > but the access

Re: [PING^2] Re: [PATCH] Add memory barriers to xbegin/xend/xabort

2014-11-17 Thread Andi Kleen
Andi Kleen writes: Ping^2! > Andi Kleen writes: > > Ping! > >> From: Andi Kleen >> >> xbegin/xend/xabort were missing memory barriers. This can >> lead to memory operations being moved out of transactions, which would >> cause unexpected races. >> >> Always generate implicit memory barriers fo

[PING] Re: [PATCH] Add memory barriers to xbegin/xend/xabort

2014-11-10 Thread Andi Kleen
Andi Kleen writes: Ping! > From: Andi Kleen > > xbegin/xend/xabort were missing memory barriers. This can > lead to memory operations being moved out of transactions, which would > cause unexpected races. > > Always generate implicit memory barriers for these intrinsics. > > The compat header v

Re: [PATCH] Add memory barriers to xbegin/xend/xabort

2014-10-29 Thread Andi Kleen
> > Hmm, can't the insns themselves properly clobber/use memory? The transactions don't really use the memory. They just guard it, like a lock. So the intrinsic doesn't know what memory is used inside the transaction, but the accesses still cannot be moved out. I think a barrier is the only sen

Re: [PATCH] Add memory barriers to xbegin/xend/xabort

2014-10-29 Thread Richard Biener
On Wed, Oct 29, 2014 at 4:31 AM, Andi Kleen wrote: > From: Andi Kleen > > xbegin/xend/xabort were missing memory barriers. This can > lead to memory operations being moved out of transactions, which would > cause unexpected races. > > Always generate implicit memory barriers for these intrinsics.