lkml.org 
[lkml]   [2015]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 05/11] x86,fpu: ensure FPU state is reloaded from memory if task is traced
On 01/13, Rik van Riel wrote:
>
> >> @@ -412,8 +412,14 @@ static inline void switch_fpu_prepare(struct
> >> task_struct *old, struct task_struc bool preload =
> >> tsk_used_math(new) && (use_eager_fpu() || new->thread.fpu_counter
> >> > 5); if (__thread_has_fpu(old)) { - if (!__save_init_fpu(old))
> >> + /* + * Make sure the FPU state is restored from memory next
> >> time, + * if the task has an FPU exception pending, or the
> >> task's in + * memory FPU state could be changed by a debugger.
> >> + */ + if (!__save_init_fpu(old) ||
> >> task_is_stopped_or_traced(old)) cpu = ~0;
> >
> > Well, if debugger wants to change FPU state, it should call
> > init_fpu() which resets .last_cpu ?
>
> Does the ptrace (and utrace, and ... ) code actually do that?

Yes, see xfpregs_get/set. So I think this change is not needed (but I
didn't look at the next patches).

Oleg.



\
 
 \ /
  Last update: 2015-01-13 18:01    [W:0.104 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site