@@ -500,11 +500,20 @@ void giveup_all(struct task_struct *tsk)
usermsr = tsk->thread.regs->msr;
+ /*
+ * The *_unavailable_tm() functions might call this in a
+ * transaction but with not FP or VEC or VSX meaning that the
+ * if condition below will be true, this is bad since we will
+ * have preformed a reclaim but not set the TIF flag which
+ * must be set in order to trigger the recheckpoint.
+ *
+ * possibleTODO: Move setting the TIF flag into reclaim code
+ */
+ check_if_tm_restore_required(tsk);
if ((usermsr & msr_all_available) == 0)
return;
msr_check_and_set(msr_all_available);
- check_if_tm_restore_required(tsk);
WARN_ON((usermsr & MSR_VSX) && !((usermsr & MSR_FP) && (usermsr & MSR_VEC)));
@@ -1728,7 +1728,6 @@ void fp_unavailable_tm(struct pt_regs *regs)
* If VMX is in use, the VRs now hold checkpointed values,
* so we don't want to load the VRs from the thread_struct.
*/
- tm_recheckpoint(¤t->thread);
}
void altivec_unavailable_tm(struct pt_regs *regs)
@@ -1742,7 +1741,6 @@ void altivec_unavailable_tm(struct pt_regs *regs)
regs->nip, regs->msr);
tm_reclaim_current(TM_CAUSE_FAC_UNAV);
current->thread.load_vec = 1;
- tm_recheckpoint(¤t->thread);
current->thread.used_vr = 1;
}
@@ -1767,7 +1765,6 @@ void vsx_unavailable_tm(struct pt_regs *regs)
current->thread.load_vec = 1;
current->thread.load_fp = 1;
- tm_recheckpoint(¤t->thread);
}
#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */