]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
x86/fpu: Move fpu__clear() to 'struct fpu *' parameter passing
authorIngo Molnar <mingo@kernel.org>
Wed, 29 Apr 2015 18:35:33 +0000 (20:35 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 May 2015 13:48:04 +0000 (15:48 +0200)
Do it like all other high level FPU state handling functions: they
only know about struct fpu, not about the task.

(Also remove a dead prototype while at it.)

Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
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 f20a0030f6a10e6cfa844fda0d57d2314045a0e7..d6ac4611f05ef19e4ab210330ae163cee1b95864 100644 (file)
@@ -37,9 +37,8 @@ int ia32_setup_frame(int sig, struct ksignal *ksig,
 #define        MXCSR_DEFAULT           0x1f80
 
 extern unsigned int mxcsr_feature_mask;
-extern void fpu__init_cpu(void);
-extern void eager_fpu_init(void);
 
+extern void fpu__init_cpu(void);
 extern void fpu__init_system_xstate(void);
 extern void fpu__init_cpu_xstate(void);
 extern void fpu__init_system(struct cpuinfo_x86 *c);
@@ -57,7 +56,7 @@ extern void fpu__restore(void);
 extern void fpu__drop(struct fpu *fpu);
 extern int  fpu__copy(struct fpu *dst_fpu, struct fpu *src_fpu);
 extern void fpu__reset(struct fpu *fpu);
-extern void fpu__clear(struct task_struct *tsk);
+extern void fpu__clear(struct fpu *fpu);
 
 extern void fpu__init_check_bugs(void);
 extern void fpu__resume_cpu(void);
index acca83be23f04ccf91ed75ce1a981b9d54e75da3..0ccdd83488725d8bd7ed176975f935174cb54a90 100644 (file)
@@ -390,11 +390,9 @@ void fpu__reset(struct fpu *fpu)
  * Called by sys_execve() to clear the FPU fpregs, so that FPU state
  * of the previous binary does not leak over into the exec()ed binary:
  */
-void fpu__clear(struct task_struct *tsk)
+void fpu__clear(struct fpu *fpu)
 {
-       struct fpu *fpu = &tsk->thread.fpu;
-
-       WARN_ON_ONCE(tsk != current); /* Almost certainly an anomaly */
+       WARN_ON_ONCE(fpu != &current->thread.fpu); /* Almost certainly an anomaly */
 
        if (!use_eager_fpu()) {
                /* FPU state will be reallocated lazily at the first use. */
index dde263fb20313c4bf5dfbf949126f870dcc4ed15..b53f6c939bc29f380d72b969c73c52f3aa5055e7 100644 (file)
@@ -120,7 +120,7 @@ void flush_thread(void)
        flush_ptrace_hw_breakpoint(tsk);
        memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
 
-       fpu__clear(tsk);
+       fpu__clear(&tsk->thread.fpu);
 }
 
 static void hard_disable_TSC(void)