Re: [PATCH 01/17] x86, fpu: wrap get_xsave_addr() to make it safer

Oleg Nesterov
2015-03-25T17:13:36Z

Hi Dave,

On 03/25, Dave Hansen wrote:
>
> It may get
> called on CPUs without eager FPU mode on.
>
> > http://git.kernel.org/cgit/linux/kernel/git/daveh/x86-mpx.git/commit/?h=mpx-v16&id=92d3e7c1664f766142904904e27e126888adb8a7
> > http://git.kernel.org/cgit/linux/kernel/git/daveh/x86-mpx.git/commit/?h=mpx-v16&id=18049953ae43a7ffa084a01613c1684bdf24dd2e
>
> All that the MPX code wants here is to read the in-memory copy of the
> MPX registers, or error out.

Yes, iirc we alredy discussed these fixes ?

I still think that the "if (!xstate)" check at the start of
tsk_get_xsave_field() will look better, but this is cosmetic.

> So, for the purposes of this series:
>
> With the (so far unmerged to Linus's tree) changes to unlazy_fpu(), does
> tsk_get_xsave_field()'s use of unlazy_fpu() look correct?

I think yes. But let me remind just in case that this depends on
"x86, fpu: unlazy_fpu: don't do __thread_fpu_end() if use_eager_fpu()".

> Should we also be renaming tsk_get_xsave_field() to something more
> appropriate?

Oh, don't ask me ;) To me it looks fine.

Oleg.