diff options
author | Anton Blanchard <anton@samba.org> | 2015-10-28 20:44:00 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-11-30 21:52:25 -0500 |
commit | b51b1153d0e78a70767441273331d2de066bb929 (patch) | |
tree | 1b41562f57798ca87aa5f363c66cb3c8530e6ebf | |
parent | 611b0e5c19963374175b39f42117b03ee7573228 (diff) |
powerpc: Remove NULL task struct pointer checks in FP and vector code
We used to allow giveup_*() to be called with a NULL task struct
pointer. Now those cases are handled in the caller we can remove
the checks. We can also remove giveup_altivec_notask() which is also
unused.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/include/asm/switch_to.h | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/fpu.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/head_fsl_booke.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/vector.S | 14 |
4 files changed, 0 insertions, 19 deletions
diff --git a/arch/powerpc/include/asm/switch_to.h b/arch/powerpc/include/asm/switch_to.h index bd1d93318350..042aaf05a787 100644 --- a/arch/powerpc/include/asm/switch_to.h +++ b/arch/powerpc/include/asm/switch_to.h | |||
@@ -38,7 +38,6 @@ static inline void giveup_fpu(struct task_struct *t) { } | |||
38 | #ifdef CONFIG_ALTIVEC | 38 | #ifdef CONFIG_ALTIVEC |
39 | extern void flush_altivec_to_thread(struct task_struct *); | 39 | extern void flush_altivec_to_thread(struct task_struct *); |
40 | extern void giveup_altivec(struct task_struct *); | 40 | extern void giveup_altivec(struct task_struct *); |
41 | extern void giveup_altivec_notask(void); | ||
42 | #else | 41 | #else |
43 | static inline void flush_altivec_to_thread(struct task_struct *t) | 42 | static inline void flush_altivec_to_thread(struct task_struct *t) |
44 | { | 43 | { |
diff --git a/arch/powerpc/kernel/fpu.S b/arch/powerpc/kernel/fpu.S index 50d2352f2cf4..71bdce284ad9 100644 --- a/arch/powerpc/kernel/fpu.S +++ b/arch/powerpc/kernel/fpu.S | |||
@@ -173,8 +173,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX) | |||
173 | MTMSRD(r5) /* enable use of fpu now */ | 173 | MTMSRD(r5) /* enable use of fpu now */ |
174 | SYNC_601 | 174 | SYNC_601 |
175 | isync | 175 | isync |
176 | PPC_LCMPI 0,r3,0 | ||
177 | beqlr- /* if no previous owner, done */ | ||
178 | addi r3,r3,THREAD /* want THREAD of task */ | 176 | addi r3,r3,THREAD /* want THREAD of task */ |
179 | PPC_LL r6,THREAD_FPSAVEAREA(r3) | 177 | PPC_LL r6,THREAD_FPSAVEAREA(r3) |
180 | PPC_LL r5,PT_REGS(r3) | 178 | PPC_LL r5,PT_REGS(r3) |
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S index ec936abbcadc..d6980bbae954 100644 --- a/arch/powerpc/kernel/head_fsl_booke.S +++ b/arch/powerpc/kernel/head_fsl_booke.S | |||
@@ -992,8 +992,6 @@ _GLOBAL(giveup_spe) | |||
992 | oris r5,r5,MSR_SPE@h | 992 | oris r5,r5,MSR_SPE@h |
993 | mtmsr r5 /* enable use of SPE now */ | 993 | mtmsr r5 /* enable use of SPE now */ |
994 | isync | 994 | isync |
995 | cmpi 0,r3,0 | ||
996 | beqlr- /* if no previous owner, done */ | ||
997 | addi r3,r3,THREAD /* want THREAD of task */ | 995 | addi r3,r3,THREAD /* want THREAD of task */ |
998 | lwz r5,PT_REGS(r3) | 996 | lwz r5,PT_REGS(r3) |
999 | cmpi 0,r5,0 | 997 | cmpi 0,r5,0 |
diff --git a/arch/powerpc/kernel/vector.S b/arch/powerpc/kernel/vector.S index 1757c0c936c1..b31528c30253 100644 --- a/arch/powerpc/kernel/vector.S +++ b/arch/powerpc/kernel/vector.S | |||
@@ -111,16 +111,6 @@ _GLOBAL(load_up_altivec) | |||
111 | /* restore registers and return */ | 111 | /* restore registers and return */ |
112 | blr | 112 | blr |
113 | 113 | ||
114 | _GLOBAL(giveup_altivec_notask) | ||
115 | mfmsr r3 | ||
116 | andis. r4,r3,MSR_VEC@h | ||
117 | bnelr /* Already enabled? */ | ||
118 | oris r3,r3,MSR_VEC@h | ||
119 | SYNC | ||
120 | MTMSRD(r3) /* enable use of VMX now */ | ||
121 | isync | ||
122 | blr | ||
123 | |||
124 | /* | 114 | /* |
125 | * giveup_altivec(tsk) | 115 | * giveup_altivec(tsk) |
126 | * Disable VMX for the task given as the argument, | 116 | * Disable VMX for the task given as the argument, |
@@ -133,8 +123,6 @@ _GLOBAL(giveup_altivec) | |||
133 | SYNC | 123 | SYNC |
134 | MTMSRD(r5) /* enable use of VMX now */ | 124 | MTMSRD(r5) /* enable use of VMX now */ |
135 | isync | 125 | isync |
136 | PPC_LCMPI 0,r3,0 | ||
137 | beqlr /* if no previous owner, done */ | ||
138 | addi r3,r3,THREAD /* want THREAD of task */ | 126 | addi r3,r3,THREAD /* want THREAD of task */ |
139 | PPC_LL r7,THREAD_VRSAVEAREA(r3) | 127 | PPC_LL r7,THREAD_VRSAVEAREA(r3) |
140 | PPC_LL r5,PT_REGS(r3) | 128 | PPC_LL r5,PT_REGS(r3) |
@@ -203,8 +191,6 @@ _GLOBAL(__giveup_vsx) | |||
203 | mtmsrd r5 /* enable use of VSX now */ | 191 | mtmsrd r5 /* enable use of VSX now */ |
204 | isync | 192 | isync |
205 | 193 | ||
206 | cmpdi 0,r3,0 | ||
207 | beqlr- /* if no previous owner, done */ | ||
208 | addi r3,r3,THREAD /* want THREAD of task */ | 194 | addi r3,r3,THREAD /* want THREAD of task */ |
209 | ld r5,PT_REGS(r3) | 195 | ld r5,PT_REGS(r3) |
210 | cmpdi 0,r5,0 | 196 | cmpdi 0,r5,0 |