linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: move warning about toolchains to archprepare
@ 2021-08-01  5:35 Masahiro Yamada
  2021-08-03 10:05 ` Will Deacon
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2021-08-01  5:35 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, moderated for non-subscribers
  Cc: Masahiro Yamada, linux-kernel, linux-arm-kernel

Commit 987fdfec2410 ("arm64: move --fix-cortex-a53-843419 linker test to
Kconfig") fixed the false-positive warning in the installation step.

Yet, there are some cases where this false-positive is shown. For example,
you can see it when you cross 987fdfec2410 during git-bisect.

  $ git checkout 987fdfec2410^
    [ snip ]
  $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig all
    [ snip ]
  $ git checkout v5.13
    [ snip]
  $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig all
    [ snip ]
  arch/arm64/Makefile:25: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum

In the stale include/config/auto.config, CONFIG_ARM64_ERRATUM_843419=y
is set without CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419, so the warning
is displayed while parsing the Makefiles.

Make will restart with the updated include/config/auto.config, hence
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419 will be set eventually, but
this warning is a surprise for users.

Commit 25896d073d8a ("x86/build: Fix compiler support check for
CONFIG_RETPOLINE") addressed a similar issue.

Move $(warning ...) out of the parse stage of Makefiles.

The same applies to CONFIG_ARM64_USE_LSE_ATOMICS.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/arm64/Makefile | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index ded13230f901..8b0fd9d92390 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -21,19 +21,11 @@ LDFLAGS_vmlinux		+= -shared -Bsymbolic -z notext \
 endif
 
 ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
-  ifneq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
-$(warning ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum)
-  else
+  ifeq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
 LDFLAGS_vmlinux	+= --fix-cortex-a53-843419
   endif
 endif
 
-ifeq ($(CONFIG_ARM64_USE_LSE_ATOMICS), y)
-  ifneq ($(CONFIG_ARM64_LSE_ATOMICS), y)
-$(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));	\
@@ -179,6 +171,17 @@ vdso_install:
 
 archprepare:
 	$(Q)$(MAKE) $(build)=arch/arm64/tools kapi
+ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
+  ifneq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
+	@echo "warning: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum" >&2
+  endif
+endif
+ifeq ($(CONFIG_ARM64_USE_LSE_ATOMICS),y)
+  ifneq ($(CONFIG_ARM64_LSE_ATOMICS),y)
+	@echo "warning: LSE atomics not supported by binutils" >&2
+  endif
+endif
+
 
 # We use MRPROPER_FILES and CLEAN_FILES now
 archclean:
-- 
2.27.0


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

* Re: [PATCH] arm64: move warning about toolchains to archprepare
  2021-08-01  5:35 [PATCH] arm64: move warning about toolchains to archprepare Masahiro Yamada
@ 2021-08-03 10:05 ` Will Deacon
  0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2021-08-03 10:05 UTC (permalink / raw)
  To: Catalin Marinas, Masahiro Yamada, moderated for non-subscribers
  Cc: kernel-team, Will Deacon, linux-kernel

On Sun, 1 Aug 2021 14:35:25 +0900, Masahiro Yamada wrote:
> Commit 987fdfec2410 ("arm64: move --fix-cortex-a53-843419 linker test to
> Kconfig") fixed the false-positive warning in the installation step.
> 
> Yet, there are some cases where this false-positive is shown. For example,
> you can see it when you cross 987fdfec2410 during git-bisect.
> 
>   $ git checkout 987fdfec2410^
>     [ snip ]
>   $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig all
>     [ snip ]
>   $ git checkout v5.13
>     [ snip]
>   $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig all
>     [ snip ]
>   arch/arm64/Makefile:25: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
> 
> [...]

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: move warning about toolchains to archprepare
      https://git.kernel.org/arm64/c/64ee84c75b5f

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

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

end of thread, other threads:[~2021-08-03 10:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-01  5:35 [PATCH] arm64: move warning about toolchains to archprepare Masahiro Yamada
2021-08-03 10:05 ` Will Deacon

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).