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 a...@linux.intel.com 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 ...

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

2014-11-17 Thread Andi Kleen
Andi Kleen a...@firstfloor.org writes: Ping^2! Andi Kleen a...@firstfloor.org writes: Ping! From: Andi Kleen a...@linux.intel.com xbegin/xend/xabort were missing memory barriers. This can lead to memory operations being moved out of transactions, which would cause unexpected races.

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 a...@linux.intel.com 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

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

2014-11-17 Thread Andi Kleen
H.J. Lu hjl.to...@gmail.com writes: On Wed, Oct 29, 2014 at 11:07 PM, Andi Kleen a...@linux.intel.com 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

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 a...@firstfloor.org wrote: H.J. Lu hjl.to...@gmail.com writes: On Wed, Oct 29, 2014 at 11:07 PM, Andi Kleen a...@linux.intel.com wrote: Hmm, can't the insns themselves properly clobber/use memory? The transactions don't really use the memory.

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

2014-11-10 Thread Andi Kleen
Andi Kleen a...@firstfloor.org writes: Ping! From: Andi Kleen a...@linux.intel.com 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

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

2014-10-30 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

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 a...@firstfloor.org wrote: From: Andi Kleen a...@linux.intel.com 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

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

2014-10-28 Thread Andi Kleen
From: Andi Kleen a...@linux.intel.com 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 versions always