[PATCH v3] arm64: Allow user selection of ARM64_MODULE_PLTS

From: Florian Fainelli
Date: Mon Jun 17 2019 - 18:35:12 EST

Make ARM64_MODULE_PLTS a selectable Kconfig symbol, since some people
might have very big modules spilling out of the dedicated module area
into vmalloc. Help text is copied from the ARM 32-bit counterpart and
modified to a mention of KASLR and specific ARM errata workaround(s).

Signed-off-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
Changes in v3:
- take out the part about "The modules will use slightly more memory, but after
rounding up to page size, the actual memory footprint is usually the same.
- take out the "If unusure say Y", since we would really prefer this to
be off by default for maximum performance

Changes in v2:

- added Ard's paragraph about KASLR
- added a paragraph about specific workarounds also requiring

arch/arm64/Kconfig | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 697ea0510729..9206feaeff07 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1418,8 +1418,26 @@ config ARM64_SVE
KVM in the same kernel image.

- bool
+ bool "Use PLTs to allow module memory to spill over into vmalloc area"
+ help
+ Allocate PLTs when loading modules so that jumps and calls whose
+ targets are too far away for their relative offsets to be encoded
+ in the instructions themselves can be bounced via veneers in the
+ module's PLT. This allows modules to be allocated in the generic
+ vmalloc area after the dedicated module memory area has been
+ exhausted.
+ When running with address space randomization (KASLR), the module
+ region itself may be too far away for ordinary relative jumps and
+ calls, and so in that case, module PLTs are required and cannot be
+ disabled.
+ Specific errata workaround(s) might also force module PLTs to be
+ enabled (ARM64_ERRATUM_843419).
+ Disabling this is usually safe for small single-platform
+ configurations.

bool "Support for NMI-like interrupts"