Commit 6ffe9923 authored by Will Deacon's avatar Will Deacon

arm64: errata: Pass --fix-cortex-a53-843419 to ld if workaround enabled

Cortex-A53 erratum 843419 is worked around by the linker, although it is
a configure-time option to GCC as to whether ld is actually asked to
apply the workaround or not.

This patch ensures that we pass --fix-cortex-a53-843419 to the linker
when both CONFIG_ARM64_ERRATUM_843419=y and the linker supports the
option.
Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent b2d8b0cb
...@@ -418,18 +418,13 @@ config ARM64_ERRATUM_845719 ...@@ -418,18 +418,13 @@ config ARM64_ERRATUM_845719
config ARM64_ERRATUM_843419 config ARM64_ERRATUM_843419
bool "Cortex-A53: 843419: A load or store might access an incorrect address" bool "Cortex-A53: 843419: A load or store might access an incorrect address"
depends on MODULES
default y default y
select ARM64_MODULE_CMODEL_LARGE select ARM64_MODULE_CMODEL_LARGE if MODULES
help help
This option builds kernel modules using the large memory model in This option links the kernel with '--fix-cortex-a53-843419' and
order to avoid the use of the ADRP instruction, which can cause builds modules using the large memory model in order to avoid the use
a subsequent memory access to use an incorrect address on Cortex-A53 of the ADRP instruction, which can cause a subsequent memory access
parts up to r0p4. to use an incorrect address on Cortex-A53 parts up to r0p4.
Note that the kernel itself must be linked with a version of ld
which fixes potentially affected ADRP instructions through the
use of veneers.
If unsure, say Y. If unsure, say Y.
......
...@@ -18,6 +18,14 @@ ifneq ($(CONFIG_RELOCATABLE),) ...@@ -18,6 +18,14 @@ ifneq ($(CONFIG_RELOCATABLE),)
LDFLAGS_vmlinux += -pie -Bsymbolic LDFLAGS_vmlinux += -pie -Bsymbolic
endif endif
ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
ifeq ($(call ld-option, --fix-cortex-a53-843419),)
$(warning ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum)
else
LDFLAGS_vmlinux += --fix-cortex-a53-843419
endif
endif
KBUILD_DEFCONFIG := defconfig KBUILD_DEFCONFIG := defconfig
# Check for binutils support for specific extensions # Check for binutils support for specific extensions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment