xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/arm32: __cmpxchg_mb should be marked always_inline
@ 2014-04-03 17:09 Julien Grall
  2014-04-08 14:36 ` Ian Campbell
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Grall @ 2014-04-03 17:09 UTC (permalink / raw)
  To: xen-devel; +Cc: stefano.stabellini, Julien Grall, tim, ian.campbell

Currently __cmpxchg_mb is only marked inline. The compiler can decide to not
inline this function. In this case, the call to __cmpxchg will be inlined
but not optimised. This will result linking failure because of __bad_cmpxchg.

Catched by clang 3.5.
---
 xen/include/asm-arm/arm32/cmpxchg.h |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-arm/arm32/cmpxchg.h b/xen/include/asm-arm/arm32/cmpxchg.h
index 70c6090..3f4e7a1 100644
--- a/xen/include/asm-arm/arm32/cmpxchg.h
+++ b/xen/include/asm-arm/arm32/cmpxchg.h
@@ -112,8 +112,9 @@ static always_inline unsigned long __cmpxchg(
 	return oldval;
 }
 
-static inline unsigned long __cmpxchg_mb(volatile void *ptr, unsigned long old,
-					 unsigned long new, int size)
+static always_inline unsigned long __cmpxchg_mb(volatile void *ptr,
+                                                unsigned long old,
+                                                unsigned long new, int size)
 {
 	unsigned long ret;
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] xen/arm32: __cmpxchg_mb should be marked always_inline
  2014-04-03 17:09 [PATCH] xen/arm32: __cmpxchg_mb should be marked always_inline Julien Grall
@ 2014-04-08 14:36 ` Ian Campbell
  2014-04-08 14:38   ` Julien Grall
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2014-04-08 14:36 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, tim, stefano.stabellini

On Thu, 2014-04-03 at 18:09 +0100, Julien Grall wrote:
> Currently __cmpxchg_mb is only marked inline. The compiler can decide to not
> inline this function. In this case, the call to __cmpxchg will be inlined
> but not optimised. This will result linking failure because of __bad_cmpxchg.
> 
> Catched by clang 3.5.

"caught". 

Acked-by: Ian Campbell <ian.campbell@citrix.com>

But there is no S-o-b. If you offer one here I'll fix the spelling as I
commit.

> ---
>  xen/include/asm-arm/arm32/cmpxchg.h |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/include/asm-arm/arm32/cmpxchg.h b/xen/include/asm-arm/arm32/cmpxchg.h
> index 70c6090..3f4e7a1 100644
> --- a/xen/include/asm-arm/arm32/cmpxchg.h
> +++ b/xen/include/asm-arm/arm32/cmpxchg.h
> @@ -112,8 +112,9 @@ static always_inline unsigned long __cmpxchg(
>  	return oldval;
>  }
>  
> -static inline unsigned long __cmpxchg_mb(volatile void *ptr, unsigned long old,
> -					 unsigned long new, int size)
> +static always_inline unsigned long __cmpxchg_mb(volatile void *ptr,
> +                                                unsigned long old,
> +                                                unsigned long new, int size)
>  {
>  	unsigned long ret;
>  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xen/arm32: __cmpxchg_mb should be marked always_inline
  2014-04-08 14:36 ` Ian Campbell
@ 2014-04-08 14:38   ` Julien Grall
  2014-04-08 15:27     ` Ian Campbell
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Grall @ 2014-04-08 14:38 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel, tim, stefano.stabellini

On 04/08/2014 03:36 PM, Ian Campbell wrote:
> On Thu, 2014-04-03 at 18:09 +0100, Julien Grall wrote:
>> Currently __cmpxchg_mb is only marked inline. The compiler can decide to not
>> inline this function. In this case, the call to __cmpxchg will be inlined
>> but not optimised. This will result linking failure because of __bad_cmpxchg.
>>
>> Catched by clang 3.5.
> 
> "caught". 
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> But there is no S-o-b. If you offer one here I'll fix the spelling as I
> commit.

Oops, sorry.

Signed-off-by: Julien Grall <julien.grall@linaro.org>

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xen/arm32: __cmpxchg_mb should be marked always_inline
  2014-04-08 14:38   ` Julien Grall
@ 2014-04-08 15:27     ` Ian Campbell
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Campbell @ 2014-04-08 15:27 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, tim, stefano.stabellini

On Tue, 2014-04-08 at 15:38 +0100, Julien Grall wrote:
> On 04/08/2014 03:36 PM, Ian Campbell wrote:
> > On Thu, 2014-04-03 at 18:09 +0100, Julien Grall wrote:
> >> Currently __cmpxchg_mb is only marked inline. The compiler can decide to not
> >> inline this function. In this case, the call to __cmpxchg will be inlined
> >> but not optimised. This will result linking failure because of __bad_cmpxchg.
> >>
> >> Catched by clang 3.5.
> > 
> > "caught". 
> > 
> > Acked-by: Ian Campbell <ian.campbell@citrix.com>
> > 
> > But there is no S-o-b. If you offer one here I'll fix the spelling as I
> > commit.
> 
> Oops, sorry.
> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-08 15:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-03 17:09 [PATCH] xen/arm32: __cmpxchg_mb should be marked always_inline Julien Grall
2014-04-08 14:36 ` Ian Campbell
2014-04-08 14:38   ` Julien Grall
2014-04-08 15:27     ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).