WSL2-Linux-Kernel/arch/s390/kernel
Martin Schwidefsky f19fbd5ed6 s390: introduce execute-trampolines for branches
Add CONFIG_EXPOLINE to enable the use of the new -mindirect-branch= and
-mfunction_return= compiler options to create a kernel fortified against
the specte v2 attack.

With CONFIG_EXPOLINE=y all indirect branches will be issued with an
execute type instruction. For z10 or newer the EXRL instruction will
be used, for older machines the EX instruction. The typical indirect
call

	basr	%r14,%r1

is replaced with a PC relative call to a new thunk

	brasl	%r14,__s390x_indirect_jump_r1

The thunk contains the EXRL/EX instruction to the indirect branch

__s390x_indirect_jump_r1:
	exrl	0,0f
	j	.
0:	br	%r1

The detour via the execute type instruction has a performance impact.
To get rid of the detour the new kernel parameter "nospectre_v2" and
"spectre_v2=[on,off,auto]" can be used. If the parameter is specified
the kernel and module code will be patched at runtime.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2018-02-07 15:57:02 +01:00
..
syscalls s390/syscalls: add Makefile to generate system call header files 2018-01-23 07:36:51 +01:00
vdso32 s390/vdso: revise CFI annotations of vDSO functions 2017-12-13 10:51:36 +01:00
vdso64 s390/vdso: revise CFI annotations of vDSO functions 2017-12-13 10:51:36 +01:00
.gitignore
Makefile s390: introduce execute-trampolines for branches 2018-02-07 15:57:02 +01:00
als.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
alternative.c s390: add options to change branch prediction behaviour for the kernel 2018-02-05 13:49:17 +01:00
asm-offsets.c s390: remove all code using the access register mode 2017-11-14 11:01:47 +01:00
audit.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
audit.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
base.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cache.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat_audit.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat_linux.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2018-02-01 09:31:04 -08:00
compat_linux.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat_ptrace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat_signal.c signal: Unify and correct copy_siginfo_to_user32 2018-01-15 19:56:20 -06:00
compat_wrapper.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2017-11-13 11:47:01 -08:00
cpcmd.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
crash_dump.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
debug.c s390/debug: use pK for kernel pointers 2017-11-24 14:28:34 +01:00
diag.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dis.c s390: kernel: add SPDX identifiers to the remaining files 2017-11-24 15:37:12 +01:00
dumpstack.c s390: kernel: add SPDX identifiers to the remaining files 2017-11-24 15:37:12 +01:00
early.c s390: add options to change branch prediction behaviour for the kernel 2018-02-05 13:49:17 +01:00
early_printk.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ebcdic.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
entry.S s390: introduce execute-trampolines for branches 2018-02-07 15:57:02 +01:00
entry.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2017-11-13 11:47:01 -08:00
fpu.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ftrace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
guarded_storage.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2017-11-13 11:47:01 -08:00
head.S s390/head: replace hard coded values with constants 2018-01-23 07:36:46 +01:00
head64.S s390: remove all code using the access register mode 2017-11-14 11:01:47 +01:00
head_kdump.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
idle.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ipl.c s390: add options to change branch prediction behaviour for the kernel 2018-02-05 13:49:17 +01:00
irq.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
jump_label.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kdebugfs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kprobes.c s390/kprobes: Fix %p uses in error messages 2018-02-02 10:47:15 +01:00
lgr.c s390: kernel: add SPDX identifiers to the remaining files 2017-11-24 15:37:12 +01:00
machine_kexec.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2017-11-13 11:47:01 -08:00
mcount.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
module.c s390: introduce execute-trampolines for branches 2018-02-07 15:57:02 +01:00
nmi.c s390: kernel: add SPDX identifiers to the remaining files 2017-11-24 15:37:12 +01:00
nospec-branch.c s390: introduce execute-trampolines for branches 2018-02-07 15:57:02 +01:00
os_info.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf_cpum_cf.c s390: kernel: Remove redundant license text 2017-11-24 15:37:20 +01:00
perf_cpum_cf_events.c s390/cpum_cf: correct counter number of LAST_HOST_TRANSLATIONS 2018-02-02 10:47:16 +01:00
perf_cpum_sf.c s390: kernel: Remove redundant license text 2017-11-24 15:37:20 +01:00
perf_event.c s390: kernel: Remove redundant license text 2017-11-24 15:37:20 +01:00
perf_regs.c s390: add a few more SPDX identifiers 2017-12-05 07:51:09 +01:00
pgm_check.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
process.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2017-11-13 11:47:01 -08:00
processor.c s390: run user space and KVM guests with modified branch prediction 2018-02-05 14:48:50 +01:00
ptrace.c s390/gs: add compat regset for the guarded storage broadcast control block 2017-11-28 17:33:15 +01:00
reipl.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
relocate_kernel.S Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2017-11-13 11:47:01 -08:00
runtime_instr.c s390/runtime_instrumentation: re-add signum system call parameter 2018-02-05 07:34:50 +01:00
setup.c s390: introduce execute-trampolines for branches 2018-02-07 15:57:02 +01:00
signal.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
smp.c s390: introduce execute-trampolines for branches 2018-02-07 15:57:02 +01:00
stacktrace.c s390: kernel: add SPDX identifiers to the remaining files 2017-11-24 15:37:12 +01:00
sthyi.c s390: kernel: Remove redundant license text 2017-11-24 15:37:20 +01:00
suspend.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2017-11-13 11:47:01 -08:00
swsusp.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sys_s390.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sysinfo.c s390/sysinfo: add and display licensed internal code identifier 2018-02-02 10:47:15 +01:00
time.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2017-11-30 08:13:36 -08:00
topology.c treewide: Use DEVICE_ATTR_RW 2018-01-09 16:33:31 +01:00
trace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
traps.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
uprobes.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vdso.c s390: kernel: Remove redundant license text 2017-11-24 15:37:20 +01:00
vmlinux.lds.S s390: introduce execute-trampolines for branches 2018-02-07 15:57:02 +01:00
vtime.c s390: kernel: add SPDX identifiers to the remaining files 2017-11-24 15:37:12 +01:00