]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - arch/x86/kernel/process_64.c
Merge tag 'x86-core-2024-03-11' of git://git.kernel.org/pub/scm/linux/kernel/git...
[thirdparty/linux.git] / arch / x86 / kernel / process_64.c
index c075591b7b46a69ac6057a340d10c99aa516003c..7062b84dd467d62ac1aed8c4fe4bdb86d5a7ac61 100644 (file)
@@ -611,14 +611,13 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 {
        struct thread_struct *prev = &prev_p->thread;
        struct thread_struct *next = &next_p->thread;
-       struct fpu *prev_fpu = &prev->fpu;
        int cpu = smp_processor_id();
 
        WARN_ON_ONCE(IS_ENABLED(CONFIG_DEBUG_ENTRY) &&
                     this_cpu_read(pcpu_hot.hardirq_stack_inuse));
 
-       if (!test_thread_flag(TIF_NEED_FPU_LOAD))
-               switch_fpu_prepare(prev_fpu, cpu);
+       if (!test_tsk_thread_flag(prev_p, TIF_NEED_FPU_LOAD))
+               switch_fpu_prepare(prev_p, cpu);
 
        /* We must save %fs and %gs before load_TLS() because
         * %fs and %gs may be cleared by load_TLS().
@@ -672,7 +671,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
        raw_cpu_write(pcpu_hot.current_task, next_p);
        raw_cpu_write(pcpu_hot.top_of_stack, task_top_of_stack(next_p));
 
-       switch_fpu_finish();
+       switch_fpu_finish(next_p);
 
        /* Reload sp0. */
        update_task_stack(next_p);