[lkml]   [2016]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until switch to userspace
On 10/01/2016 05:42 PM, Rik van Riel wrote:
> On Sat, 2016-10-01 at 16:44 -0700, Andy Lutomirski wrote:
>> > On Sat, Oct 1, 2016 at 1:31 PM, <> wrote:
>>> > > +static inline void switch_fpu_finish(void)
>>> > > {
>>> > > + set_thread_flag(TIF_LOAD_FPU);
>>> > > }
>> >
>> > I can imagine this causing problems with kernel code that accesses
>> > current's FPU state, e.g. get_xsave_field_ptr().
> That makes me wonder, what test programs do people have
> to verify the correctness of the FPU switching code?

The MPX testing code in selftests/ goes off the rails pretty quickly
when the FP/XSAVE state gets corrupt. It has found quite a few bugs in
the last few years. The protection keys code in there also keeps a
shadow copy of the "PKRU" register in software which also makes it
notice pretty quickly if something goes awry.

That said, I'd _love_ to see more formal FPU testing done. We've had
lots of bugs in there, and they tend to hit the newer features and newer
CPUs. Let me know if you find something. :)

 \ /
  Last update: 2016-10-03 18:23    [W:0.127 / U:1.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site