powerpc: Create disable_kernel_{fp,altivec,vsx,spe}()

The enable_kernel_*() functions leave the relevant MSR bits enabled
until we exit the kernel sometime later. Create disable versions
that wrap the kernel use of FP, Altivec VSX or SPE.

While we don't want to disable it normally for performance reasons
(MSR writes are slow), it will be used for a debug boot option that
does this and catches bad uses in other areas of the kernel.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Anton Blanchard
2015-10-29 11:44:05 +11:00
committed by Michael Ellerman
parent a0e72cf12b
commit dc4fbba11e
15 changed files with 39 additions and 0 deletions

View File

@@ -26,6 +26,11 @@ extern void enable_kernel_spe(void);
extern void load_up_spe(struct task_struct *);
extern void switch_booke_debug_regs(struct debug_reg *new_debug);
static inline void disable_kernel_fp(void) { }
static inline void disable_kernel_altivec(void) { }
static inline void disable_kernel_spe(void) { }
static inline void disable_kernel_vsx(void) { }
#ifdef CONFIG_PPC_FPU
extern void flush_fp_to_thread(struct task_struct *);
extern void giveup_fpu(struct task_struct *);