Daniel Glöckner ab9e18587f x86, math-emu: fix init_fpu for task != current
Impact: fix math-emu related crash while using GDB/ptrace

init_fpu() calls finit to initialize a task's xstate, while finit always
works on the current task. If we use PTRACE_GETFPREGS on another
process and both processes did not already use floating point, we get
a null pointer exception in finit.

This patch creates a new function finit_task that takes a task_struct
parameter. finit becomes a wrapper that simply calls finit_task with
current. On the plus side this avoids many calls to get_current which
would each resolve to an inline assembler mov instruction.

An empty finit_task has been added to i387.h to avoid linker errors in
case the compiler still emits the call in init_fpu when
CONFIG_MATH_EMULATION is not defined.

The declaration of finit in i387.h has been removed as the remaining
code using this function gets its prototype from fpu_proto.h.

Signed-off-by: Daniel Glöckner <dg@emlix.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: "Pallipadi Venkatesh" <venkatesh.pallipadi@intel.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Bill Metzenthen <billm@melbpc.org.au>
LKML-Reference: <E1Lew31-0004il-Fg@mailer.emlix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-03-04 20:33:16 +01:00
..
2008-12-30 13:31:37 -08:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-12-20 09:15:46 +01:00
2009-01-31 00:16:22 +05:30
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-12-12 11:58:36 +01:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:20 -07:00
2008-12-08 14:31:52 +01:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2009-01-03 14:11:07 +01:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2009-01-31 00:17:13 +05:30
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2009-01-31 00:17:39 +05:30
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2009-01-23 18:42:06 +01:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:20 -07:00
2009-02-09 14:56:39 +01:00
2008-10-22 22:55:23 -07:00
2008-12-20 09:15:46 +01:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-12-16 19:31:52 +01:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-12-31 16:52:28 +02:00
2009-01-31 00:19:32 +05:30
2008-10-22 22:55:23 -07:00
2008-12-29 13:18:40 +01:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2009-01-25 16:57:47 +01:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-11-09 21:05:43 +01:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-11-19 18:49:57 -08:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-12-14 16:24:38 -08:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:20 -07:00
2008-10-22 22:55:20 -07:00