Skip to content

Commit 897bc3d

Browse files
leitaompe
authored andcommitted
powerpc/tm: Limit TM code inside PPC_TRANSACTIONAL_MEM
Commit e1c3743 ("powerpc/tm: Set MSR[TS] just prior to recheckpoint") moved a code block around and this block uses a 'msr' variable outside of the CONFIG_PPC_TRANSACTIONAL_MEM, however the 'msr' variable is declared inside a CONFIG_PPC_TRANSACTIONAL_MEM block, causing a possible error when CONFIG_PPC_TRANSACTION_MEM is not defined. error: 'msr' undeclared (first use in this function) This is not causing a compilation error in the mainline kernel, because 'msr' is being used as an argument of MSR_TM_ACTIVE(), which is defined as the following when CONFIG_PPC_TRANSACTIONAL_MEM is *not* set: #define MSR_TM_ACTIVE(x) 0 This patch just fixes this issue avoiding the 'msr' variable usage outside the CONFIG_PPC_TRANSACTIONAL_MEM block, avoiding trusting in the MSR_TM_ACTIVE() definition. Cc: stable@vger.kernel.org Reported-by: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de> Fixes: e1c3743 ("powerpc/tm: Set MSR[TS] just prior to recheckpoint") Signed-off-by: Breno Leitao <leitao@debian.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent fb0bdec commit 897bc3d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

arch/powerpc/kernel/signal_64.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,11 +755,12 @@ SYSCALL_DEFINE0(rt_sigreturn)
755755
if (restore_tm_sigcontexts(current, &uc->uc_mcontext,
756756
&uc_transact->uc_mcontext))
757757
goto badframe;
758-
}
758+
} else
759759
#endif
760-
/* Fall through, for non-TM restore */
761-
if (!MSR_TM_ACTIVE(msr)) {
760+
{
762761
/*
762+
* Fall through, for non-TM restore
763+
*
763764
* Unset MSR[TS] on the thread regs since MSR from user
764765
* context does not have MSR active, and recheckpoint was
765766
* not called since restore_tm_sigcontexts() was not called

0 commit comments

Comments
 (0)