s390/nmi: do register validation as early as possible
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 12 Oct 2017 11:24:48 +0000 (13:24 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 19 Oct 2017 15:07:40 +0000 (17:07 +0200)
commit3037a52f9846b9d6e233274453f2d4117a14f31b
tree030694099f002e9c3dd222b8f905a1a871e96341
parent6c81511ca1f52a0bbe921b2b98e34319a4ca59ed
s390/nmi: do register validation as early as possible

The validation of the CPU registers in the machine check handler is
currently split into two parts. The first part is done at the start
of the low level mcck_int_handler function, this includes the CPU
timer register and the general purpose registers.
The second part is done a bit later in s390_do_machine_check for all
the other registers, including the control registers, floating pointer
control, vector or floating pointer registers, the access registers,
the guarded storage registers, the TOD programmable registers and the
clock comparator.

This is working fine to far but in theory a future extensions could
cause the C code to use registers that are not validated yet. A better
approach is to validate all CPU registers in "safe" assembler code
before any C function is called.

Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/ctl_reg.h
arch/s390/include/asm/nmi.h
arch/s390/kernel/asm-offsets.c
arch/s390/kernel/entry.S
arch/s390/kernel/nmi.c