lkml.org 
[lkml]   [2010]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PATCH? process_32.c:__switch_to() calls __math_state_restore() before updating current_task
On 02/08, Suresh Siddha wrote:
>
> On Fri, 2010-02-05 at 04:44 -0800, Oleg Nesterov wrote:
> > Could you please explain me another issue? I know nothing about fpu
> > handling, I am reading this code trying to understand the unrelated
> > bug with the old kernel.
> >
> > In short: why restore_i387_xstate() does init_fpu() when !used_math(),
> > can't (or shouldn't) it merely do set_used_math() ?
> >
> > restore_i387_xstate:
> >
> > if (!used_math()) {
> > err = init_fpu(tsk);
> > if (err)
> > return err;
> > }
> >
> > note that buf != NULL. This means that used_math() was true when
> > get_sigframe() was called, otherwise buf == sigcontext->fpstate
> > would be NULL, right?
>
> No. When the signal is delivered sigcontext->fpstate can be null and
> when we return from the signal handler, user can update the
> sigcontext->fpstate pointer

Yes, I already realized this, see my next emails.

> and the user expects the kernel to update
> the fpstate of the process accordingly.

but I didn't know it is "officially" allowed to populate .xstate
this way.


Thanks Suresh for your explanations.

Oleg.



\
 
 \ /
  Last update: 2010-02-08 21:31    [W:0.058 / U:1.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site