Re: [RFC PATCH] ARM64: cmpxchg.h: Clear the exclusive access bit on fail

2015-02-27 Thread Mark Rutland
On Fri, Feb 27, 2015 at 07:15:57PM +, Pranith Kumar wrote: > On Fri, Feb 27, 2015 at 2:08 PM, Mark Rutland wrote: > > On Fri, Feb 27, 2015 at 06:44:19PM +, Pranith Kumar wrote: > >> On Fri, Feb 27, 2015 at 1:33 PM, Catalin Marinas > >> wrote: > >> > It's either badly formatted or I don't

Re: [RFC PATCH] ARM64: cmpxchg.h: Clear the exclusive access bit on fail

2015-02-27 Thread Pranith Kumar
On Fri, Feb 27, 2015 at 2:08 PM, Mark Rutland wrote: > On Fri, Feb 27, 2015 at 06:44:19PM +, Pranith Kumar wrote: >> On Fri, Feb 27, 2015 at 1:33 PM, Catalin Marinas >> wrote: >> > It's either badly formatted or I don't get it. Are the "stxr x1" and >> > "stxr x7" happening on the same CPU (P

Re: [RFC PATCH] ARM64: cmpxchg.h: Clear the exclusive access bit on fail

2015-02-27 Thread Mark Rutland
On Fri, Feb 27, 2015 at 06:44:19PM +, Pranith Kumar wrote: > On Fri, Feb 27, 2015 at 1:33 PM, Catalin Marinas > wrote: > > It's either badly formatted or I don't get it. Are the "stxr x1" and > > "stxr x7" happening on the same CPU (P0)? If yes, that's badly written > > code, not even architec

Re: [RFC PATCH] ARM64: cmpxchg.h: Clear the exclusive access bit on fail

2015-02-27 Thread Pranith Kumar
On Fri, Feb 27, 2015 at 1:33 PM, Catalin Marinas wrote: > It's either badly formatted or I don't get it. Are the "stxr x1" and > "stxr x7" happening on the same CPU (P0)? If yes, that's badly written > code, not even architecturally compliant (you are not allowed other > memory accesses between ld

Re: [RFC PATCH] ARM64: cmpxchg.h: Clear the exclusive access bit on fail

2015-02-27 Thread Catalin Marinas
On Fri, Feb 27, 2015 at 06:25:25PM +, Pranith Kumar wrote: > On Fri, Feb 27, 2015 at 5:06 AM, Will Deacon wrote: > > On Fri, Feb 27, 2015 at 05:46:55AM +, Pranith Kumar wrote: > >> In cmpxchg(), we do a load exclusive on an address and upon a comparison > >> fail, > >> we skip the store e

Re: [RFC PATCH] ARM64: cmpxchg.h: Clear the exclusive access bit on fail

2015-02-27 Thread Pranith Kumar
On Fri, Feb 27, 2015 at 5:06 AM, Will Deacon wrote: > On Fri, Feb 27, 2015 at 05:46:55AM +, Pranith Kumar wrote: >> In cmpxchg(), we do a load exclusive on an address and upon a comparison >> fail, >> we skip the store exclusive instruction. This can result in the exclusive bit >> still set.

Re: [RFC PATCH] ARM64: cmpxchg.h: Clear the exclusive access bit on fail

2015-02-27 Thread Will Deacon
On Fri, Feb 27, 2015 at 05:46:55AM +, Pranith Kumar wrote: > In cmpxchg(), we do a load exclusive on an address and upon a comparison fail, > we skip the store exclusive instruction. This can result in the exclusive bit > still set. If there was a store exclusive after this to the same address,

[RFC PATCH] ARM64: cmpxchg.h: Clear the exclusive access bit on fail

2015-02-26 Thread Pranith Kumar
In cmpxchg(), we do a load exclusive on an address and upon a comparison fail, we skip the store exclusive instruction. This can result in the exclusive bit still set. If there was a store exclusive after this to the same address, that will see the exclusive bit set. This should not happen. We nee