]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Jun 2013 19:53:20 +0000 (12:53 -0700)
commite71c42189de0af8b93505e559837d934f6cb42b6
tree82df25b09599727c81516d41bd1decb89637cf27
parent2568d1e1e1c1eebd783bf35ae3bddb271f0ebd35
powerpc/tm: Abort on emulation and alignment faults

commit 6ce6c629fd8254b3177650de99699682ff7f6707 upstream.

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>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/powerpc/transactional_memory.txt
arch/powerpc/include/asm/reg.h
arch/powerpc/kernel/traps.c