[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150130183819.GA20732@redhat.com>
Date: Fri, 30 Jan 2015 19:38:19 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Dave Hansen <dave@...1.net>
Cc: dave.hansen@...ux.intel.com, riel@...hat.com, sbsiddha@...il.com,
luto@...capital.net, tglx@...utronix.de, mingo@...hat.com,
hpa@...or.com, fenghua.yu@...el.com, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 1/2] x86, fpu: wrap get_xsave_addr() to make it
safer
On 01/30, Oleg Nesterov wrote:
>
> 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.
at the start of this helper, I meant
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists