kernel-ark/arch/s390/kernel
Hendrik Brueckner 9977e886cb s390/kernel: lazy restore fpu registers
Improve the save and restore behavior of FPU register contents to use the
vector extension within the kernel.

The kernel does not use floating-point or vector registers and, therefore,
saving and restoring the FPU register contents are performed for handling
signals or switching processes only.  To prepare for using vector
instructions and vector registers within the kernel, enhance the save
behavior and implement a lazy restore at return to user space from a
system call or interrupt.

To implement the lazy restore, the save_fpu_regs() sets a CPU information
flag, CIF_FPU, to indicate that the FPU registers must be restored.
Saving and setting CIF_FPU is performed in an atomic fashion to be
interrupt-safe.  When the kernel wants to use the vector extension or
wants to change the FPU register state for a task during signal handling,
the save_fpu_regs() must be called first.  The CIF_FPU flag is also set at
process switch.  At return to user space, the FPU state is restored.  In
particular, the FPU state includes the floating-point or vector register
contents, as well as, vector-enablement and floating-point control.  The
FPU state restore and clearing CIF_FPU is also performed in an atomic
fashion.

For KVM, the restore of the FPU register state is performed when restoring
the general-purpose guest registers before the SIE instructions is started.
Because the path towards the SIE instruction is interruptible, the CIF_FPU
flag must be checked again right before going into SIE.  If set, the guest
registers must be reloaded again by re-entering the outer SIE loop.  This
is the same behavior as if the SIE critical section is interrupted.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2015-07-22 09:58:01 +02:00
..
vdso32 s390/vdso: fix stack corruption 2014-10-27 13:27:02 +01:00
vdso64 s390/vdso: fix clock_gettime for CLOCK_THREAD_CPUTIME_ID, -2 and -3 2015-02-12 09:37:21 +01:00
.gitignore
asm-offsets.c s390/kernel: lazy restore fpu registers 2015-07-22 09:58:01 +02:00
audit.c [S390] Get rid of a bunch of sparse warnings again. 2007-10-12 16:13:06 +02:00
audit.h
base.S s390/kdump: fix nosmt kernel parameter 2015-06-25 09:39:26 +02:00
cache.c s390/cacheinfo: add missing facility check 2015-04-13 10:46:16 +02:00
compat_audit.c [S390] Get rid of a bunch of sparse warnings again. 2007-10-12 16:13:06 +02:00
compat_linux.c groups: Consolidate the setgroups permission checks 2014-12-05 17:19:27 -06:00
compat_linux.h s390: add support for vector extension 2014-10-09 09:14:13 +02:00
compat_ptrace.h [S390] ptrace cleanup 2011-01-05 12:47:31 +01:00
compat_signal.c s390/kernel: lazy restore fpu registers 2015-07-22 09:58:01 +02:00
compat_wrapper.c clone: support passing tls argument via C rather than pt_regs magic 2015-06-25 17:00:38 -07:00
cpcmd.c s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
crash_dump.c s390/kdump: fix nosmt kernel parameter 2015-06-25 09:39:26 +02:00
debug.c s390: time: Provide read_boot_clock64() and read_persistent_clock64() 2015-05-22 10:36:29 -07:00
diag.c s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
dis.c s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
dumpstack.c s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
early.c s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
ebcdic.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
entry.h s390/signal: add sys_sigreturn and sys_rt_sigreturn declarations 2015-01-08 10:02:49 +01:00
entry.S s390/kernel: lazy restore fpu registers 2015-07-22 09:58:01 +02:00
ftrace.c s390/maccess: remove potentially broken probe_kernel_write() 2015-03-25 11:49:43 +01:00
head64.S s390: fix kernel crash due to linkage stack instructions 2014-02-05 11:00:50 +01:00
head_kdump.S s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
head.S s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
idle.c s390/idle: convert open coded idle time seqcount 2014-12-08 09:42:32 +01:00
ipl.c s390/ipl: cleanup macro usage 2015-03-25 11:49:50 +01:00
irq.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-04-15 09:00:47 -07:00
jump_label.c s390/maccess: remove potentially broken probe_kernel_write() 2015-03-25 11:49:43 +01:00
kprobes.c s390/maccess: remove potentially broken probe_kernel_write() 2015-03-25 11:49:43 +01:00
lgr.c
machine_kexec.c s390: add SMT support 2015-01-22 12:16:01 +01:00
Makefile s390: remove "64" suffix from mem64.S and swsusp_asm64.S 2015-03-25 11:49:51 +01:00
mcount.S s390/ftrace: hotpatch support for function tracing 2015-01-29 09:19:25 +01:00
module.c s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
nmi.c s390/kernel: lazy restore fpu registers 2015-07-22 09:58:01 +02:00
os_info.c Include missing linux/slab.h inclusions 2013-04-29 15:42:01 -04:00
perf_cpum_cf_events.c s390/cpum_cf: Export event names in sysfs 2013-12-16 14:37:50 +01:00
perf_cpum_cf.c s390: Replace __get_cpu_var uses 2014-08-26 13:45:52 -04:00
perf_cpum_sf.c kernel/params: constify struct kernel_param_ops uses 2015-05-28 11:32:10 +09:30
perf_event.c s390/perf: make print_debug_cf() static 2014-03-14 12:59:32 +01:00
pgm_check.S s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
process.c s390/kernel: lazy restore fpu registers 2015-07-22 09:58:01 +02:00
processor.c s390/ftrace: fix crashes when switching tracers / add notrace to cpu_relax() 2015-03-02 11:35:53 -08:00
ptrace.c s390/kernel: lazy restore fpu registers 2015-07-22 09:58:01 +02:00
reipl.S s390: remove "64" suffix from a couple of files 2015-03-25 11:49:34 +01:00
relocate_kernel.S s390: remove "64" suffix from a couple of files 2015-03-25 11:49:34 +01:00
runtime_instr.c s390/irq: Use defines for external interruption codes 2014-04-03 14:30:52 +02:00
s390_ksyms.c s390/kernel: lazy restore fpu registers 2015-07-22 09:58:01 +02:00
sclp.S s390/sclp: clear upper register halves in _sclp_print_early 2015-07-07 09:28:29 +02:00
setup.c revert "s390/mm: make hugepages_supported a boot time decision" 2015-07-17 16:39:52 -07:00
signal.c s390/kernel: lazy restore fpu registers 2015-07-22 09:58:01 +02:00
smp.c s390/kdump: fix compile for !SMP 2015-06-29 10:13:11 +02:00
stacktrace.c
suspend.c PCI: Include <linux/pci.h>, not <asm/pci.h> 2015-06-08 07:55:03 -05:00
swsusp.S s390: remove "64" suffix from mem64.S and swsusp_asm64.S 2015-03-25 11:49:51 +01:00
sys_s390.c s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
syscalls.S s390: remove 31 bit syscalls 2015-03-25 11:49:35 +01:00
sysinfo.c Fairly small update, but there are some interesting new features. 2015-02-13 09:55:09 -08:00
time.c s390: time: Provide read_boot_clock64() and read_persistent_clock64() 2015-05-22 10:36:29 -07:00
topology.c s390: make couple of functions and variables static 2015-03-25 11:49:45 +01:00
traps.c s390/kernel: lazy restore fpu registers 2015-07-22 09:58:01 +02:00
uprobes.c s390/uprobes: fix address space annotation 2015-03-25 11:49:47 +01:00
vdso.c s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
vmlinux.lds.S s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
vtime.c s390: add SMT support 2015-01-22 12:16:01 +01:00