Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1494961

Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until switch to userspace

From Dave Hansen <dave.hansen@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until switch to userspace
Date 2016-10-03 18:30 +0200
Message-ID <soehP-7jT-7@gated-at.bofh.it> (permalink)
References <snzy1-5k2-3@gated-at.bofh.it> <snzy1-5k2-11@gated-at.bofh.it> <snCcx-78R-21@gated-at.bofh.it> <snD8B-7O3-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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,  <riel@redhat.com> 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. :)

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH RFC 2/5] x86,fpu: delay FPU register loading until switch to userspace riel@redhat.com - 2016-10-01 23:00 +0200
  Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until switch  to userspace Andy Lutomirski <luto@amacapital.net> - 2016-10-02 01:50 +0200
    Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until  switch to userspace Rik van Riel <riel@redhat.com> - 2016-10-02 02:10 +0200
      Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until switch  to userspace Andy Lutomirski <luto@amacapital.net> - 2016-10-03 23:00 +0200
        Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until  switch to userspace Rik van Riel <riel@redhat.com> - 2016-10-03 23:30 +0200
          Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until switch  to userspace Andy Lutomirski <luto@amacapital.net> - 2016-10-03 23:40 +0200
            Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until  switch to userspace Rik van Riel <riel@redhat.com> - 2016-10-04 03:30 +0200
              Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until switch  to userspace Andy Lutomirski <luto@amacapital.net> - 2016-10-04 04:20 +0200
                Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until  switch to userspace Rik van Riel <riel@redhat.com> - 2016-10-04 04:50 +0200
                Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until switch  to userspace Andy Lutomirski <luto@amacapital.net> - 2016-10-04 05:10 +0200
                Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until switch  to userspace Ingo Molnar <mingo@kernel.org> - 2016-10-04 08:40 +0200
                Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until  switch to userspace Rik van Riel <riel@redhat.com> - 2016-10-04 14:50 +0200
            Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until  switch to userspace Rik van Riel <riel@redhat.com> - 2016-10-04 04:20 +0200
              Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until switch  to userspace Andy Lutomirski <luto@amacapital.net> - 2016-10-04 05:10 +0200
    Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until  switch to userspace Rik van Riel <riel@redhat.com> - 2016-10-02 02:50 +0200
      Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until switch  to userspace Dave Hansen <dave.hansen@linux.intel.com> - 2016-10-03 18:30 +0200

csiph-web