From: Oleg Nesterov <oleg@redhat.com>
To: Dave Hansen <dave@sr71.net>
Cc: dave.hansen@linux.intel.com, riel@redhat.com, sbsiddha@gmail.com,
luto@amacapital.net, tglx@linutronix.de, mingo@redhat.com,
hpa@zytor.com, fenghua.yu@intel.com, x86@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH 1/2] x86, fpu: wrap get_xsave_addr() to make it safer
Date: Fri, 30 Jan 2015 19:38:19 +0100 [thread overview]
Message-ID: <20150130183819.GA20732@redhat.com> (raw)
In-Reply-To: <20150130182805.GA20075@redhat.com>
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.
prev parent reply other threads:[~2015-01-30 18:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-30 17:43 [RFC][PATCH 1/2] x86, fpu: wrap get_xsave_addr() to make it safer Dave Hansen
2015-01-30 17:43 ` [RFC][PATCH 2/2] x86, mpx: use new tsk_get_xsave_addr() Dave Hansen
2015-01-30 18:34 ` Oleg Nesterov
2015-01-30 21:37 ` Dave Hansen
2015-01-30 18:28 ` [RFC][PATCH 1/2] x86, fpu: wrap get_xsave_addr() to make it safer Oleg Nesterov
2015-01-30 18:38 ` Oleg Nesterov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150130183819.GA20732@redhat.com \
--to=oleg@redhat.com \
--cc=dave.hansen@linux.intel.com \
--cc=dave@sr71.net \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@redhat.com \
--cc=riel@redhat.com \
--cc=sbsiddha@gmail.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.