Since the transaction will be doomed with treckpt., the TEXASR[FS]
should be set, to reflect that the transaction is a failure. This patch
ensures it before recheckpointing, and remove changes from other places
that were calling recheckpoint.

Signed-off-by: Breno Leitao <lei...@debian.org>
---
 arch/powerpc/kernel/process.c   | 6 ++++++
 arch/powerpc/kernel/signal_32.c | 2 --
 arch/powerpc/kernel/signal_64.c | 2 --
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 5cace1b744b1..77725b2e4dc1 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -937,6 +937,12 @@ void tm_recheckpoint(struct thread_struct *thread)
        local_irq_save(flags);
        hard_irq_disable();
 
+       /*
+        * Make sure the failure summary is set, since the transaction will be
+        * doomed.
+        */
+       thread->tm_texasr |= TEXASR_FS;
+
        /* The TM SPRs are restored here, so that TEXASR.FS can be set
         * before the trecheckpoint and no explosion occurs.
         */
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 4a1b17409bf3..96956d50538e 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -851,8 +851,6 @@ static long restore_tm_user_regs(struct pt_regs *regs,
        /* Pull in the MSR TM bits from the user context */
        regs->msr = (regs->msr & ~MSR_TS_MASK) | (msr_hi & MSR_TS_MASK);
 
-       /* Make sure the transaction is marked as failed */
-       current->thread.tm_texasr |= TEXASR_FS;
        /* Make sure restore_tm_state will be called */
        set_thread_flag(TIF_RESTORE_TM);
 
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 32402aa23a5e..c84501711b14 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -569,8 +569,6 @@ static long restore_tm_sigcontexts(struct task_struct *tsk,
                }
        }
 #endif
-       /* Make sure the transaction is marked as failed */
-       tsk->thread.tm_texasr |= TEXASR_FS;
        /* Guarantee that restore_tm_state() will be called */
        set_thread_flag(TIF_RESTORE_TM);
 
-- 
2.19.0

Reply via email to