[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 12/12] xen/arm64: __cmpxchg and __cmpxchg_mb should always be inline



On Wed, 27 Mar 2019, Julien Grall wrote:
> Currently __cmpxchg_mb and __cmpxchg are only marked inline. The
> compiler is free to decide to not honor the inline. This will result to
> generate code use __bad_cmpxchg and lead a link failure.
> 
> This was caught by Clang 8.0.
> 
> Signed-off-by: Julien Grall <julien.grall@xxxxxxx>

Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>


> ---
>  xen/include/asm-arm/arm64/cmpxchg.h | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/include/asm-arm/arm64/cmpxchg.h 
> b/xen/include/asm-arm/arm64/cmpxchg.h
> index ae42b2f5ff..359271173e 100644
> --- a/xen/include/asm-arm/arm64/cmpxchg.h
> +++ b/xen/include/asm-arm/arm64/cmpxchg.h
> @@ -63,8 +63,9 @@ static inline unsigned long __xchg(unsigned long x, 
> volatile void *ptr, int size
>  
>  extern void __bad_cmpxchg(volatile void *ptr, int size);
>  
> -static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
> -                                   unsigned long new, int size)
> +static always_inline unsigned long __cmpxchg(volatile void *ptr,
> +                                          unsigned long old,
> +                                          unsigned long new, int size)
>  {
>       unsigned long oldval = 0, res;
>  
> @@ -137,8 +138,9 @@ static inline unsigned long __cmpxchg(volatile void *ptr, 
> unsigned long old,
>       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;
>  
> -- 
> 2.11.0
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.