]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
powerpc/tm: Fix HTM documentation
authorBreno Leitao <leitao@debian.org>
Mon, 18 Jun 2018 22:59:42 +0000 (19:59 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 17 Sep 2018 11:17:25 +0000 (21:17 +1000)
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>
arch/powerpc/kernel/tm.S
arch/powerpc/kernel/traps.c

index 6bffbc5affe76ba7847ceb74b69e16cc53ac4178..50e5cff10d0f27ca3ae6fea44da0f3da89ea011c 100644 (file)
@@ -96,9 +96,9 @@ EXPORT_SYMBOL_GPL(tm_abort);
  *                uint8_t cause)
  *
  *     - Performs a full reclaim.  This destroys outstanding
- *       transactions and updates thread->regs.tm_ckpt_* with the
- *       original checkpointed state.  Note that thread->regs is
- *       unchanged.
+ *       transactions and updates thread.ckpt_regs, thread.ckfp_state and
+ *       thread.ckvr_state with the original checkpointed state.  Note that
+ *       thread->regs is unchanged.
  *
  * Purpose is to both abort transactions of, and preserve the state of,
  * a transactions at a context switch. We preserve/restore both sets of process
@@ -261,7 +261,7 @@ _GLOBAL(tm_reclaim)
 
        /* Altivec (VEC/VMX/VR)*/
        addi    r7, r3, THREAD_CKVRSTATE
-       SAVE_32VRS(0, r6, r7)   /* r6 scratch, r7 transact vr state */
+       SAVE_32VRS(0, r6, r7)   /* r6 scratch, r7 ckvr_state */
        mfvscr  v0
        li      r6, VRSTATE_VSCR
        stvx    v0, r7, r6
@@ -272,7 +272,7 @@ _GLOBAL(tm_reclaim)
 
        /* Floating Point (FP) */
        addi    r7, r3, THREAD_CKFPSTATE
-       SAVE_32FPRS_VSRS(0, R6, R7)     /* r6 scratch, r7 transact fp state */
+       SAVE_32FPRS_VSRS(0, R6, R7)     /* r6 scratch, r7 ckfp_state */
        mffs    fr0
        stfd    fr0,FPSTATE_FPSCR(r7)
 
index c85adb8582713075426ab05b537c6910d19d467a..6ab66a88db1470444fedfba6eb1ade8273350d70 100644 (file)
@@ -1750,16 +1750,20 @@ void fp_unavailable_tm(struct pt_regs *regs)
          * checkpointed FP registers need to be loaded.
         */
        tm_reclaim_current(TM_CAUSE_FAC_UNAV);
-       /* Reclaim didn't save out any FPRs to transact_fprs. */
+
+       /*
+        * Reclaim initially saved out bogus (lazy) FPRs to ckfp_state, and
+        * then it was overwrite by the thr->fp_state by tm_reclaim_thread().
+        *
+        * At this point, ck{fp,vr}_state contains the exact values we want to
+        * recheckpoint.
+        */
 
        /* Enable FP for the task: */
        current->thread.load_fp = 1;
 
-       /* This loads and recheckpoints the FP registers from
-        * thread.fpr[].  They will remain in registers after the
-        * checkpoint so we don't need to reload them after.
-        * If VMX is in use, the VRs now hold checkpointed values,
-        * so we don't want to load the VRs from the thread_struct.
+       /*
+        * Recheckpoint all the checkpointed ckpt, ck{fp, vr}_state registers.
         */
        tm_recheckpoint(&current->thread);
 }