OSDN Git Service

s390: fix floating pointer register corruption (again)
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 10 Mar 2016 08:52:55 +0000 (09:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2016 16:08:36 +0000 (09:08 -0700)
commit1a4d9389206b787f620966dd0442ac0cd8df5525
treef1be1b1b1b58682e13e99eeff4c1e61bb3d0b18b
parent608377369dcebfa0dc9506a4f17d008bc93bb5b9
s390: fix floating pointer register corruption (again)

commit e370e4769463a65dcf8806fa26d2874e0542ac41 upstream.

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>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/kernel/entry.S