All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Murzin <vladimir.murzin@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
	linux-arm-kernel@lists.infradead.org
Cc: Will Deacon <will@kernel.org>
Subject: Re: [PATCH 2/2] arm64: Move the LSE gas support detection to Kconfig
Date: Fri, 10 Jan 2020 11:54:38 +0000	[thread overview]
Message-ID: <fb5f92cd-8f67-911d-8849-177689702bb9@arm.com> (raw)
In-Reply-To: <20200109174948.48211-3-catalin.marinas@arm.com>

On 1/9/20 5:49 PM, Catalin Marinas wrote:
> As the Kconfig syntax gained support for $(as-instr) tests, move the LSE
> gas support detection from Makefile to the main arm64 Kconfig and remove
> the additional CONFIG_AS_LSE definition and check.
> 
> Cc: Will Deacon <will@kernel.org>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> ---
>  arch/arm64/Kconfig                    |  4 ++++
>  arch/arm64/Makefile                   | 13 ++-----------
>  arch/arm64/include/asm/atomic_ll_sc.h |  2 +-
>  arch/arm64/include/asm/lse.h          |  6 +++---
>  arch/arm64/kernel/cpufeature.c        |  4 ++--
>  5 files changed, 12 insertions(+), 17 deletions(-)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index b1b4476ddb83..2a0521f0f156 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1362,8 +1362,12 @@ config ARM64_PAN
>  	 The feature is detected at runtime, and will remain as a 'nop'
>  	 instruction if the cpu does not implement the feature.
>  
> +config ARM64_AS_HAS_LSE
> +	def_bool $(as-instr,.arch_extension lse)
> +
>  config ARM64_LSE_ATOMICS
>  	bool "Atomic instructions"
> +	depends on ARM64_AS_HAS_LSE
>  	depends on JUMP_LABEL
>  	default y
>  	help
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index 1fbe24d4fdb6..cca6de192d42 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -30,15 +30,6 @@ LDFLAGS_vmlinux	+= --fix-cortex-a53-843419
>    endif
>  endif
>  
> -# Check for binutils support for specific extensions
> -lseinstr := $(call as-instr,.arch_extension lse,-DCONFIG_AS_LSE=1)
> -
> -ifeq ($(CONFIG_ARM64_LSE_ATOMICS), y)
> -  ifeq ($(lseinstr),)
> -$(warning LSE atomics not supported by binutils)
> -  endif
> -endif
> -
>  cc_has_k_constraint := $(call try-run,echo				\
>  	'int main(void) {						\
>  		asm volatile("and w0, w0, %w0" :: "K" (4294967295));	\
> @@ -53,11 +44,11 @@ $(warning Detected assembler with broken .inst; disassembly will be unreliable)
>    endif
>  endif
>  
> -KBUILD_CFLAGS	+= -mgeneral-regs-only $(lseinstr) $(brokengasinst)	\
> +KBUILD_CFLAGS	+= -mgeneral-regs-only $(brokengasinst)	\
>  		   $(compat_vdso) $(cc_has_k_constraint)
>  KBUILD_CFLAGS	+= -fno-asynchronous-unwind-tables
>  KBUILD_CFLAGS	+= $(call cc-disable-warning, psabi)
> -KBUILD_AFLAGS	+= $(lseinstr) $(brokengasinst) $(compat_vdso)
> +KBUILD_AFLAGS	+= $(brokengasinst) $(compat_vdso)
>  
>  KBUILD_CFLAGS	+= $(call cc-option,-mabi=lp64)
>  KBUILD_AFLAGS	+= $(call cc-option,-mabi=lp64)
> diff --git a/arch/arm64/include/asm/atomic_ll_sc.h b/arch/arm64/include/asm/atomic_ll_sc.h
> index 7b012148bfd6..13869b76b58c 100644
> --- a/arch/arm64/include/asm/atomic_ll_sc.h
> +++ b/arch/arm64/include/asm/atomic_ll_sc.h
> @@ -12,7 +12,7 @@
>  
>  #include <linux/stringify.h>
>  
> -#if IS_ENABLED(CONFIG_ARM64_LSE_ATOMICS) && IS_ENABLED(CONFIG_AS_LSE)
> +#ifdef CONFIG_ARM64_LSE_ATOMICS
>  #define __LL_SC_FALLBACK(asm_ops)					\
>  "	b	3f\n"							\
>  "	.subsection	1\n"						\
> diff --git a/arch/arm64/include/asm/lse.h b/arch/arm64/include/asm/lse.h
> index 80b388278149..4e1009fff686 100644
> --- a/arch/arm64/include/asm/lse.h
> +++ b/arch/arm64/include/asm/lse.h
> @@ -4,7 +4,7 @@
>  
>  #include <asm/atomic_ll_sc.h>
>  
> -#if defined(CONFIG_AS_LSE) && defined(CONFIG_ARM64_LSE_ATOMICS)
> +#ifdef CONFIG_ARM64_LSE_ATOMICS
>  
>  #include <linux/compiler_types.h>
>  #include <linux/export.h>
> @@ -36,7 +36,7 @@ static inline bool system_uses_lse_atomics(void)
>  #define ARM64_LSE_ATOMIC_INSN(llsc, lse)				\
>  	ALTERNATIVE(llsc, lse, ARM64_HAS_LSE_ATOMICS)
>  
> -#else	/* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */
> +#else	/* CONFIG_ARM64_LSE_ATOMICS */
>  
>  static inline bool system_uses_lse_atomics(void) { return false; }
>  
> @@ -44,5 +44,5 @@ static inline bool system_uses_lse_atomics(void) { return false; }
>  
>  #define ARM64_LSE_ATOMIC_INSN(llsc, lse)	llsc
>  
> -#endif	/* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */
> +#endif	/* CONFIG_ARM64_LSE_ATOMICS */
>  #endif	/* __ASM_LSE_H */
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index 04cf64e9f0c9..2595c2886d3f 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -1291,7 +1291,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
>  		.cpu_enable = cpu_enable_pan,
>  	},
>  #endif /* CONFIG_ARM64_PAN */
> -#if defined(CONFIG_AS_LSE) && defined(CONFIG_ARM64_LSE_ATOMICS)
> +#ifdef CONFIG_ARM64_LSE_ATOMICS
>  	{
>  		.desc = "LSE atomic instructions",
>  		.capability = ARM64_HAS_LSE_ATOMICS,
> @@ -1302,7 +1302,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
>  		.sign = FTR_UNSIGNED,
>  		.min_field_value = 2,
>  	},
> -#endif /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */
> +#endif /* CONFIG_ARM64_LSE_ATOMICS */
>  	{
>  		.desc = "Software prefetching using PRFM",
>  		.capability = ARM64_HAS_NO_HW_PREFETCH,
> 

I was not lucky with the similar patch [1], anyway

Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>


[1] https://www.spinics.net/lists/linux-crypto/msg36059.html

Cheers
Vladimir

> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-01-10 11:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09 17:49 [PATCH 0/2] arm64: Simplify gas LSE support detection Catalin Marinas
2020-01-09 17:49 ` [PATCH 1/2] kbuild: Add support for 'as-instr' to be used in Kconfig files Catalin Marinas
2020-01-09 17:49 ` [PATCH 2/2] arm64: Move the LSE gas support detection to Kconfig Catalin Marinas
2020-01-10 11:54   ` Vladimir Murzin [this message]
2020-01-10 12:08     ` Will Deacon
2020-01-10 15:30       ` Catalin Marinas
2020-01-10 15:45         ` Will Deacon
2020-01-13 11:36           ` Catalin Marinas
2020-01-14 17:19             ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb5f92cd-8f67-911d-8849-177689702bb9@arm.com \
    --to=vladimir.murzin@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.