original_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
vdso64
.gitignore
Makefile s390: introduce execute-trampolines for branches 2018-02-07 15:57:02 +01:00
als.c
alternative.c s390: add options to change branch prediction behaviour for the kernel 2018-02-05 13:49:17 +01:00
asm-offsets.c
audit.c
audit.h
base.S
cache.c
compat_audit.c
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
compat_ptrace.h
compat_signal.c
compat_wrapper.c
cpcmd.c
crash_dump.c
debug.c
diag.c
dis.c
dumpstack.c
early.c s390: add options to change branch prediction behaviour for the kernel 2018-02-05 13:49:17 +01:00
early_printk.c
ebcdic.c
entry.S s390: introduce execute-trampolines for branches 2018-02-07 15:57:02 +01:00
entry.h
fpu.c
ftrace.c
guarded_storage.c
head.S s390/head: replace hard coded values with constants 2018-01-23 07:36:46 +01:00
head64.S
head_kdump.S
idle.c
ipl.c s390: add options to change branch prediction behaviour for the kernel 2018-02-05 13:49:17 +01:00
irq.c
jump_label.c
kdebugfs.c
kprobes.c s390/kprobes: Fix %p uses in error messages 2018-02-02 10:47:15 +01:00
lgr.c
machine_kexec.c
mcount.S
module.c s390: introduce execute-trampolines for branches 2018-02-07 15:57:02 +01:00
nmi.c
nospec-branch.c s390: introduce execute-trampolines for branches 2018-02-07 15:57:02 +01:00
os_info.c
perf_cpum_cf.c
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
perf_event.c
perf_regs.c
pgm_check.S
process.c
processor.c s390: run user space and KVM guests with modified branch prediction 2018-02-05 14:48:50 +01:00
ptrace.c
reipl.S
relocate_kernel.S
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
smp.c s390: introduce execute-trampolines for branches 2018-02-07 15:57:02 +01:00
stacktrace.c
sthyi.c
suspend.c
swsusp.S
sys_s390.c
sysinfo.c s390/sysinfo: add and display licensed internal code identifier 2018-02-02 10:47:15 +01:00
time.c
topology.c
trace.c
traps.c
uprobes.c
vdso.c
vmlinux.lds.S s390: introduce execute-trampolines for branches 2018-02-07 15:57:02 +01:00
vtime.c