diff options
Diffstat (limited to 'arch/x86/kernel/process.c')
| -rw-r--r-- | arch/x86/kernel/process.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 8213da62b1b7..6e338e3b1dc0 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
| @@ -57,7 +57,7 @@ __visible DEFINE_PER_CPU_SHARED_ALIGNED(struct tss_struct, cpu_tss) = { | |||
| 57 | .io_bitmap = { [0 ... IO_BITMAP_LONGS] = ~0 }, | 57 | .io_bitmap = { [0 ... IO_BITMAP_LONGS] = ~0 }, |
| 58 | #endif | 58 | #endif |
| 59 | }; | 59 | }; |
| 60 | EXPORT_PER_CPU_SYMBOL_GPL(cpu_tss); | 60 | EXPORT_PER_CPU_SYMBOL(cpu_tss); |
| 61 | 61 | ||
| 62 | #ifdef CONFIG_X86_64 | 62 | #ifdef CONFIG_X86_64 |
| 63 | static DEFINE_PER_CPU(unsigned char, is_idle); | 63 | static DEFINE_PER_CPU(unsigned char, is_idle); |
| @@ -156,11 +156,13 @@ void flush_thread(void) | |||
| 156 | /* FPU state will be reallocated lazily at the first use. */ | 156 | /* FPU state will be reallocated lazily at the first use. */ |
| 157 | drop_fpu(tsk); | 157 | drop_fpu(tsk); |
| 158 | free_thread_xstate(tsk); | 158 | free_thread_xstate(tsk); |
| 159 | } else if (!used_math()) { | 159 | } else { |
| 160 | /* kthread execs. TODO: cleanup this horror. */ | 160 | if (!tsk_used_math(tsk)) { |
| 161 | if (WARN_ON(init_fpu(tsk))) | 161 | /* kthread execs. TODO: cleanup this horror. */ |
| 162 | force_sig(SIGKILL, tsk); | 162 | if (WARN_ON(init_fpu(tsk))) |
| 163 | user_fpu_begin(); | 163 | force_sig(SIGKILL, tsk); |
| 164 | user_fpu_begin(); | ||
| 165 | } | ||
| 164 | restore_init_xstate(); | 166 | restore_init_xstate(); |
| 165 | } | 167 | } |
| 166 | } | 168 | } |
