File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -536,7 +536,7 @@ static inline void __fpregs_load_activate(void)
536
536
struct fpu * fpu = & current -> thread .fpu ;
537
537
int cpu = smp_processor_id ();
538
538
539
- if (WARN_ON_ONCE (current -> mm == NULL ))
539
+ if (WARN_ON_ONCE (current -> flags & PF_KTHREAD ))
540
540
return ;
541
541
542
542
if (!fpregs_state_valid (fpu , cpu )) {
@@ -567,11 +567,11 @@ static inline void __fpregs_load_activate(void)
567
567
* otherwise.
568
568
*
569
569
* The FPU context is only stored/restored for a user task and
570
- * ->mm is used to distinguish between kernel and user threads.
570
+ * PF_KTHREAD is used to distinguish between kernel and user threads.
571
571
*/
572
572
static inline void switch_fpu_prepare (struct fpu * old_fpu , int cpu )
573
573
{
574
- if (static_cpu_has (X86_FEATURE_FPU ) && current -> mm ) {
574
+ if (static_cpu_has (X86_FEATURE_FPU ) && !( current -> flags & PF_KTHREAD ) ) {
575
575
if (!copy_fpregs_to_fpstate (old_fpu ))
576
576
old_fpu -> last_cpu = -1 ;
577
577
else
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ static void __kernel_fpu_begin(void)
102
102
103
103
kernel_fpu_disable ();
104
104
105
- if (current -> mm ) {
105
+ if (!( current -> flags & PF_KTHREAD ) ) {
106
106
if (!test_thread_flag (TIF_NEED_FPU_LOAD )) {
107
107
set_thread_flag (TIF_NEED_FPU_LOAD );
108
108
/*
You can’t perform that action at this time.
0 commit comments