Re: [PATCH] tile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT

2013-09-30 Thread Chris Metcalf
On 9/30/2013 5:45 AM, Will Deacon wrote: > On Fri, Sep 27, 2013 at 09:13:15PM +0100, Chris Metcalf wrote: >> On 9/26/2013 1:57 PM, Will Deacon wrote: >>> Hi Chris, >>> >>> On Thu, Sep 26, 2013 at 06:24:53PM +0100, Chris Metcalf wrote: [...] +static inline unsigned long

Re: [PATCH] tile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT

2013-09-30 Thread Will Deacon
On Fri, Sep 27, 2013 at 09:13:15PM +0100, Chris Metcalf wrote: > On 9/26/2013 1:57 PM, Will Deacon wrote: > > Hi Chris, > > > > On Thu, Sep 26, 2013 at 06:24:53PM +0100, Chris Metcalf wrote: > >> [...] > >> +static inline unsigned long __my_cpu_offset(void) > >> +{ > >> + unsigned long tp; > >> +

Re: [PATCH] tile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT

2013-09-30 Thread Will Deacon
On Fri, Sep 27, 2013 at 09:13:15PM +0100, Chris Metcalf wrote: On 9/26/2013 1:57 PM, Will Deacon wrote: Hi Chris, On Thu, Sep 26, 2013 at 06:24:53PM +0100, Chris Metcalf wrote: [...] +static inline unsigned long __my_cpu_offset(void) +{ + unsigned long tp; + register unsigned

Re: [PATCH] tile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT

2013-09-30 Thread Chris Metcalf
On 9/30/2013 5:45 AM, Will Deacon wrote: On Fri, Sep 27, 2013 at 09:13:15PM +0100, Chris Metcalf wrote: On 9/26/2013 1:57 PM, Will Deacon wrote: Hi Chris, On Thu, Sep 26, 2013 at 06:24:53PM +0100, Chris Metcalf wrote: [...] +static inline unsigned long __my_cpu_offset(void) +{ + unsigned

Re: [PATCH] tile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT

2013-09-27 Thread Chris Metcalf
On 9/26/2013 1:57 PM, Will Deacon wrote: > Hi Chris, > > On Thu, Sep 26, 2013 at 06:24:53PM +0100, Chris Metcalf wrote: >> [...] >> +static inline unsigned long __my_cpu_offset(void) >> +{ >> +unsigned long tp; >> +register unsigned long *sp asm("sp"); >> +asm("move %0, tp" : "=r" (tp)

Re: [PATCH] tile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT

2013-09-27 Thread Chris Metcalf
On 9/26/2013 1:57 PM, Will Deacon wrote: Hi Chris, On Thu, Sep 26, 2013 at 06:24:53PM +0100, Chris Metcalf wrote: [...] +static inline unsigned long __my_cpu_offset(void) +{ +unsigned long tp; +register unsigned long *sp asm(sp); +asm(move %0, tp : =r (tp) : m (*sp)); +

Re: [PATCH] tile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT

2013-09-26 Thread Will Deacon
Hi Chris, On Thu, Sep 26, 2013 at 06:24:53PM +0100, Chris Metcalf wrote: > It turns out the kernel relies on barrier() to force a reload of the > percpu offset value. Since we can't easily modify the definition of > barrier() to include "tp" as an output register, we instead provide a >

[PATCH] tile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT

2013-09-26 Thread Chris Metcalf
It turns out the kernel relies on barrier() to force a reload of the percpu offset value. Since we can't easily modify the definition of barrier() to include "tp" as an output register, we instead provide a definition of __my_cpu_offset as extended assembly that includes a fake stack read to

[PATCH] tile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT

2013-09-26 Thread Chris Metcalf
It turns out the kernel relies on barrier() to force a reload of the percpu offset value. Since we can't easily modify the definition of barrier() to include tp as an output register, we instead provide a definition of __my_cpu_offset as extended assembly that includes a fake stack read to hazard

Re: [PATCH] tile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT

2013-09-26 Thread Will Deacon
Hi Chris, On Thu, Sep 26, 2013 at 06:24:53PM +0100, Chris Metcalf wrote: It turns out the kernel relies on barrier() to force a reload of the percpu offset value. Since we can't easily modify the definition of barrier() to include tp as an output register, we instead provide a definition of