diff options
| author | Will Deacon <will.deacon@arm.com> | 2016-08-22 11:58:36 +0100 |
|---|---|---|
| committer | Bruno Martins <bgcngm@gmail.com> | 2022-10-28 15:57:23 +0100 |
| commit | 6dacd7e737fb520a4e4a41dd4e746007764f1485 (patch) | |
| tree | 159767d9774cd499aea56e2acdc3f7f912d36a6f /arch | |
| parent | d2787c21f2b565c18395c6d84fa3604759d3b5a9 (diff) | |
BACKPORT: 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: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Change-Id: Ic94f6218117a3d52c792ddbec0bff1b5d293c34f
(cherry picked from commit 6ffe9923f2350c19b95a2c9ebf1b4f5f275986f2)
Signed-off-by: Dan Aloni <daloni@magicleap.com>
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/arm64/Kconfig | 15 | ||||
| -rw-r--r-- | arch/arm64/Makefile | 8 |
2 files changed, 13 insertions, 10 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 8b055133ae2a..28f09a00143b 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -458,18 +458,13 @@ config ARM64_ERRATUM_845719 config ARM64_ERRATUM_843419 bool "Cortex-A53: 843419: A load or store might access an incorrect address" - depends on MODULES default y - select ARM64_MODULE_CMODEL_LARGE + select ARM64_MODULE_CMODEL_LARGE if MODULES help - This option builds kernel modules using the large memory model in - order to avoid the use of the ADRP instruction, which can cause - a subsequent memory access 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. + This option links the kernel with '--fix-cortex-a53-843419' and + builds modules using the large memory model in order to avoid the use + of the ADRP instruction, which can cause a subsequent memory access + to use an incorrect address on Cortex-A53 parts up to r0p4. If unsure, say Y. diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 4df2b48fae44..d94274a058dc 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -19,6 +19,14 @@ ifneq ($(CONFIG_RELOCATABLE),) LDFLAGS_vmlinux += -pie -Bsymbolic 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 # Check for binutils support for specific extensions |
