android_kernel_oneplus_msm8998/arch/s390
Martin Schwidefsky b4ab3567f2 s390/ftrace: use expoline for indirect branches
commit 23a4d7fd34856da8218c4cfc23dba7a6ec0a423a upstream.

The return from the ftrace_stub, _mcount, ftrace_caller and
return_to_handler functions is done with "br %r14" and "br %r1".
These are indirect branches as well and need to use execute
trampolines for CONFIG_EXPOLINE=y.

The ftrace_caller function is a special case as it returns to the
start of a function and may only use %r0 and %r1. For a pre z10
machine the standard execute trampoline uses a LARL + EX to do
this, but this requires *two* registers in the range %r1..%r15.
To get around this the 'br %r1' located in the lowcore is used,
then the EX instruction does not need an address register.
But the lowcore trick may only be used for pre z14 machines,
with noexec=on the mapping for the first page may not contain
instructions. The solution for that is an ALTERNATIVE in the
expoline THUNK generated by 'GEN_BR_THUNK %r1' to switch to
EXRL, this relies on the fact that a machine that supports
noexec=on has EXRL as well.

Cc: stable@vger.kernel.org # 4.16
Fixes: f19fbd5ed6 ("s390: introduce execute-trampolines for branches")
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-30 07:49:17 +02:00
..
appldata s390: appldata: drop owner assignment from platform_drivers 2014-10-20 16:20:13 +02:00
boot s390/decompressor: fix initrd corruption caused by bss clear 2017-04-12 12:38:34 +02:00
configs s390/defconfig: set SCSI_DH=y 2015-10-01 10:48:36 +02:00
crypto s390/crypto: unlock on error in prng_tdes_read() 2017-01-12 11:22:49 +01:00
hypfs hypfs_kill_super(): deal with failed allocations 2018-04-24 09:32:11 +02:00
include s390/ftrace: use expoline for indirect branches 2018-05-30 07:49:17 +02:00
kernel s390/ftrace: use expoline for indirect branches 2018-05-30 07:49:17 +02:00
kvm KVM: s390: Enable all facility bits that are known good for passthrough 2018-05-16 10:06:46 +02:00
lib s390/lib: use expoline for indirect branches 2018-05-26 08:48:58 +02:00
mm mm: larger stack guard gap, between vmas 2017-06-26 07:13:11 +02:00
net s390: use expoline thunks in the BPF JIT 2018-05-26 08:48:59 +02:00
numa s390/numa: write kernel message when emu_size has been increased 2015-10-14 14:31:59 +02:00
oprofile s390/oprofile: fix compile error 2015-07-01 09:34:39 +02:00
pci s390/pci: do not require AIS facility 2017-12-09 18:42:39 +01:00
defconfig s390: new default configuration 2015-06-25 09:39:25 +02:00
Kbuild s390/numa: add core infrastructure 2015-08-03 18:40:25 +02:00
Kconfig s390: add sysfs attributes for spectre 2018-04-29 07:50:04 +02:00
Kconfig.debug
Makefile s390: add automatic detection of the spectre defense 2018-04-29 07:50:04 +02:00