Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/tm: Fix HTM documentation

This patch simply fix part of the documentation on the HTM code.

This fixes reference to old fields that were renamed in commit
000ec280e3dd ("powerpc: tm: Rename transct_(*) to ck(\1)_state")

It also documents better the flow after commit eb5c3f1c8647 ("powerpc:
Always save/restore checkpointed regs during treclaim/trecheckpoint"),
where tm_recheckpoint can recheckpoint what is in ck{fp,vr}_state
blindly.

Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Breno Leitao and committed by
Michael Ellerman
96695563 693b31b2

+15 -11
+5 -5
arch/powerpc/kernel/tm.S
··· 96 96 * uint8_t cause) 97 97 * 98 98 * - Performs a full reclaim. This destroys outstanding 99 - * transactions and updates thread->regs.tm_ckpt_* with the 100 - * original checkpointed state. Note that thread->regs is 101 - * unchanged. 99 + * transactions and updates thread.ckpt_regs, thread.ckfp_state and 100 + * thread.ckvr_state with the original checkpointed state. Note that 101 + * thread->regs is unchanged. 102 102 * 103 103 * Purpose is to both abort transactions of, and preserve the state of, 104 104 * a transactions at a context switch. We preserve/restore both sets of process ··· 261 261 262 262 /* Altivec (VEC/VMX/VR)*/ 263 263 addi r7, r3, THREAD_CKVRSTATE 264 - SAVE_32VRS(0, r6, r7) /* r6 scratch, r7 transact vr state */ 264 + SAVE_32VRS(0, r6, r7) /* r6 scratch, r7 ckvr_state */ 265 265 mfvscr v0 266 266 li r6, VRSTATE_VSCR 267 267 stvx v0, r7, r6 ··· 272 272 273 273 /* Floating Point (FP) */ 274 274 addi r7, r3, THREAD_CKFPSTATE 275 - SAVE_32FPRS_VSRS(0, R6, R7) /* r6 scratch, r7 transact fp state */ 275 + SAVE_32FPRS_VSRS(0, R6, R7) /* r6 scratch, r7 ckfp_state */ 276 276 mffs fr0 277 277 stfd fr0,FPSTATE_FPSCR(r7) 278 278
+10 -6
arch/powerpc/kernel/traps.c
··· 1750 1750 * checkpointed FP registers need to be loaded. 1751 1751 */ 1752 1752 tm_reclaim_current(TM_CAUSE_FAC_UNAV); 1753 - /* Reclaim didn't save out any FPRs to transact_fprs. */ 1753 + 1754 + /* 1755 + * Reclaim initially saved out bogus (lazy) FPRs to ckfp_state, and 1756 + * then it was overwrite by the thr->fp_state by tm_reclaim_thread(). 1757 + * 1758 + * At this point, ck{fp,vr}_state contains the exact values we want to 1759 + * recheckpoint. 1760 + */ 1754 1761 1755 1762 /* Enable FP for the task: */ 1756 1763 current->thread.load_fp = 1; 1757 1764 1758 - /* This loads and recheckpoints the FP registers from 1759 - * thread.fpr[]. They will remain in registers after the 1760 - * checkpoint so we don't need to reload them after. 1761 - * If VMX is in use, the VRs now hold checkpointed values, 1762 - * so we don't want to load the VRs from the thread_struct. 1765 + /* 1766 + * Recheckpoint all the checkpointed ckpt, ck{fp, vr}_state registers. 1763 1767 */ 1764 1768 tm_recheckpoint(&current->thread); 1765 1769 }