Skip to contentSkip to conversation

arm64: move --fix-cortex-a53-843419 linker test to Kconfig

PATCH In review Masahiro Yamada 4 participants 6 messages Mar 24, 2021 – Mar 28, 2021 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: move --fix-cortex-a53-843419 linker test to Kconfig

$(call ld-option, --fix-cortex-a53-843419) in arch/arm64/Makefile is evaluated every time even for Make targets that do not need the linker, such as "make ARCH=arm64 install".

Recently, the Kbuild tree queued up a patch to avoid needless compiler/linker flag evaluation. I beleive it is a good improvement itself, but causing a false-positive warning for arm64 installation in linux-next. (Thanks to Nathan for the report)

Kconfig can test the linker capability just once, and store it in the .config file. The build and installation steps that follow do not need to test the liniker over again.

---

I was not sure what the preferred CONFIG option name is. Please suggest a one if you have a better idea.

 arch/arm64/Kconfig  | 3 +++
 arch/arm64/Makefile | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
arch/arm64/Kconfig +3 -0
index 5656e7aacd69..4a33428de8ac 100644
@@ -521,6 +521,9 @@ config ARM64_ERRATUM_843419
 
 	  If unsure, say Y.
 
+config ARM64_LD_HAS_FIX_ERRATUM_843419
+	def_bool $(ld-option,--fix-cortex-a53-843419)
+
 config ARM64_ERRATUM_1024718
 	bool "Cortex-A55: 1024718: Update of DBM/AP bits without break before make might result in incorrect update"
 	default y
arch/arm64/Makefile +1 -1
index 5b84aec31ed3..7ef44478560d 100644
@@ -21,7 +21,7 @@ LDFLAGS_vmlinux		+= -shared -Bsymbolic -z notext \
 endif
 
 ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
-  ifeq ($(call ld-option, --fix-cortex-a53-843419),)
+  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
 LDFLAGS_vmlinux	+= --fix-cortex-a53-843419
Signature · 1 line
2.27.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 17 lines · Masahiro Yamada

$(call ld-option, --fix-cortex-a53-843419) in arch/arm64/Makefile is evaluated every time even for Make targets that do not need the linker, such as "make ARCH=arm64 install".

Recently, the Kbuild tree queued up a patch to avoid needless compiler/linker flag evaluation. I beleive it is a good improvement itself, but causing a false-positive warning for arm64 installation in linux-next. (Thanks to Nathan for the report)

Kconfig can test the linker capability just once, and store it in the .config file. The build and installation steps that follow do not need to test the liniker over again.

---

Quoted 7 lines

I was not sure what the preferred CONFIG option name is. Please suggest a one if you have a better idea.

 arch/arm64/Kconfig  | 3 +++
 arch/arm64/Makefile | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

Will

Tested-by Reviewed-by on v1 1/1
#2 lore raw
In reply to Masahiro Yamada
Quoted 9 lines · Masahiro Yamada

$(call ld-option, --fix-cortex-a53-843419) in arch/arm64/Makefile is evaluated every time even for Make targets that do not need the linker, such as "make ARCH=arm64 install".

Recently, the Kbuild tree queued up a patch to avoid needless compiler/linker flag evaluation. I beleive it is a good improvement itself, but causing a false-positive warning for arm64 installation in linux-next. (Thanks to Nathan for the report)

Quoted 6 lines

Kconfig can test the linker capability just once, and store it in the .config file. The build and installation steps that follow do not need to test the liniker over again.

Thanks for the quick fix!

Quoted 45 lines

---

I was not sure what the preferred CONFIG option name is. Please suggest a one if you have a better idea.

 arch/arm64/Kconfig  | 3 +++
 arch/arm64/Makefile | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
arch/arm64/Kconfig +3 -0
index 5656e7aacd69..4a33428de8ac 100644
@@ -521,6 +521,9 @@ config ARM64_ERRATUM_843419
 
 	  If unsure, say Y.
 
+config ARM64_LD_HAS_FIX_ERRATUM_843419
+	def_bool $(ld-option,--fix-cortex-a53-843419)
+
 config ARM64_ERRATUM_1024718
 	bool "Cortex-A55: 1024718: Update of DBM/AP bits without break before make might result in incorrect update"
 	default y
arch/arm64/Makefile +1 -1
index 5b84aec31ed3..7ef44478560d 100644
@@ -21,7 +21,7 @@ LDFLAGS_vmlinux		+= -shared -Bsymbolic -z notext \
 endif
 
 ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
-  ifeq ($(call ld-option, --fix-cortex-a53-843419),)
+  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
 LDFLAGS_vmlinux	+= --fix-cortex-a53-843419
Signature · 7 lines
2.27.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#3 lore raw
In reply to Masahiro Yamada

Hi Masahiro,

Quoted 17 lines · Masahiro Yamada

$(call ld-option, --fix-cortex-a53-843419) in arch/arm64/Makefile is evaluated every time even for Make targets that do not need the linker, such as "make ARCH=arm64 install".

Recently, the Kbuild tree queued up a patch to avoid needless compiler/linker flag evaluation. I beleive it is a good improvement itself, but causing a false-positive warning for arm64 installation in linux-next. (Thanks to Nathan for the report)

Kconfig can test the linker capability just once, and store it in the .config file. The build and installation steps that follow do not need to test the liniker over again.

---

Quoted 7 lines

I was not sure what the preferred CONFIG option name is. Please suggest a one if you have a better idea.

 arch/arm64/Kconfig  | 3 +++
 arch/arm64/Makefile | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

Would you like this patch to go in via the arm64 tree or you will queue it via the kbuild tree?

Thanks.

Signature · 1 line
Catalin
#4 lore raw
Quoted 25 lines · Catalin Marinas

Hi Masahiro,

Quoted 21 lines · Masahiro Yamada

$(call ld-option, --fix-cortex-a53-843419) in arch/arm64/Makefile is evaluated every time even for Make targets that do not need the linker, such as "make ARCH=arm64 install".

Recently, the Kbuild tree queued up a patch to avoid needless compiler/linker flag evaluation. I beleive it is a good improvement itself, but causing a false-positive warning for arm64 installation in linux-next. (Thanks to Nathan for the report)

Kconfig can test the linker capability just once, and store it in the .config file. The build and installation steps that follow do not need to test the liniker over again.

---

I was not sure what the preferred CONFIG option name is. Please suggest a one if you have a better idea.

Quoted 6 lines
Quoted 3 lines
 arch/arm64/Kconfig  | 3 +++
 arch/arm64/Makefile | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

Would you like this patch to go in via the arm64 tree or you will queue it via the kbuild tree?

I applied this to linux-kbuild with Will's Ack.
Thanks.

Signature · 2 lines
Best Regards
Masahiro Yamada
maintainer
#5 lore raw
Quoted 24 lines · Masahiro Yamada
Quoted 22 lines · Catalin Marinas
Quoted 21 lines · Masahiro Yamada

$(call ld-option, --fix-cortex-a53-843419) in arch/arm64/Makefile is evaluated every time even for Make targets that do not need the linker, such as "make ARCH=arm64 install".

Recently, the Kbuild tree queued up a patch to avoid needless compiler/linker flag evaluation. I beleive it is a good improvement itself, but causing a false-positive warning for arm64 installation in linux-next. (Thanks to Nathan for the report)

Kconfig can test the linker capability just once, and store it in the .config file. The build and installation steps that follow do not need to test the liniker over again.

---

I was not sure what the preferred CONFIG option name is. Please suggest a one if you have a better idea.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
 arch/arm64/Kconfig  | 3 +++
 arch/arm64/Makefile | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

Would you like this patch to go in via the arm64 tree or you will queue it via the kbuild tree?

I applied this to linux-kbuild with Will's Ack.

Great, I'll cross it off my list. Thanks.

Signature · 1 line
Catalin