x86/fpu: Move task_xstate_cachep handling to core.c
authorIngo Molnar <mingo@kernel.org>
Wed, 22 Apr 2015 13:41:56 +0000 (15:41 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 May 2015 13:47:19 +0000 (15:47 +0200)
This code was historically in process.c, now we have FPU core internals in
fpu/core.c instead - move it there.

Reviewed-by: Borislav 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: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/fpu-internal.h
arch/x86/kernel/fpu/core.c
arch/x86/kernel/process.c

index 95e04cb1ed2f46cc6e2fcc3161b853cc42e69d44..f41170c6d376c76a48d01870b0e6e15ab5d2f2a3 100644 (file)
@@ -564,6 +564,8 @@ static inline unsigned short get_fpu_mxcsr(struct task_struct *tsk)
        }
 }
 
+extern void fpstate_cache_init(void);
+
 extern int fpstate_alloc(struct fpu *fpu);
 
 static inline void fpstate_free(struct fpu *fpu)
index 15c3cf7bd1600975259d42277fdddf56c40db884..b32a6eb7f189428c57571ebab6d8416a70c82269 100644 (file)
@@ -147,6 +147,21 @@ void fpstate_init(struct fpu *fpu)
 }
 EXPORT_SYMBOL_GPL(fpstate_init);
 
+/*
+ * FPU state allocation:
+ */
+struct kmem_cache *task_xstate_cachep;
+EXPORT_SYMBOL_GPL(task_xstate_cachep);
+
+void fpstate_cache_init(void)
+{
+       task_xstate_cachep =
+               kmem_cache_create("task_xstate", xstate_size,
+                                 __alignof__(union thread_xstate),
+                                 SLAB_PANIC | SLAB_NOTRACK, NULL);
+       setup_xstate_comp();
+}
+
 int fpstate_alloc(struct fpu *fpu)
 {
        if (fpu->state)
index 52fd8f6f44c760246e3cb42798f17127f74fc0d2..36d9f737f278ef4ba3c882ae57143208f4274fe5 100644 (file)
@@ -75,9 +75,6 @@ void idle_notifier_unregister(struct notifier_block *n)
 EXPORT_SYMBOL_GPL(idle_notifier_unregister);
 #endif
 
-struct kmem_cache *task_xstate_cachep;
-EXPORT_SYMBOL_GPL(task_xstate_cachep);
-
 /*
  * this gets called so that we can store lazy state into memory and copy the
  * current task into the new thread.
@@ -106,11 +103,7 @@ void arch_release_task_struct(struct task_struct *tsk)
 
 void arch_task_cache_init(void)
 {
-        task_xstate_cachep =
-               kmem_cache_create("task_xstate", xstate_size,
-                                 __alignof__(union thread_xstate),
-                                 SLAB_PANIC | SLAB_NOTRACK, NULL);
-       setup_xstate_comp();
+       fpstate_cache_init();
 }
 
 /*