Subject: Re: [patch][5/5] powerpc: Add the general support for Embedded Floating-Point instructions

From: Benjamin Herrenschmidt <[email-masked]>
Date: Sat, 13 Jan 2007 07:52:34 +1100

On Fri, 2007-01-12 at 12:39 -0600, Kumar Gala wrote:
> On Jan 12, 2007, at 5:05 AM, Benjamin Herrenschmidt wrote:
> 
> >
> >>> Why do we need a separate ret_from_except_spe_full?
> >>
> >> I'm not sure if the kernel will return from exception in a multi- 
> >> thread
> >> way, but the truth is if restoring EVRs in exsiting  
> >> ret_from_except_full,
> >> some non-SPE exception will try to retore EVR. At that time, the
> >> MSR[SPE] may not be enabled, which will cause error.
> >
> > Hrm... you can restore them before returning from the exception if you
> > are careful about doing that with preempt/irqs off I suppose.
> 
> Which is what I thought having the exception be EXC_XFER_EE and  
> flush_spe_to_thread should get you.
> 
> I dont see any reason to dirty up the 'exception' path for stuff we  
> can do in C code.

Well, doing that means that you will flush the SPE to the thread struct
and disable it, return to userland with SPE disabled, and right away
take a new exception as soon as the next SPE instruction is reached.
Maybe not optimal...

Ben.