powerpc: Add the ability to save FPU without giving it up
This patch adds the ability to be able to save the FPU registers to the thread struct without giving up (disabling the facility) next time the process returns to userspace. This patch optimises the thread copy path (as a result of a fork() or clone()) so that the parent thread can return to userspace with hot registers avoiding a possibly pointless reload of FPU register state. Signed-off-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
de2a20aa72
commit
8792468da5
@@ -28,13 +28,14 @@ extern void giveup_all(struct task_struct *);
|
||||
extern void enable_kernel_fp(void);
|
||||
extern void flush_fp_to_thread(struct task_struct *);
|
||||
extern void giveup_fpu(struct task_struct *);
|
||||
extern void __giveup_fpu(struct task_struct *);
|
||||
extern void save_fpu(struct task_struct *);
|
||||
static inline void disable_kernel_fp(void)
|
||||
{
|
||||
msr_check_and_clear(MSR_FP);
|
||||
}
|
||||
#else
|
||||
static inline void __giveup_fpu(struct task_struct *t) { }
|
||||
static inline void save_fpu(struct task_struct *t) { }
|
||||
static inline void flush_fp_to_thread(struct task_struct *t) { }
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user