summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/module.c
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2015-03-17 12:15:02 +0000
committerWill Deacon <will.deacon@arm.com>2015-09-17 11:57:03 +0100
commitdf057cc7b4fa59e9b55f07ffdb6c62bf02e99a00 (patch)
tree866dd49a0acc98317cc3866738f3b417f44eccf2 /arch/arm64/kernel/module.c
parentbdec97a855ef1e239f130f7a11584721c9a1bf04 (diff)
downloadblackbird-obmc-linux-df057cc7b4fa59e9b55f07ffdb6c62bf02e99a00.tar.gz
blackbird-obmc-linux-df057cc7b4fa59e9b55f07ffdb6c62bf02e99a00.zip
arm64: errata: add module build workaround for erratum #843419
Cortex-A53 processors <= r0p4 are affected by erratum #843419 which can lead to a memory access using an incorrect address in certain sequences headed by an ADRP instruction. There is a linker fix to generate veneers for ADRP instructions, but this doesn't work for kernel modules which are built as unlinked ELF objects. This patch adds a new config option for the erratum which, when enabled, builds kernel modules with the mcmodel=large flag. This uses absolute addressing for all kernel symbols, thereby removing the use of ADRP as a PC-relative form of addressing. The ADRP relocs are removed from the module loader so that we fail to load any potentially affected modules. Cc: <stable@vger.kernel.org> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/kernel/module.c')
-rw-r--r--arch/arm64/kernel/module.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c
index 67bf4107f6ef..876eb8df50bf 100644
--- a/arch/arm64/kernel/module.c
+++ b/arch/arm64/kernel/module.c
@@ -332,12 +332,14 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
ovf = reloc_insn_imm(RELOC_OP_PREL, loc, val, 0, 21,
AARCH64_INSN_IMM_ADR);
break;
+#ifndef CONFIG_ARM64_ERRATUM_843419
case R_AARCH64_ADR_PREL_PG_HI21_NC:
overflow_check = false;
case R_AARCH64_ADR_PREL_PG_HI21:
ovf = reloc_insn_imm(RELOC_OP_PAGE, loc, val, 12, 21,
AARCH64_INSN_IMM_ADR);
break;
+#endif
case R_AARCH64_ADD_ABS_LO12_NC:
case R_AARCH64_LDST8_ABS_LO12_NC:
overflow_check = false;
OpenPOWER on IntegriCloud