[PATCH v2 4/4] powerpc/tm: Do not recheckpoint non-tm task
Breno Leitao
leitao at debian.org
Tue Jun 19 08:59:44 AEST 2018
If __switch_to() tries to context switch from task A to task B, and task A
had task->thread->regs->msr[TM] enabled, then __switch_to_tm() will call
tm_recheckpoint_new_task(), which will call trecheckpoint, for task B, which
is clearly wrong since task B might not be an active TM user.
This does not cause a lot of damage because tm_recheckpoint() will abort
the call since it realize that the current task does not have msr[TM] bit
set.
Signed-off-by: Breno Leitao <leitao at debian.org>
---
arch/powerpc/kernel/process.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index f8beee03f00a..d26a150766ef 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1036,7 +1036,8 @@ static inline void __switch_to_tm(struct task_struct *prev,
prev->thread.regs->msr &= ~MSR_TM;
}
- tm_recheckpoint_new_task(new);
+ if (tm_enabled(new))
+ tm_recheckpoint_new_task(new);
}
}
--
2.16.3
More information about the Linuxppc-dev
mailing list