]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
x86: fix math_emu register frame access
authorTejun Heo <tj@kernel.org>
Mon, 9 Feb 2009 13:17:39 +0000 (22:17 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 Mar 2009 00:32:44 +0000 (17:32 -0700)
commitbf7fced49e689f01f0b5c12046e193116aa03221
treef5ef2df3685dc422a9a37d711837685b4840db94
parentbc6449f4d3b44c4a114d07315043756597f2fa72
x86: fix math_emu register frame access

commit d315760ffa261c15ff92699ac6f514112543d7ca upstream.

do_device_not_available() is the handler for #NM and it declares that
it takes a unsigned long and calls math_emu(), which takes a long
argument and surprisingly expects the stack frame starting at the zero
argument would match struct math_emu_info, which isn't true regardless
of configuration in the current code.

This patch makes do_device_not_available() take struct pt_regs like
other exception handlers and initialize struct math_emu_info with
pointer to it and pass pointer to the math_emu_info to math_emulate()
like normal C functions do.  This way, unless gcc makes a copy of
struct pt_regs in do_device_not_available(), the register frame is
correctly accessed regardless of kernel configuration or compiler
used.

This doesn't fix all math_emu problems but it at least gets it
somewhat working.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/include/asm/math_emu.h
arch/x86/include/asm/traps.h
arch/x86/kernel/traps.c
arch/x86/math-emu/fpu_entry.c
arch/x86/math-emu/fpu_proto.h
arch/x86/math-emu/fpu_system.h
arch/x86/math-emu/get_address.c