Skip to content

Commit 6d9e96f

Browse files
committed
Revert "powerpc/tm: Unset MSR[TS] if not recheckpointing"
This reverts commit a9935a1 which is commit 6f5b9f0 upstream. It breaks the powerpc build, so drop it from the tree until a fix goes upstream. Reported-by: Guenter Roeck <linux@roeck-us.net> Cc: Breno Leitao <leitao@debian.org> Cc: Michal Suchánek <msuchanek@suse.de> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent eb05c02 commit 6d9e96f

2 files changed

Lines changed: 9 additions & 29 deletions

File tree

arch/powerpc/kernel/signal_32.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,11 +1140,11 @@ SYSCALL_DEFINE0(rt_sigreturn)
11401140
{
11411141
struct rt_sigframe __user *rt_sf;
11421142
struct pt_regs *regs = current_pt_regs();
1143-
int tm_restore = 0;
11441143
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
11451144
struct ucontext __user *uc_transact;
11461145
unsigned long msr_hi;
11471146
unsigned long tmp;
1147+
int tm_restore = 0;
11481148
#endif
11491149
/* Always make any pending restarted system calls return -EINTR */
11501150
current->restart_block.fn = do_no_restart_syscall;
@@ -1192,19 +1192,11 @@ SYSCALL_DEFINE0(rt_sigreturn)
11921192
goto bad;
11931193
}
11941194
}
1195-
if (!tm_restore) {
1196-
/*
1197-
* Unset regs->msr because ucontext MSR TS is not
1198-
* set, and recheckpoint was not called. This avoid
1199-
* hitting a TM Bad thing at RFID
1200-
*/
1201-
regs->msr &= ~MSR_TS_MASK;
1202-
}
1203-
/* Fall through, for non-TM restore */
1204-
#endif
12051195
if (!tm_restore)
1206-
if (do_setcontext(&rt_sf->uc, regs, 1))
1207-
goto bad;
1196+
/* Fall through, for non-TM restore */
1197+
#endif
1198+
if (do_setcontext(&rt_sf->uc, regs, 1))
1199+
goto bad;
12081200

12091201
/*
12101202
* It's not clear whether or why it is desirable to save the

arch/powerpc/kernel/signal_64.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -740,23 +740,11 @@ SYSCALL_DEFINE0(rt_sigreturn)
740740
&uc_transact->uc_mcontext))
741741
goto badframe;
742742
}
743-
#endif
743+
else
744744
/* Fall through, for non-TM restore */
745-
if (!MSR_TM_ACTIVE(msr)) {
746-
/*
747-
* Unset MSR[TS] on the thread regs since MSR from user
748-
* context does not have MSR active, and recheckpoint was
749-
* not called since restore_tm_sigcontexts() was not called
750-
* also.
751-
*
752-
* If not unsetting it, the code can RFID to userspace with
753-
* MSR[TS] set, but without CPU in the proper state,
754-
* causing a TM bad thing.
755-
*/
756-
current->thread.regs->msr &= ~MSR_TS_MASK;
757-
if (restore_sigcontext(current, NULL, 1, &uc->uc_mcontext))
758-
goto badframe;
759-
}
745+
#endif
746+
if (restore_sigcontext(current, NULL, 1, &uc->uc_mcontext))
747+
goto badframe;
760748

761749
if (restore_altstack(&uc->uc_stack))
762750
goto badframe;

0 commit comments

Comments
 (0)