diff options
author | Rik van Riel <riel@redhat.com> | 2015-02-06 15:02:03 -0500 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2015-02-19 05:15:54 -0500 |
commit | 1361ef29c7e49ae7cf37220c25fac1904b77f71a (patch) | |
tree | 1f46331d204c57730fbc58933aaea4e24cb3c342 | |
parent | 33e03dedd759cc9396252d9641b25d01909a26bb (diff) |
x86/fpu: Use an explicit if/else in switch_fpu_prepare()
Use an explicit if/else branch after __save_init_fpu(old) in
switch_fpu_prepare(). This makes substituting the assignment with a call
in task_disable_lazy_fpu_restore() in the next patch easier to review.
Signed-off-by: Rik van Riel <riel@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Link: http://lkml.kernel.org/r/1423252925-14451-7-git-send-email-riel@redhat.com
[ Space out stuff for more readability. ]
Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r-- | arch/x86/include/asm/fpu-internal.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h index 9c27f44e1c5c..04c2807aab66 100644 --- a/arch/x86/include/asm/fpu-internal.h +++ b/arch/x86/include/asm/fpu-internal.h | |||
@@ -434,13 +434,17 @@ static inline fpu_switch_t switch_fpu_prepare(struct task_struct *old, struct ta | |||
434 | * If the task has used the math, pre-load the FPU on xsave processors | 434 | * If the task has used the math, pre-load the FPU on xsave processors |
435 | * or if the past 5 consecutive context-switches used math. | 435 | * or if the past 5 consecutive context-switches used math. |
436 | */ | 436 | */ |
437 | fpu.preload = tsk_used_math(new) && (use_eager_fpu() || | 437 | fpu.preload = tsk_used_math(new) && |
438 | new->thread.fpu_counter > 5); | 438 | (use_eager_fpu() || new->thread.fpu_counter > 5); |
439 | |||
439 | if (__thread_has_fpu(old)) { | 440 | if (__thread_has_fpu(old)) { |
440 | if (!__save_init_fpu(old)) | 441 | if (!__save_init_fpu(old)) |
441 | cpu = ~0; | 442 | old->thread.fpu.last_cpu = ~0; |
442 | old->thread.fpu.last_cpu = cpu; | 443 | else |
443 | old->thread.fpu.has_fpu = 0; /* But leave fpu_owner_task! */ | 444 | old->thread.fpu.last_cpu = cpu; |
445 | |||
446 | /* But leave fpu_owner_task! */ | ||
447 | old->thread.fpu.has_fpu = 0; | ||
444 | 448 | ||
445 | /* Don't change CR0.TS if we just switch! */ | 449 | /* Don't change CR0.TS if we just switch! */ |
446 | if (fpu.preload) { | 450 | if (fpu.preload) { |