lkml.org 
[lkml]   [2013]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRE: X86 fpu registers in a signal handler's ucontext
Warlich, Christof writes:
> Andi Kleen <andi@firstfloor.org> writes:
> > The FP registers are restored lazily, but the state for this is kept in
> > the kernel.
>
> I'm not sure if I understand "lazily" in this context: Do you mean that FP
> registers _are_ restored within the kernel, but _not_ from a (possibly modified)
> ucontext of a userspace signal handler? If so, do you know a reason why the GP
> registers are so nicely restored from userspace, but not the FP registers?
>
> > One easy way may be to catch the FPU exception too and clear from there?
>
> Hmm - I _do_ catch SIGFPE in my userspace signal handler, but I obviously
> can't clear the FP exceptions from there. This, together with your answer
> so far, makes me conclude that there may be no way to achieve my goal from
> userspace, right :-(?

Write to the fpstate ->mxcsr and ->swd fields in the sigaction handler's uc_mcontext.


\
 
 \ /
  Last update: 2013-04-30 14:21    [W:0.066 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site