[patch][5/5] powerpc: Add the general support for Embedded Floating-Point instructions
Kumar Gala
galak at kernel.crashing.org
Sat Jan 13 08:18:15 EST 2007
On Jan 12, 2007, at 2:52 PM, Benjamin Herrenschmidt wrote:
> 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...
Well we could reload the registers on exit if wanted to. Also, if
want to be more efficient, we should only flush the registers we need.
I think its a fair assumption that nothing is going to interrupt the
handling of the exception, so its safe to assume the process causing
the interrupt will be the same one we return to.
- k
More information about the Linuxppc-dev
mailing list