Re: FP emulator patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 16, 2001 at 02:34:45PM -0700, Jun Sun wrote:
> Yes, that is somewhat the purpose.  Essentially we want to see, at the
> beginning of a signal handler execution, the process appears to have not used
> FPU at all.

Why?

> This requirement might be a must, because whether clearing current->used_math
> bit determine which patch we will take in the do_cpu(), when signal handler
> uses FPU for the first time.  See the code below.
> 
>         if (current->used_math) {               /* Using the FPU again.  */
>                 lazy_fpu_switch(last_task_used_math);
>         } else {                                /* First time FPU user.  */
>                 init_fpu();
>                 current->used_math = 1;
>         }
>         last_task_used_math = current;
> 
> Clearly the second path is logically the correct one.

Not really.  Why should it get a clean set of FP registers?  I think
the CORRECT thing would actually be for it to have the app's FP
registers.  Changes should not propogate back to the app, that's all.

> BTW, do I see another bug here in do_cpu()?  It seems that before we call
> init_fpu(), we should check last_task_used_math.  If it is not NULL, we should
> save the FP state to the last_task_used_math.  Hmm, strange ...

I thought I got all of these... <sigh>

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux