powerpc/tm: Fix restoration of MSR on 32bit signal return
authorMichael Neuling <mikey@neuling.org>
Sun, 9 Jun 2013 11:23:17 +0000 (21:23 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2013 21:07:20 +0000 (14:07 -0700)
commitbc8ae5222e9e42582bd32028c638a5b4517e69e2
treee2fd74eaa62ae549d87fbd7900576e00dd5918e9
parent743834135bc07e3bb9d6166607b874443fe1537c
powerpc/tm: Fix restoration of MSR on 32bit signal return

commit 2c27a18f8736da047bef2b997bdd48efc667e3c9 upstream.

Currently we clear out the MSR TM bits on signal return assuming that the
signal should never return to an active transaction.

This is bogus as the user may do this.  It's most likely the transaction will
be doomed due to a treclaim but that's a problem for the HW not the kernel.

The current code is a legacy of earlier kernel implementations which did
software rollback of active transactions in the kernel.  That code has now gone
but we didn't correctly fix up this part of the signals code which still makes
the assumption that it must be returning to a suspended transaction.

This pulls out both MSR TM bits from the user supplied context rather than just
setting TM suspend.  We pull out only the bits needed to ensure the user can't
do anything dangerous to the MSR.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/signal_32.c