From: Ingo Molnar Date: Wed, 22 Apr 2015 13:41:56 +0000 (+0200) Subject: x86/fpu: Move task_xstate_cachep handling to core.c X-Git-Tag: omap-for-v4.3/legacy-v2-signed~203^2~218 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ffb53ab986ccb4421b1060182c6e084edd7b9d8;p=pandora-kernel.git 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: 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/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h index 95e04cb1ed2f..f41170c6d376 100644 --- a/arch/x86/include/asm/fpu-internal.h +++ b/arch/x86/include/asm/fpu-internal.h @@ -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) diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c index 15c3cf7bd160..b32a6eb7f189 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c @@ -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) Reading git-diff-tree failed