From: Ingo Molnar Date: Thu, 23 Apr 2015 10:13:04 +0000 (+0200) Subject: x86/fpu: Move 'PER_CPU(fpu_owner_task)' to fpu/core.c X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b0c050c5ba130c0ccb1b86b64f162a4601d160c7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git x86/fpu: Move 'PER_CPU(fpu_owner_task)' to fpu/core.c Move it closer to other per-cpu FPU data structures. This also unifies the 32-bit and 64-bit code. Reviewed-by: Borislav Petkov Cc: Andy Lutomirski Cc: Dave Hansen Cc: Fenghua Yu Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Thomas Gleixner Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 220ad95e0e28..88bb7a75f5c6 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1182,8 +1182,6 @@ DEFINE_PER_CPU(unsigned int, irq_count) __visible = -1; DEFINE_PER_CPU(int, __preempt_count) = INIT_PREEMPT_COUNT; EXPORT_PER_CPU_SYMBOL(__preempt_count); -DEFINE_PER_CPU(struct task_struct *, fpu_owner_task); - /* * Special IST stacks which the CPU switches to when it calls * an IST-marked descriptor entry. Up to 7 stacks (hardware @@ -1274,7 +1272,6 @@ DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task; EXPORT_PER_CPU_SYMBOL(current_task); DEFINE_PER_CPU(int, __preempt_count) = INIT_PREEMPT_COUNT; EXPORT_PER_CPU_SYMBOL(__preempt_count); -DEFINE_PER_CPU(struct task_struct *, fpu_owner_task); /* * On x86_32, vm86 modifies tss.sp0, so sp0 isn't a reliable way to find diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c index 29b837730a07..d29fec70e6b3 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c @@ -20,6 +20,11 @@ */ static DEFINE_PER_CPU(bool, in_kernel_fpu); +/* + * Track which task is using the FPU on the CPU: + */ +DEFINE_PER_CPU(struct task_struct *, fpu_owner_task); + static void kernel_fpu_disable(void) { WARN_ON(this_cpu_read(in_kernel_fpu));