[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090209234005.GA31577@elte.hu>
Date: Tue, 10 Feb 2009 00:40:05 +0100
From: Ingo Molnar <mingo@...e.hu>
To: Brian Gerst <brgerst@...il.com>
Cc: Tejun Heo <tj@...nel.org>, hpa@...or.com, jeremy@...p.org,
tglx@...utronix.de, linux-kernel@...r.kernel.org, x86@...nel.org,
rusty@...tcorp.com.au
Subject: Re: [PATCH 03/11] x86: fix math_emu register frame access
* Brian Gerst <brgerst@...il.com> wrote:
> On Mon, Feb 9, 2009 at 8:39 AM, Tejun Heo <tj@...nel.org> wrote:
> > 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@...nel.org>
> >
> > diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> > index afb46c0..84bdf8f 100644
> > --- a/arch/x86/kernel/traps.c
> > +++ b/arch/x86/kernel/traps.c
> > @@ -900,7 +900,7 @@ asmlinkage void math_state_restore(void)
> > EXPORT_SYMBOL_GPL(math_state_restore);
> >
> > #ifndef CONFIG_MATH_EMULATION
> > -asmlinkage void math_emulate(long arg)
> > +void math_emulate(struct math_emu_info *info)
>
> You forgot to drop the asmlinkage from the prototype in traps.h.
fixed.
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists