Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0c050c5 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

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: default avatarBorislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 36fe6175
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -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
+5 −0
Original line number Diff line number Diff line
@@ -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));