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

powerpc: Remove fp_enable() and vec_enable(), use msr_check_and_{set, clear}()

More consolidation of our MSR available bit handling.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Anton Blanchard and committed by
Michael Ellerman
1f2e25b2 3eb5d588

+4 -30
-2
arch/powerpc/include/asm/processor.h
··· 380 380 extern int get_unalign_ctl(struct task_struct *tsk, unsigned long adr); 381 381 extern int set_unalign_ctl(struct task_struct *tsk, unsigned int val); 382 382 383 - extern void fp_enable(void); 384 - extern void vec_enable(void); 385 383 extern void load_fp_state(struct thread_fp_state *fp); 386 384 extern void store_fp_state(struct thread_fp_state *fp); 387 385 extern void load_vr_state(struct thread_vr_state *vr);
-16
arch/powerpc/kernel/fpu.S
··· 77 77 #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */ 78 78 79 79 /* 80 - * Enable use of the FPU, and VSX if possible, for the caller. 81 - */ 82 - _GLOBAL(fp_enable) 83 - mfmsr r3 84 - ori r3,r3,MSR_FP 85 - #ifdef CONFIG_VSX 86 - BEGIN_FTR_SECTION 87 - oris r3,r3,MSR_VSX@h 88 - END_FTR_SECTION_IFSET(CPU_FTR_VSX) 89 - #endif 90 - SYNC 91 - MTMSRD(r3) 92 - isync /* (not necessary for arch 2.02 and later) */ 93 - blr 94 - 95 - /* 96 80 * Load state from memory into FP registers including FPSCR. 97 81 * Assumes the caller has enabled FP in the MSR. 98 82 */
+4 -2
arch/powerpc/kernel/process.c
··· 732 732 msr_diff = current->thread.ckpt_regs.msr & ~regs->msr; 733 733 msr_diff &= MSR_FP | MSR_VEC | MSR_VSX; 734 734 if (msr_diff & MSR_FP) { 735 - fp_enable(); 735 + msr_check_and_set(MSR_FP); 736 736 load_fp_state(&current->thread.fp_state); 737 + msr_check_and_clear(MSR_FP); 737 738 regs->msr |= current->thread.fpexc_mode; 738 739 } 739 740 if (msr_diff & MSR_VEC) { 740 - vec_enable(); 741 + msr_check_and_set(MSR_VEC); 741 742 load_vr_state(&current->thread.vr_state); 743 + msr_check_and_clear(MSR_VEC); 742 744 } 743 745 regs->msr |= msr_diff; 744 746 }
-10
arch/powerpc/kernel/vector.S
··· 33 33 #endif 34 34 35 35 /* 36 - * Enable use of VMX/Altivec for the caller. 37 - */ 38 - _GLOBAL(vec_enable) 39 - mfmsr r3 40 - oris r3,r3,MSR_VEC@h 41 - MTMSRD(r3) 42 - isync 43 - blr 44 - 45 - /* 46 36 * Load state from memory into VMX registers including VSCR. 47 37 * Assumes the caller has enabled VMX in the MSR. 48 38 */