Skip to content

Commit 000ec28

Browse files
cyrilbur-ibmmpe
authored andcommitted
powerpc: tm: Rename transct_(*) to ck(\1)_state
Make the structures being used for checkpointed state named consistently with the pt_regs/ckpt_regs. Signed-off-by: Cyril Bur <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent dc31066 commit 000ec28

File tree

10 files changed

+94
-94
lines changed

10 files changed

+94
-94
lines changed

arch/powerpc/include/asm/processor.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ typedef struct {
147147
} mm_segment_t;
148148

149149
#define TS_FPR(i) fp_state.fpr[i][TS_FPROFFSET]
150-
#define TS_TRANS_FPR(i) transact_fp.fpr[i][TS_FPROFFSET]
150+
#define TS_CKFPR(i) ckfp_state.fpr[i][TS_FPROFFSET]
151151

152152
/* FP and VSX 0-31 register set */
153153
struct thread_fp_state {
@@ -275,9 +275,9 @@ struct thread_struct {
275275
*
276276
* These are analogous to how ckpt_regs and pt_regs work
277277
*/
278-
struct thread_fp_state transact_fp;
279-
struct thread_vr_state transact_vr;
280-
unsigned long transact_vrsave;
278+
struct thread_fp_state ckfp_state; /* Checkpointed FP state */
279+
struct thread_vr_state ckvr_state; /* Checkpointed VR state */
280+
unsigned long ckvrsave; /* Checkpointed VRSAVE */
281281
#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
282282
#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
283283
void* kvm_shadow_vcpu; /* KVM internal data */

arch/powerpc/kernel/asm-offsets.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ int main(void)
142142
DEFINE(THREAD_TM_PPR, offsetof(struct thread_struct, tm_ppr));
143143
DEFINE(THREAD_TM_DSCR, offsetof(struct thread_struct, tm_dscr));
144144
DEFINE(PT_CKPT_REGS, offsetof(struct thread_struct, ckpt_regs));
145-
DEFINE(THREAD_TRANSACT_VRSTATE, offsetof(struct thread_struct,
146-
transact_vr));
147-
DEFINE(THREAD_TRANSACT_VRSAVE, offsetof(struct thread_struct,
148-
transact_vrsave));
149-
DEFINE(THREAD_TRANSACT_FPSTATE, offsetof(struct thread_struct,
150-
transact_fp));
145+
DEFINE(THREAD_CKVRSTATE, offsetof(struct thread_struct,
146+
ckvr_state));
147+
DEFINE(THREAD_CKVRSAVE, offsetof(struct thread_struct,
148+
ckvrsave));
149+
DEFINE(THREAD_CKFPSTATE, offsetof(struct thread_struct,
150+
ckfp_state));
151151
/* Local pt_regs on stack for Transactional Memory funcs. */
152152
DEFINE(TM_FRAME_SIZE, STACK_FRAME_OVERHEAD +
153153
sizeof(struct pt_regs) + 16);

arch/powerpc/kernel/fpu.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX)
6868
SYNC
6969
MTMSRD(r5)
7070

71-
addi r7,r3,THREAD_TRANSACT_FPSTATE
71+
addi r7,r3,THREAD_CKFPSTATE
7272
lfd fr0,FPSTATE_FPSCR(r7)
7373
MTFSF_L(fr0)
7474
REST_32FPVSRS(0, R4, R7)

arch/powerpc/kernel/process.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,8 @@ static inline void tm_reclaim_task(struct task_struct *tsk)
851851
*
852852
* In switching we need to maintain a 2nd register state as
853853
* oldtask->thread.ckpt_regs. We tm_reclaim(oldproc); this saves the
854-
* checkpointed (tbegin) state in ckpt_regs and saves the transactional
855-
* (current) FPRs into oldtask->thread.transact_fpr[].
854+
* checkpointed (tbegin) state in ckpt_regs, ckfp_state and
855+
* ckvr_state
856856
*
857857
* We also context switch (save) TFHAR/TEXASR/TFIAR in here.
858858
*/

arch/powerpc/kernel/ptrace.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ static int gpr_set(struct task_struct *target, const struct user_regset *regset,
404404

405405
/*
406406
* Regardless of transactions, 'fp_state' holds the current running
407-
* value of all FPR registers and 'transact_fp' holds the last checkpointed
407+
* value of all FPR registers and 'ckfp_state' holds the last checkpointed
408408
* value of all FPR registers for the current transaction.
409409
*
410410
* Userspace interface buffer layout:
@@ -442,7 +442,7 @@ static int fpr_get(struct task_struct *target, const struct user_regset *regset,
442442

443443
/*
444444
* Regardless of transactions, 'fp_state' holds the current running
445-
* value of all FPR registers and 'transact_fp' holds the last checkpointed
445+
* value of all FPR registers and 'ckfp_state' holds the last checkpointed
446446
* value of all FPR registers for the current transaction.
447447
*
448448
* Userspace interface buffer layout:
@@ -506,7 +506,7 @@ static int vr_active(struct task_struct *target,
506506

507507
/*
508508
* Regardless of transactions, 'vr_state' holds the current running
509-
* value of all the VMX registers and 'transact_vr' holds the last
509+
* value of all the VMX registers and 'ckvr_state' holds the last
510510
* checkpointed value of all the VMX registers for the current
511511
* transaction to fall back on in case it aborts.
512512
*
@@ -553,7 +553,7 @@ static int vr_get(struct task_struct *target, const struct user_regset *regset,
553553

554554
/*
555555
* Regardless of transactions, 'vr_state' holds the current running
556-
* value of all the VMX registers and 'transact_vr' holds the last
556+
* value of all the VMX registers and 'ckvr_state' holds the last
557557
* checkpointed value of all the VMX registers for the current
558558
* transaction to fall back on in case it aborts.
559559
*
@@ -617,7 +617,7 @@ static int vsr_active(struct task_struct *target,
617617

618618
/*
619619
* Regardless of transactions, 'fp_state' holds the current running
620-
* value of all FPR registers and 'transact_fp' holds the last
620+
* value of all FPR registers and 'ckfp_state' holds the last
621621
* checkpointed value of all FPR registers for the current
622622
* transaction.
623623
*
@@ -650,7 +650,7 @@ static int vsr_get(struct task_struct *target, const struct user_regset *regset,
650650

651651
/*
652652
* Regardless of transactions, 'fp_state' holds the current running
653-
* value of all FPR registers and 'transact_fp' holds the last
653+
* value of all FPR registers and 'ckfp_state' holds the last
654654
* checkpointed value of all FPR registers for the current
655655
* transaction.
656656
*
@@ -945,7 +945,7 @@ static int tm_cfpr_active(struct task_struct *target,
945945
*
946946
* This function gets in transaction checkpointed FPR registers.
947947
*
948-
* When the transaction is active 'transact_fp' holds the checkpointed
948+
* When the transaction is active 'ckfp_state' holds the checkpointed
949949
* values for the current transaction to fall back on if it aborts
950950
* in between. This function gets those checkpointed FPR registers.
951951
* The userspace interface buffer layout is as follows.
@@ -975,8 +975,8 @@ static int tm_cfpr_get(struct task_struct *target,
975975

976976
/* copy to local buffer then write that out */
977977
for (i = 0; i < 32 ; i++)
978-
buf[i] = target->thread.TS_TRANS_FPR(i);
979-
buf[32] = target->thread.transact_fp.fpscr;
978+
buf[i] = target->thread.TS_CKFPR(i);
979+
buf[32] = target->thread.ckfp_state.fpscr;
980980
return user_regset_copyout(&pos, &count, &kbuf, &ubuf, buf, 0, -1);
981981
}
982982

@@ -991,7 +991,7 @@ static int tm_cfpr_get(struct task_struct *target,
991991
*
992992
* This function sets in transaction checkpointed FPR registers.
993993
*
994-
* When the transaction is active 'transact_fp' holds the checkpointed
994+
* When the transaction is active 'ckfp_state' holds the checkpointed
995995
* FPR register values for the current transaction to fall back on
996996
* if it aborts in between. This function sets these checkpointed
997997
* FPR registers. The userspace interface buffer layout is as follows.
@@ -1024,8 +1024,8 @@ static int tm_cfpr_set(struct task_struct *target,
10241024
if (i)
10251025
return i;
10261026
for (i = 0; i < 32 ; i++)
1027-
target->thread.TS_TRANS_FPR(i) = buf[i];
1028-
target->thread.transact_fp.fpscr = buf[32];
1027+
target->thread.TS_CKFPR(i) = buf[i];
1028+
target->thread.ckfp_state.fpscr = buf[32];
10291029
return 0;
10301030
}
10311031

@@ -1060,7 +1060,7 @@ static int tm_cvmx_active(struct task_struct *target,
10601060
*
10611061
* This function gets in transaction checkpointed VMX registers.
10621062
*
1063-
* When the transaction is active 'transact_vr' and 'transact_vrsave' hold
1063+
* When the transaction is active 'ckvr_state' and 'ckvrsave' hold
10641064
* the checkpointed values for the current transaction to fall
10651065
* back on if it aborts in between. The userspace interface buffer
10661066
* layout is as follows.
@@ -1092,7 +1092,7 @@ static int tm_cvmx_get(struct task_struct *target,
10921092
flush_altivec_to_thread(target);
10931093

10941094
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
1095-
&target->thread.transact_vr, 0,
1095+
&target->thread.ckvr_state, 0,
10961096
33 * sizeof(vector128));
10971097
if (!ret) {
10981098
/*
@@ -1103,7 +1103,7 @@ static int tm_cvmx_get(struct task_struct *target,
11031103
u32 word;
11041104
} vrsave;
11051105
memset(&vrsave, 0, sizeof(vrsave));
1106-
vrsave.word = target->thread.transact_vrsave;
1106+
vrsave.word = target->thread.ckvrsave;
11071107
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, &vrsave,
11081108
33 * sizeof(vector128), -1);
11091109
}
@@ -1122,7 +1122,7 @@ static int tm_cvmx_get(struct task_struct *target,
11221122
*
11231123
* This function sets in transaction checkpointed VMX registers.
11241124
*
1125-
* When the transaction is active 'transact_vr' and 'transact_vrsave' hold
1125+
* When the transaction is active 'ckvr_state' and 'ckvrsave' hold
11261126
* the checkpointed values for the current transaction to fall
11271127
* back on if it aborts in between. The userspace interface buffer
11281128
* layout is as follows.
@@ -1153,7 +1153,7 @@ static int tm_cvmx_set(struct task_struct *target,
11531153
flush_altivec_to_thread(target);
11541154

11551155
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
1156-
&target->thread.transact_vr, 0,
1156+
&target->thread.ckvr_state, 0,
11571157
33 * sizeof(vector128));
11581158
if (!ret && count > 0) {
11591159
/*
@@ -1164,11 +1164,11 @@ static int tm_cvmx_set(struct task_struct *target,
11641164
u32 word;
11651165
} vrsave;
11661166
memset(&vrsave, 0, sizeof(vrsave));
1167-
vrsave.word = target->thread.transact_vrsave;
1167+
vrsave.word = target->thread.ckvrsave;
11681168
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &vrsave,
11691169
33 * sizeof(vector128), -1);
11701170
if (!ret)
1171-
target->thread.transact_vrsave = vrsave.word;
1171+
target->thread.ckvrsave = vrsave.word;
11721172
}
11731173

11741174
return ret;
@@ -1206,7 +1206,7 @@ static int tm_cvsx_active(struct task_struct *target,
12061206
*
12071207
* This function gets in transaction checkpointed VSX registers.
12081208
*
1209-
* When the transaction is active 'transact_fp' holds the checkpointed
1209+
* When the transaction is active 'ckfp_state' holds the checkpointed
12101210
* values for the current transaction to fall back on if it aborts
12111211
* in between. This function gets those checkpointed VSX registers.
12121212
* The userspace interface buffer layout is as follows.
@@ -1236,7 +1236,7 @@ static int tm_cvsx_get(struct task_struct *target,
12361236
flush_vsx_to_thread(target);
12371237

12381238
for (i = 0; i < 32 ; i++)
1239-
buf[i] = target->thread.transact_fp.fpr[i][TS_VSRLOWOFFSET];
1239+
buf[i] = target->thread.ckfp_state.fpr[i][TS_VSRLOWOFFSET];
12401240
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
12411241
buf, 0, 32 * sizeof(double));
12421242

@@ -1254,7 +1254,7 @@ static int tm_cvsx_get(struct task_struct *target,
12541254
*
12551255
* This function sets in transaction checkpointed VSX registers.
12561256
*
1257-
* When the transaction is active 'transact_fp' holds the checkpointed
1257+
* When the transaction is active 'ckfp_state' holds the checkpointed
12581258
* VSX register values for the current transaction to fall back on
12591259
* if it aborts in between. This function sets these checkpointed
12601260
* FPR registers. The userspace interface buffer layout is as follows.
@@ -1287,7 +1287,7 @@ static int tm_cvsx_set(struct task_struct *target,
12871287
buf, 0, 32 * sizeof(double));
12881288
if (!ret)
12891289
for (i = 0; i < 32 ; i++)
1290-
target->thread.transact_fp.fpr[i][TS_VSRLOWOFFSET] = buf[i];
1290+
target->thread.ckfp_state.fpr[i][TS_VSRLOWOFFSET] = buf[i];
12911291

12921292
return ret;
12931293
}

arch/powerpc/kernel/signal.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ extern int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
2323

2424
extern unsigned long copy_fpr_to_user(void __user *to,
2525
struct task_struct *task);
26-
extern unsigned long copy_transact_fpr_to_user(void __user *to,
26+
extern unsigned long copy_ckfpr_to_user(void __user *to,
2727
struct task_struct *task);
2828
extern unsigned long copy_fpr_from_user(struct task_struct *task,
2929
void __user *from);
30-
extern unsigned long copy_transact_fpr_from_user(struct task_struct *task,
30+
extern unsigned long copy_ckfpr_from_user(struct task_struct *task,
3131
void __user *from);
3232
extern unsigned long get_tm_stackpointer(struct task_struct *tsk);
3333

3434
#ifdef CONFIG_VSX
3535
extern unsigned long copy_vsx_to_user(void __user *to,
3636
struct task_struct *task);
37-
extern unsigned long copy_transact_vsx_to_user(void __user *to,
37+
extern unsigned long copy_ckvsx_to_user(void __user *to,
3838
struct task_struct *task);
3939
extern unsigned long copy_vsx_from_user(struct task_struct *task,
4040
void __user *from);
41-
extern unsigned long copy_transact_vsx_from_user(struct task_struct *task,
41+
extern unsigned long copy_ckvsx_from_user(struct task_struct *task,
4242
void __user *from);
4343
#endif
4444

0 commit comments

Comments
 (0)