summaryrefslogtreecommitdiffstats
path: root/arch/arm64/Kconfig
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-11-24 06:37:35 -0500
committerCatalin Marinas <catalin.marinas@arm.com>2016-02-24 09:57:24 -0500
commitfd045f6cd98ec4953147b318418bd45e441e52a3 (patch)
tree833eab1f579ef3f22fdf52ea3f58ffbab939eb36 /arch/arm64/Kconfig
parentf98deee9a9f8c47d05a0f64d86440882dca772ff (diff)
arm64: add support for module PLTs
This adds support for emitting PLTs at module load time for relative branches that are out of range. This is a prerequisite for KASLR, which may place the kernel and the modules anywhere in the vmalloc area, making it more likely that branch target offsets exceed the maximum range of +/- 128 MB. In this version, I removed the distinction between relocations against .init executable sections and ordinary executable sections. The reason is that it is hardly worth the trouble, given that .init.text usually does not contain that many far branches, and this version now only reserves PLT entry space for jump and call relocations against undefined symbols (since symbols defined in the same module can be assumed to be within +/- 128 MB) For example, the mac80211.ko module (which is fairly sizable at ~400 KB) built with -mcmodel=large gives the following relocation counts: relocs branches unique !local .text 3925 3347 518 219 .init.text 11 8 7 1 .exit.text 4 4 4 1 .text.unlikely 81 67 36 17 ('unique' means branches to unique type/symbol/addend combos, of which !local is the subset referring to undefined symbols) IOW, we are only emitting a single PLT entry for the .init sections, and we are better off just adding it to the core PLT section instead. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/Kconfig')
-rw-r--r--arch/arm64/Kconfig9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index cfa1cc90ebf4..c85c29d660bd 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -395,6 +395,7 @@ config ARM64_ERRATUM_843419
395 bool "Cortex-A53: 843419: A load or store might access an incorrect address" 395 bool "Cortex-A53: 843419: A load or store might access an incorrect address"
396 depends on MODULES 396 depends on MODULES
397 default y 397 default y
398 select ARM64_MODULE_CMODEL_LARGE
398 help 399 help
399 This option builds kernel modules using the large memory model in 400 This option builds kernel modules using the large memory model in
400 order to avoid the use of the ADRP instruction, which can cause 401 order to avoid the use of the ADRP instruction, which can cause
@@ -778,6 +779,14 @@ config ARM64_UAO
778 regular load/store instructions if the cpu does not implement the 779 regular load/store instructions if the cpu does not implement the
779 feature. 780 feature.
780 781
782config ARM64_MODULE_CMODEL_LARGE
783 bool
784
785config ARM64_MODULE_PLTS
786 bool
787 select ARM64_MODULE_CMODEL_LARGE
788 select HAVE_MOD_ARCH_SPECIFIC
789
781endmenu 790endmenu
782 791
783menu "Boot options" 792menu "Boot options"