linux-mips
[Top] [All Lists]

Re: [PATCH 2.5] FPU

To: Vivien Chappelier <vivienc@nerim.net>
Subject: Re: [PATCH 2.5] FPU
From: Jun Sun <jsun@mvista.com>
Date: Tue, 28 Jan 2003 17:26:31 -0800
Cc: Ralf Baechle <ralf@oss.sgi.com>, linux-mips@linux-mips.org, jsun@mvista.com
In-reply-to: <20030127102929.N11633@mvista.com>; from jsun@mvista.com on Mon, Jan 27, 2003 at 10:29:29AM -0800
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <Pine.LNX.4.21.0301260251300.15950-100000@melkor> <20030127102929.N11633@mvista.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.2.5i
On Mon, Jan 27, 2003 at 10:29:29AM -0800, Jun Sun wrote:
> On Sun, Jan 26, 2003 at 02:58:09AM +0100, Vivien Chappelier wrote:
> > Hi,
> > 
> >     At various places in the 2.5 kernel, the fpu is accessed in
> > kernel mode with CU1 not set, causing an unexpected exception. This patch
> > makes sure FPU can be accessed by the kernel, though it may only
> > be a workaround. Any comment from someone with a better understanding of
> > the FPU access/context switching code?
> > 
> > Vivien.
> > 
> > --- include/asm-mips64/fpu.h        2002-12-11 20:44:20.000000000 +0100
> > +++ include/asm-mips64/fpu.h        2002-12-11 21:51:44.000000000 +0100
> > @@ -109,6 +109,7 @@
> >  
> >  static inline void save_fp(struct task_struct *tsk)
> >  {
> > +   enable_fpu();
> >     if (mips_cpu.options & MIPS_CPU_FPU) 
> >             _save_fp(tsk);
> >  }
> > --- include/asm-mips/fpu.h  2002-12-11 20:44:20.000000000 +0100
> > +++ include/asm-mips/fpu.h  2002-12-11 21:51:44.000000000 +0100
> > @@ -109,6 +109,7 @@
> >  
> >  static inline void save_fp(struct task_struct *tsk)
> >  {
> > +   enable_fpu();
> >     if (mips_cpu.options & MIPS_CPU_FPU) 
> >             _save_fp(tsk);
> >  }
> 
> The above two hunks seem to be right.
>

There are two places which call save_fp().  Just verified that in
both places current process should be fpu owner and therefore
FPU *should* be enabled.

Basically whenever current process is fpu owner, the FPU should be
enabled.  Apparently something in 2.5 breaks that fundamental assumption.
Will look into it later.

Jun

<Prev in Thread] Current Thread [Next in Thread>