Commit 8ffb53ab authored by Ingo Molnar's avatar Ingo Molnar

x86/fpu: Move task_xstate_cachep handling to core.c

This code was historically in process.c, now we have FPU core internals in
fpu/core.c instead - move it there.
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 0afc4a94
...@@ -564,6 +564,8 @@ static inline unsigned short get_fpu_mxcsr(struct task_struct *tsk) ...@@ -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); extern int fpstate_alloc(struct fpu *fpu);
static inline void fpstate_free(struct fpu *fpu) static inline void fpstate_free(struct fpu *fpu)
......
...@@ -147,6 +147,21 @@ void fpstate_init(struct fpu *fpu) ...@@ -147,6 +147,21 @@ void fpstate_init(struct fpu *fpu)
} }
EXPORT_SYMBOL_GPL(fpstate_init); 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) int fpstate_alloc(struct fpu *fpu)
{ {
if (fpu->state) if (fpu->state)
......
...@@ -75,9 +75,6 @@ void idle_notifier_unregister(struct notifier_block *n) ...@@ -75,9 +75,6 @@ void idle_notifier_unregister(struct notifier_block *n)
EXPORT_SYMBOL_GPL(idle_notifier_unregister); EXPORT_SYMBOL_GPL(idle_notifier_unregister);
#endif #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 * this gets called so that we can store lazy state into memory and copy the
* current task into the new thread. * current task into the new thread.
...@@ -106,11 +103,7 @@ void arch_release_task_struct(struct task_struct *tsk) ...@@ -106,11 +103,7 @@ void arch_release_task_struct(struct task_struct *tsk)
void arch_task_cache_init(void) void arch_task_cache_init(void)
{ {
task_xstate_cachep = fpstate_cache_init();
kmem_cache_create("task_xstate", xstate_size,
__alignof__(union thread_xstate),
SLAB_PANIC | SLAB_NOTRACK, NULL);
setup_xstate_comp();
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment