Commit 53545131 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Greg Kroah-Hartman

powerpc/tm: do not use r13 for tabort_syscall

commit cc7786d3 upstream.

tabort_syscall runs with RI=1, so a nested recoverable machine
check will load the paca into r13 and overwrite what we loaded
it with, because exceptions returning to privileged mode do not
restore r13.

Fixes: b4b56f9e (powerpc/tm: Abort syscalls in active transactions)
Signed-off-by: default avatarNick Piggin <npiggin@gmail.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e70bb22b
...@@ -334,13 +334,13 @@ syscall_exit_work: ...@@ -334,13 +334,13 @@ syscall_exit_work:
tabort_syscall: tabort_syscall:
/* Firstly we need to enable TM in the kernel */ /* Firstly we need to enable TM in the kernel */
mfmsr r10 mfmsr r10
li r13, 1 li r9, 1
rldimi r10, r13, MSR_TM_LG, 63-MSR_TM_LG rldimi r10, r9, MSR_TM_LG, 63-MSR_TM_LG
mtmsrd r10, 0 mtmsrd r10, 0
/* tabort, this dooms the transaction, nothing else */ /* tabort, this dooms the transaction, nothing else */
li r13, (TM_CAUSE_SYSCALL|TM_CAUSE_PERSISTENT) li r9, (TM_CAUSE_SYSCALL|TM_CAUSE_PERSISTENT)
TABORT(R13) TABORT(R9)
/* /*
* Return directly to userspace. We have corrupted user register state, * Return directly to userspace. We have corrupted user register state,
...@@ -348,8 +348,8 @@ tabort_syscall: ...@@ -348,8 +348,8 @@ tabort_syscall:
* resume after the tbegin of the aborted transaction with the * resume after the tbegin of the aborted transaction with the
* checkpointed register state. * checkpointed register state.
*/ */
li r13, MSR_RI li r9, MSR_RI
andc r10, r10, r13 andc r10, r10, r9
mtmsrd r10, 1 mtmsrd r10, 1
mtspr SPRN_SRR0, r11 mtspr SPRN_SRR0, r11
mtspr SPRN_SRR1, r12 mtspr SPRN_SRR1, r12
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment