s390: fix floating pointer register corruption (again)
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 10 Mar 2016 08:52:55 +0000 (09:52 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 10 Mar 2016 13:35:42 +0000 (14:35 +0100)
commite370e4769463a65dcf8806fa26d2874e0542ac41
tree29ab4542734a87a38ac31d709e7c5507661e44eb
parent8f100bb1ff27873dd71f636da670e503b9ade3c6
s390: fix floating pointer register corruption (again)

There is a tricky interaction between the machine check handler
and the critical sections of load_fpu_regs and save_fpu_regs
functions. If the machine check interrupts one of the two
functions the critical section cleanup will complete the function
before the machine check handler s390_do_machine_check is called.
Trouble is that the machine check handler needs to validate the
floating point registers *before* and not *after* the completion
of load_fpu_regs/save_fpu_regs.

The simplest solution is to rewind the PSW to the start of the
load_fpu_regs/save_fpu_regs and retry the function after the
return from the machine check handler.

Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: <stable@vger.kernel.org> # 4.3+
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/entry.S