]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/tm: Abort on emulation and alignment faults
authorMichael Neuling <mikey@neuling.org>
Sun, 26 May 2013 18:09:39 +0000 (18:09 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 31 May 2013 22:29:22 +0000 (08:29 +1000)
commit3e40673a7556bb049c282f287d93d8bf0e7f3925
tree08a371c158cbf22868e71d36c0430640d9daf8cc
parentd7d097e78d0493bcda774050ce7bd6ac6672da54
powerpc/tm: Abort on emulation and alignment faults

If we are emulating an instruction inside an active user transaction that
touches memory, the kernel can't emulate it as it operates in transactional
suspend context.  We need to abort these transactions and send them back to
userspace for the hardware to rollback.

We can service these if the user transaction is in suspend mode, since the
kernel will operate in the same suspend context.

This adds a check to all alignment faults and to specific instruction
emulations (only string instructions for now).  If the user process is in an
active (non-suspended) transaction, we abort the transaction go back to
userspace allowing the HW to roll back the transaction and tell the user of the
failure.  This also adds new tm abort cause codes to report the reason of the
persistent error to the user.

Crappy test case here http://neuling.org/devel/junkcode/aligntm.c

Signed-off-by: Michael Neuling <mikey@neuling.org>
Cc: <stable@vger.kernel.org> # v3.9
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Documentation/powerpc/transactional_memory.txt
arch/powerpc/include/asm/reg.h
arch/powerpc/kernel/traps.c