linux/arch/arm64
Ard Biesheuvel 5be8b70af1 arm64: lse: deal with clobbered IP registers after branch via PLT
The LSE atomics implementation uses runtime patching to patch in calls
to out of line non-LSE atomics implementations on cores that lack hardware
support for LSE. To avoid paying the overhead cost of a function call even
if no call ends up being made, the bl instruction is kept invisible to the
compiler, and the out of line implementations preserve all registers, not
just the ones that they are required to preserve as per the AAPCS64.

However, commit fd045f6cd9 ("arm64: add support for module PLTs") added
support for routing branch instructions via veneers if the branch target
offset exceeds the range of the ordinary relative branch instructions.
Since this deals with jump and call instructions that are exposed to ELF
relocations, the PLT code uses x16 to hold the address of the branch target
when it performs an indirect branch-to-register, something which is
explicitly allowed by the AAPCS64 (and ordinary compiler generated code
does not expect register x16 or x17 to retain their values across a bl
instruction).

Since the lse runtime patched bl instructions don't adhere to the AAPCS64,
they don't deal with this clobbering of registers x16 and x17. So add them
to the clobber list of the asm() statements that perform the call
instructions, and drop x16 and x17 from the list of registers that are
callee saved in the out of line non-LSE implementations.

In addition, since we have given these functions two scratch registers,
they no longer need to stack/unstack temp registers.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[will: factored clobber list into #define, updated Makefile comment]
Signed-off-by: Will Deacon <will.deacon@arm.com>

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2016-02-26 18:35:02 +00:00
..
boot ARM: SoC fixes for v4.5-rc 2016-02-07 15:23:20 -08:00
configs arm64: defconfig: updates for 4.5 2016-01-26 11:24:41 +00:00
crypto arm64: crypto: reduce priority of core AES cipher 2015-11-18 12:09:08 +00:00
include arm64: lse: deal with clobbered IP registers after branch via PLT 2016-02-26 18:35:02 +00:00
kernel arm64: kernel: acpi: fix ioremap in ACPI parking protocol cpu_postboot 2016-02-26 15:39:52 +00:00
kvm arm64: Rename cpuid_feature field extract routines 2016-02-25 10:33:08 +00:00
lib arm64: lse: deal with clobbered IP registers after branch via PLT 2016-02-26 18:35:02 +00:00
mm arm64: mm: dump: Use VA_START directly instead of private LOWEST_ADDR 2016-02-26 18:31:41 +00:00
net arm64: bpf: add extra pass to handle faulty codegen 2016-01-17 19:15:26 -05:00
xen xen/arm: introduce HYPERVISOR_platform_op on arm and arm64 2015-12-21 14:40:56 +00:00
Kconfig arm64: kconfig: add submenu for 8.2 architectural features 2016-02-26 18:12:35 +00:00
Kconfig.debug arch: consolidate CONFIG_STRICT_DEVM in lib/Kconfig.debug 2016-01-09 06:30:49 -08:00
Kconfig.platforms ARM: SoC support for Tegra platforms for v4.5 2016-01-22 17:30:52 -08:00
Makefile arm64: add support for building vmlinux as a relocatable PIE binary 2016-02-24 14:57:27 +00:00