[PATCH] arm64: Paper over ARM_SMCCC_ARCH_WORKAROUND_3 Clang issue

Catalin Marinas catalin.marinas at arm.com
Wed Mar 9 10:45:13 PST 2022


On Wed, Mar 09, 2022 at 10:50:36AM -0700, Nathan Chancellor wrote:
> This diff seems like a somewhat proper solution, as __READ_ONCE() cannot
> be used in assembly, but I am open to other suggestions.
> 
> diff --git a/arch/arm64/include/asm/rwonce.h b/arch/arm64/include/asm/rwonce.h
> index 1bce62fa908a..56f7b1d4d54b 100644
> --- a/arch/arm64/include/asm/rwonce.h
> +++ b/arch/arm64/include/asm/rwonce.h
> @@ -5,7 +5,7 @@
>  #ifndef __ASM_RWONCE_H
>  #define __ASM_RWONCE_H
>  
> -#ifdef CONFIG_LTO
> +#if defined(CONFIG_LTO) && !defined(__ASSEMBLY__)
>  
>  #include <linux/compiler_types.h>
>  #include <asm/alternative-macros.h>
> @@ -66,7 +66,7 @@
>  })
>  
>  #endif	/* !BUILD_VDSO */
> -#endif	/* CONFIG_LTO */
> +#endif	/* CONFIG_LTO && !__ASSEMBLY__ */

Thanks Nathan. Would you please send a proper patch for this? I'd go
with your proposal as it seems more related to LTO than Marc's patch ;).

-- 
Catalin



More information about the linux-arm-kernel mailing list