s390: critical section cleanup vs. machine checks
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 28 Feb 2013 15:28:41 +0000 (16:28 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 5 Mar 2013 09:21:35 +0000 (10:21 +0100)
commit6551fbdfd8b85d1ab5822ac98abb4fb449bcfae0
tree7e44d437d9332332ba7dff50091a6c4e44efc644
parent6dbe51c251a327e012439c4772097a13df43c5b8
s390: critical section cleanup vs. machine checks

The current machine check code uses the registers stored by the machine
in the lowcore at __LC_GPREGS_SAVE_AREA as the registers of the interrupted
context. The registers 0-7 of a user process can get clobbered if a machine
checks interrupts the execution of a critical section in entry[64].S.

The reason is that the critical section cleanup code may need to modify
the PSW and the registers for the previous context to get to the end of a
critical section. If registers 0-7 have to be replaced the relevant copy
will be in the registers, which invalidates the copy in the lowcore. The
machine check handler needs to explicitly store registers 0-7 to the stack.

Cc: stable@vger.kernel.org
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/entry.S
arch/s390/kernel/entry64.S