lkml.org 
[lkml]   [2015]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 1/2] x86, fpu: wrap get_xsave_addr() to make it safer
On 01/30, Dave Hansen wrote:
>
> +void *tsk_get_xsave_field(struct task_struct *tsk, int xsave_field)
> +{
> + union thread_xstate *xstate;
> +
> + unlazy_fpu(tsk);

ack, but to remind this depends on 2/3 I sent.

> + xstate = tsk->thread.fpu.state;
> + /*
> + * This might be unallocated if the FPU
> + * was never in use.
> + */
> + if (!xstate)
> + return NULL;

This is cosmetic, unlazy_fpu() is safe if !xstate, __thread_has_fpu()
is not possible in this case.

But perhaps

if (!used_math())
return NULL;

will look better.

Oleg.



\
 
 \ /
  Last update: 2015-01-30 19:41    [W:0.094 / U:6.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site