s390: fix race on TIF_MCCK_PENDING
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 15 May 2012 07:20:06 +0000 (09:20 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 16 May 2012 12:42:46 +0000 (14:42 +0200)
commiteda0c6d6b04d3cf72f5e8d656e39bffe3568e6db
tree5f57e3581729dfad7a7999ee24fd044b47018b8e
parente5b8d7553f87d939295e9eb0ca699c0030dc5ff1
s390: fix race on TIF_MCCK_PENDING

There is a small race window in the __switch_to code in regard to
the transfer of the TIF_MCCK_PENDING bit from the previous to the
next task. The bit is transferred before the task struct pointer
and the thread-info pointer for the next task has been stored to
lowcore. If a machine check sets the TIF_MCCK_PENDING bit between
the transfer code and the store of current/thread_info the bit
is still set for the previous task. And if the previous task has
terminated it can get lost. The effect is that a pending CRW is
not retrieved until the next machine checks sets TIF_MCCK_PENDING.
To fix this reorder __switch_to to first store the task struct
and thread-info pointer and then do the transfer of the bit.

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