1. 24 Sep, 2017 18 commits
    • Ingo Molnar's avatar
      x86/fpu: Change fpu->fpregs_active users to fpu->fpstate_active · f1c8cd01
      Ingo Molnar authored
      We want to simplify the FPU state machine by eliminating fpu->fpregs_active,
      and we can do that because the two state flags (::fpregs_active and
      ::fpstate_active) are set essentially together.
      
      The old lazy FPU switching code used to make a distinction - but there's
      no lazy switching code anymore, we always switch in an 'eager' fashion.
      
      Do this by first changing all substantial uses of fpu->fpregs_active
      to fpu->fpstate_active and adding a few debug checks to double check
      our assumption is correct.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-19-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f1c8cd01
    • Ingo Molnar's avatar
      x86/fpu: Split the state handling in fpu__drop() · b6aa8555
      Ingo Molnar authored
      Prepare fpu__drop() to use fpu->fpregs_active.
      
      There are two distinct usecases for fpu__drop() in this context:
      exit_thread() when called for 'current' in exit(), and when called
      for another task in fork().
      
      This patch does not change behavior, it only adds a couple of
      debug checks and structures the code to make the ->fpregs_active
      change more obviously correct.
      
      All the complications will be removed later on.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-18-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      b6aa8555
    • Ingo Molnar's avatar
      x86/fpu: Make the fpu state change in fpu__clear() scheduler-atomic · a10b6a16
      Ingo Molnar authored
      Do this temporarily only, to make it easier to change the FPU state machine,
      in particular this change couples the fpu->fpregs_active and fpu->fpstate_active
      states: they are only set/cleared together (as far as the scheduler sees them).
      
      This will be removed by later patches.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-17-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      a10b6a16
    • Ingo Molnar's avatar
      x86/fpu: Simplify fpu->fpregs_active use · b3a16308
      Ingo Molnar authored
      The fpregs_active() inline function is pretty pointless - in almost
      all the callsites it can be replaced with a direct fpu->fpregs_active
      access.
      
      Do so and eliminate the extra layer of obfuscation.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-16-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      b3a16308
    • Ingo Molnar's avatar
      x86/fpu: Flip the parameter order in copy_*_to_xstate() · 6d7f7da5
      Ingo Molnar authored
      Make it more consistent with regular memcpy() semantics, where the destination
      argument comes first.
      
      No change in functionality.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-15-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      6d7f7da5
    • Ingo Molnar's avatar
      x86/fpu: Remove 'kbuf' parameter from the copy_user_to_xstate() API · 7b9094c6
      Ingo Molnar authored
      No change in functionality.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-14-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      7b9094c6
    • Ingo Molnar's avatar
      x86/fpu: Remove 'ubuf' parameter from the copy_kernel_to_xstate() API · 59dffa4e
      Ingo Molnar authored
      No change in functionality.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-13-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      59dffa4e
    • Ingo Molnar's avatar
      x86/fpu: Split copy_user_to_xstate() into copy_kernel_to_xstate() & copy_user_to_xstate() · 79fecc2b
      Ingo Molnar authored
      Similar to:
      
        x86/fpu: Split copy_xstate_to_user() into copy_xstate_to_kernel() & copy_xstate_to_user()
      
      No change in functionality.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-12-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      79fecc2b
    • Ingo Molnar's avatar
      x86/fpu: Simplify __copy_xstate_to_kernel() return values · 8c0817f4
      Ingo Molnar authored
      __copy_xstate_to_kernel() can only return 0 (because kernel copies cannot fail),
      simplify the code throughout.
      
      No change in functionality.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-11-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      8c0817f4
    • Ingo Molnar's avatar
      x86/fpu: Change 'size_total' parameter to unsigned and standardize the size... · 6ff15f8d
      Ingo Molnar authored
      x86/fpu: Change 'size_total' parameter to unsigned and standardize the size checks in copy_xstate_to_*()
      
      'size_total' is derived from an unsigned input parameter - and then converted
      to 'int' and checked for negative ranges:
      
      	if (size_total < 0 || offset < size_total) {
      
      This conversion and the checks are unnecessary obfuscation, reject overly
      large requested copy sizes outright and simplify the underlying code.
      Reported-by: default avatarRik van Riel <riel@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-10-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      6ff15f8d
    • Ingo Molnar's avatar
      x86/fpu: Clarify parameter names in the copy_xstate_to_*() methods · 56583c9a
      Ingo Molnar authored
      Right now there's a confusing mixture of 'offset' and 'size' parameters:
      
       - __copy_xstate_to_*() input parameter 'end_pos' not not really an offset,
         but the full size of the copy to be performed.
      
       - input parameter 'count' to copy_xstate_to_*() shadows that of
         __copy_xstate_to_*()'s 'count' parameter name - but the roles
         are different: the first one is the total number of bytes to
         be copied, while the second one is a partial copy size.
      
      To unconfuse all this, use a consistent set of parameter names:
      
       - 'size' is the partial copy size within a single xstate component
       - 'size_total' is the total copy requested
       - 'offset_start' is the requested starting offset.
       - 'offset' is the offset within an xstate component.
      
      No change in functionality.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-9-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      56583c9a
    • Ingo Molnar's avatar
      x86/fpu: Remove the 'start_pos' parameter from the __copy_xstate_to_*() functions · 8a5b7318
      Ingo Molnar authored
      'start_pos' is always 0, so remove it and remove the pointless check of 'pos < 0'
      which can not ever be true as 'pos' is unsigned ...
      
      No change in functionality.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-8-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      8a5b7318
    • Ingo Molnar's avatar
      x86/fpu: Clean up the parameter definitions of copy_xstate_to_*() · becb2bb7
      Ingo Molnar authored
      Remove pointless 'const' of non-pointer input parameter.
      
      Remove unnecessary parenthesis that shows uncertainty about arithmetic operator precedence.
      
      Clarify copy_xstate_to_user() description.
      
      No change in functionality.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-7-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      becb2bb7
    • Ingo Molnar's avatar
      x86/fpu: Clean up parameter order in the copy_xstate_to_*() APIs · d7eda6c9
      Ingo Molnar authored
      Parameter ordering is weird:
      
        int copy_xstate_to_kernel(unsigned int pos, unsigned int count, void *kbuf, struct xregs_state *xsave);
        int copy_xstate_to_user(unsigned int pos, unsigned int count, void __user *ubuf, struct xregs_state *xsave);
      
      'pos' and 'count', which are attributes of the destination buffer, are listed before the destination
      buffer itself ...
      
      List them after the primary arguments instead.
      
      This makes the code more similar to regular memcpy() variant APIs.
      
      No change in functionality.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-6-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      d7eda6c9
    • Ingo Molnar's avatar
      x86/fpu: Remove 'kbuf' parameter from the copy_xstate_to_user() APIs · a69c158f
      Ingo Molnar authored
      The 'kbuf' parameter is unused in the _user() side of the API, remove it.
      
      This simplifies the code and makes it easier to think about.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-5-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      a69c158f
    • Ingo Molnar's avatar
      x86/fpu: Remove 'ubuf' parameter from the copy_xstate_to_kernel() APIs · 4d981cf2
      Ingo Molnar authored
      The 'ubuf' parameter is unused in the _kernel() side of the API, remove it.
      
      This simplifies the code and makes it easier to think about.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-4-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      4d981cf2
    • Ingo Molnar's avatar
      x86/fpu: Split copy_xstate_to_user() into copy_xstate_to_kernel() & copy_xstate_to_user() · f0d4f30a
      Ingo Molnar authored
      copy_xstate_to_user() is a weird API - in part due to a bad API inherited
      from the regset APIs.
      
      But don't propagate that bad API choice into the FPU code - so as a first
      step split the API into kernel and user buffer handling routines.
      
      (Also split the xstate_copyout() internal helper.)
      
      The split API is a dumb duplication that should be obviously correct, the
      real splitting will be done in the next patch.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-3-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f0d4f30a
    • Ingo Molnar's avatar
      x86/fpu: Rename copyin_to_xsaves()/copyout_from_xsaves() to... · 656f0831
      Ingo Molnar authored
      x86/fpu: Rename copyin_to_xsaves()/copyout_from_xsaves() to copy_user_to_xstate()/copy_xstate_to_user()
      
      The 'copyin/copyout' nomenclature needlessly departs from what the modern FPU code
      uses, which is:
      
       copy_fpregs_to_fpstate()
       copy_fpstate_to_sigframe()
       copy_fregs_to_user()
       copy_fxregs_to_kernel()
       copy_fxregs_to_user()
       copy_kernel_to_fpregs()
       copy_kernel_to_fregs()
       copy_kernel_to_fxregs()
       copy_kernel_to_xregs()
       copy_user_to_fregs()
       copy_user_to_fxregs()
       copy_user_to_xregs()
       copy_xregs_to_kernel()
       copy_xregs_to_user()
      
      I.e. according to this pattern, the following rename should be done:
      
        copyin_to_xsaves()    -> copy_user_to_xstate()
        copyout_from_xsaves() -> copy_xstate_to_user()
      
      or, if we want to be pedantic, denote that that the user-space format is ptrace:
      
        copyin_to_xsaves()    -> copy_user_ptrace_to_xstate()
        copyout_from_xsaves() -> copy_xstate_to_user_ptrace()
      
      But I'd suggest the shorter, non-pedantic name.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
      Link: http://lkml.kernel.org/r/20170923130016.21448-2-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      656f0831
  2. 23 Sep, 2017 7 commits
    • Linus Torvalds's avatar
      Merge tag 'acpi-4.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · c65da8e2
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "These fix the initialization of resources in the ACPI WDAT watchdog
        driver, a recent regression in the ACPI device properties handling, a
        recent change in behavior causing the ACPI_HANDLE() macro to only work
        for GPL code and create a MAINTAINERS entry for ACPI PMIC drivers in
        order to specify the official reviewers for that code.
      
        Specifics:
      
         - Fix the initialization of resources in the ACPI WDAT watchdog
           driver that uses unititialized memory which causes compiler
           warnings to be triggered (Arnd Bergmann).
      
         - Fix a recent regression in the ACPI device properties handling that
           causes some device properties data to be skipped during enumeration
           (Sakari Ailus).
      
         - Fix a recent change in behavior that caused the ACPI_HANDLE() macro
           to stop working for non-GPL code which is a problem for the NVidia
           binary graphics driver, for example (John Hubbard).
      
         - Add a MAINTAINERS entry for the ACPI PMIC drivers to specify the
           official reviewers for that code (Rafael Wysocki)"
      
      * tag 'acpi-4.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: properties: Return _DSD hierarchical extension (data) sub-nodes correctly
        ACPI / bus: Make ACPI_HANDLE() work for non-GPL code again
        ACPI / watchdog: properly initialize resources
        ACPI / PMIC: Add code reviewers to MAINTAINERS
      c65da8e2
    • Linus Torvalds's avatar
      Merge tag 'pm-4.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 6876eb37
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These fix a cpufreq regression introduced by recent changes related to
        the generic DT driver, an initialization time memory leak in cpuidle
        on ARM, a PM core bug that may cause system suspend/resume to fail on
        some systems, a request type validation issue in the PM QoS framework
        and two documentation-related issues.
      
        Specifics:
      
         - Fix a regression in cpufreq on systems using DT as the source of
           CPU configuration information where two different code paths
           attempt to create the cpufreq-dt device object (there can be only
           one) and fix up the "compatible" matching for some TI platforms on
           top of that (Viresh Kumar, Dave Gerlach).
      
         - Fix an initialization time memory leak in cpuidle on ARM which
           occurs if the cpuidle driver initialization fails (Stefan Wahren).
      
         - Fix a PM core function that checks whether or not there are any
           system suspend/resume callbacks for a device, but forgets to check
           legacy callbacks which then may be skipped incorrectly and the
           system may crash and/or the device may become unusable after a
           suspend-resume cycle (Rafael Wysocki).
      
         - Fix request type validation for latency tolerance PM QoS requests
           which may lead to unexpected behavior (Jan Schönherr).
      
         - Fix a broken link to PM documentation from a header file and a typo
           in a PM document (Geert Uytterhoeven, Rafael Wysocki)"
      
      * tag 'pm-4.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: ti-cpufreq: Support additional am43xx platforms
        ARM: cpuidle: Avoid memleak if init fail
        cpufreq: dt-platdev: Add some missing platforms to the blacklist
        PM: core: Fix device_pm_check_callbacks()
        PM: docs: Drop an excess character from devices.rst
        PM / QoS: Use the correct variable to check the QoS request type
        driver core: Fix link to device power management documentation
      6876eb37
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · d32e5f44
      Linus Torvalds authored
      Pull input fixes from Dmitry Torokhov:
      
       - fixes for two long standing issues (lock up and a crash) in force
         feedback handling in uinput driver
      
       - tweak to firmware update timing in Elan I2C touchpad driver.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: elan_i2c - extend Flash-Write delay
        Input: uinput - avoid crash when sending FF request to device going away
        Input: uinput - avoid FF flush when destroying device
      d32e5f44
    • Linus Torvalds's avatar
      Merge tag 'seccomp-v4.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · c0a3a64e
      Linus Torvalds authored
      Pull seccomp updates from Kees Cook:
       "Major additions:
      
         - sysctl and seccomp operation to discover available actions
           (tyhicks)
      
         - new per-filter configurable logging infrastructure and sysctl
           (tyhicks)
      
         - SECCOMP_RET_LOG to log allowed syscalls (tyhicks)
      
         - SECCOMP_RET_KILL_PROCESS as the new strictest possible action
      
         - self-tests for new behaviors"
      
      [ This is the seccomp part of the security pull request during the merge
        window that was nixed due to unrelated problems   - Linus ]
      
      * tag 'seccomp-v4.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        samples: Unrename SECCOMP_RET_KILL
        selftests/seccomp: Test thread vs process killing
        seccomp: Implement SECCOMP_RET_KILL_PROCESS action
        seccomp: Introduce SECCOMP_RET_KILL_PROCESS
        seccomp: Rename SECCOMP_RET_KILL to SECCOMP_RET_KILL_THREAD
        seccomp: Action to log before allowing
        seccomp: Filter flag to log all actions except SECCOMP_RET_ALLOW
        seccomp: Selftest for detection of filter flag support
        seccomp: Sysctl to configure actions that are allowed to be logged
        seccomp: Operation for checking if an action is available
        seccomp: Sysctl to display available actions
        seccomp: Provide matching filter for introspection
        selftests/seccomp: Refactor RET_ERRNO tests
        selftests/seccomp: Add simple seccomp overhead benchmark
        selftests/seccomp: Add tests for basic ptrace actions
      c0a3a64e
    • Linus Torvalds's avatar
      Merge tag '4.14-smb3-fixes-from-recent-test-events-for-stable' of... · 69c902f5
      Linus Torvalds authored
      Merge tag '4.14-smb3-fixes-from-recent-test-events-for-stable' of git://git.samba.org/sfrench/cifs-2.6
      
      Pull cifs fixes from Steve French:
       "Various SMB3 fixes for stable and security improvements from the
        recently completed SMB3/Samba test events
      
      * tag '4.14-smb3-fixes-from-recent-test-events-for-stable' of git://git.samba.org/sfrench/cifs-2.6:
        SMB3: Don't ignore O_SYNC/O_DSYNC and O_DIRECT flags
        SMB3: handle new statx fields
        SMB: Validate negotiate (to protect against downgrade) even if signing off
        cifs: release auth_key.response for reconnect.
        cifs: release cifs root_cred after exit_cifs
        CIFS: make arrays static const, reduces object code size
        [SMB3] Update session and share information displayed for debugging SMB2/SMB3
        cifs: show 'soft' in the mount options for hard mounts
        SMB3: Warn user if trying to sign connection that authenticated as guest
        SMB3: Fix endian warning
        Fix SMB3.1.1 guest authentication to Samba
      69c902f5
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-4.14-rc2' of git://github.com/ceph/ceph-client · b03fcfae
      Linus Torvalds authored
      Pull ceph fixes from Ilya Dryomov:
       "Two small but important fixes: RADOS semantic change in upcoming v12.2.1
        release and a rare NULL dereference in create_session_open_msg()"
      
      * tag 'ceph-for-4.14-rc2' of git://github.com/ceph/ceph-client:
        ceph: avoid panic in create_session_open_msg() if utsname() returns NULL
        libceph: don't allow bidirectional swap of pg-upmap-items
      b03fcfae
    • Steve French's avatar
      SMB3: Don't ignore O_SYNC/O_DSYNC and O_DIRECT flags · 1013e760
      Steve French authored
      Signed-off-by: default avatarSteve French <smfrench@gmail.com>
      CC: Stable <stable@vger.kernel.org>
      Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
      1013e760
  3. 22 Sep, 2017 15 commits
    • Linus Torvalds's avatar
      Merge tag 'pci-v4.14-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · e2577d22
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
      
       - fix endpoint "end of test" interrupt issue (introduced in v4.14-rc1)
         (John Keeping)
      
       - fix MIPS use-after-free map_irq() issue (introduced in v4.14-rc1)
         (Lorenzo Pieralisi)
      
      * tag 'pci-v4.14-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        PCI: endpoint: Use correct "end of test" interrupt
        MIPS: PCI: Move map_irq() hooks out of initdata
      e2577d22
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 9ae0b37e
      Linus Torvalds authored
      Pull IOMMU fixes from Joerg Roedel:
      
       - two Kconfig fixes to fix dependencies that cause compile failures
         when they are not fulfilled.
      
       - a section mismatch fix for Intel VT-d
      
       - a fix for PCI topology detection in ARM device-tree code
      
      * tag 'iommu-fixes-v4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/of: Remove PCI host bridge node check
        iommu/qcom: Depend on HAS_DMA to fix compile error
        iommu/vt-d: Fix harmless section mismatch warning
        iommu: Add missing dependencies
      9ae0b37e
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile · d21b8ea7
      Linus Torvalds authored
      Pull arch/tile fixes from Chris Metcalf:
       "These are a code cleanup and config cleanup, respectively"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
        tile: array underflow in setup_maxnodemem()
        tile: defconfig: Cleanup from old Kconfig options
      d21b8ea7
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 4d9af767
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
      
       - #ifdef CONFIG_EFI around __efi_fpsimd_begin/end
      
       - Assembly code alignment reduced to 4 bytes from 16
      
       - Ensure the kernel is compiled for LP64 (there are some arm64
         compilers around defaulting to ILP32)
      
       - Fix arm_pmu_acpi memory leak on the error path
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        drivers/perf: arm_pmu_acpi: Release memory obtained by kasprintf
        arm64: ensure the kernel is compiled for LP64
        arm64: relax assembly code alignment from 16 byte to 4 byte
        arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels
      4d9af767
    • Steve French's avatar
      SMB3: handle new statx fields · 6e70e26d
      Steve French authored
      We weren't returning the creation time or the two easily supported
      attributes (ENCRYPTED or COMPRESSED) for the getattr call to
      allow statx to return these fields.
      Signed-off-by: default avatarSteve French <smfrench@gmail.com>
      Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>\
      Acked-by: default avatarJeff Layton <jlayton@poochiereds.net>
      CC: Stable <stable@vger.kernel.org>
      Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
      6e70e26d
    • Tobias Klauser's avatar
      arch: remove unused *_segments() macros/functions · c17c0204
      Tobias Klauser authored
      Some architectures define the no-op macros/functions copy_segments,
      release_segments and forget_segments. These are used nowhere in the
      tree, so removed them.
      Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
      Acked-by: Vineet Gupta <vgupta@synopsys.com>   [for arch/arc]
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c17c0204
    • Rafael J. Wysocki's avatar
      Merge branches 'acpi-pmic', 'acpi-bus', 'acpi-wdat' and 'acpi-properties' · 672d0e45
      Rafael J. Wysocki authored
      * acpi-pmic:
        ACPI / PMIC: Add code reviewers to MAINTAINERS
      
      * acpi-bus:
        ACPI / bus: Make ACPI_HANDLE() work for non-GPL code again
      
      * acpi-wdat:
        ACPI / watchdog: properly initialize resources
      
      * acpi-properties:
        ACPI: properties: Return _DSD hierarchical extension (data) sub-nodes correctly
      672d0e45
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-cpufreq' and 'pm-cpuidle' · d84c97f8
      Rafael J. Wysocki authored
      * pm-cpufreq:
        cpufreq: ti-cpufreq: Support additional am43xx platforms
        cpufreq: dt-platdev: Add some missing platforms to the blacklist
      
      * pm-cpuidle:
        ARM: cpuidle: Avoid memleak if init fail
      d84c97f8
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-core', 'pm-qos' and 'pm-docs' · 1419d033
      Rafael J. Wysocki authored
      * pm-core:
        PM: core: Fix device_pm_check_callbacks()
      
      * pm-qos:
        PM / QoS: Use the correct variable to check the QoS request type
      
      * pm-docs:
        PM: docs: Drop an excess character from devices.rst
        driver core: Fix link to device power management documentation
      1419d033
    • KT Liao's avatar
      Input: elan_i2c - extend Flash-Write delay · 05f5c385
      KT Liao authored
      The original 20ms delay is only marginally enough delay after a block write
      operation during firmware update. Let's increase the delay to ensure that
      the controller finishes up storing the page to avoid failures in the
      firmware updates.
      Signed-off-by: default avatarKT Liao <kt.liao@emc.com.tw>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      05f5c385
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.14b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 0a8abd97
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
       "A fix for a missing __init annotation and two cleanup patches"
      
      * tag 'for-linus-4.14b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen, arm64: drop dummy lookup_address()
        xen: don't compile pv-specific parts if XEN_PV isn't configured
        xen: x86: mark xen_find_pt_base as __init
      0a8abd97
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · d6396a73
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "It turns out our single-fix pull from last week was too good to be
        true. I missed a few fixes in that pull that had already come in
        because I was on leave, but also we hadn't found the bugs yet. So this
        week it's a bit bigger, though not ridiculous. Hopefully things will
        settle down from here on.
      
        Four fixes for the new instruction emulation code. A fix for CPU
        offline on bare metal machines when certain idle states are not
        supported, and a fix for a device_node refcounting oops during CPU
        hotplug, caused by recent changes.
      
        Going to stable are a fix for an oops during core dump on machines
        that have TM (Transactional Memory) disabled. Reordering some EEH
        initialisation to avoid trashing memory, and another device_node
        refcounting fix.
      
        And a few other minor things.
      
       Thanks to: Anton Blanchard, Benjamin Herrenschmidt, Cyril Bur, Gautham
       R. Shenoy, Gustavo Romero, Kamalesh Babulal, Matthew Weber, Matt Weber,
       Naveen N. Rao, Nicholas Piggin, Pavithra Prakash, Ravi Bangoria, Ronak
       Desai, Scott Wood, Tyrel Datwyler"
      
      * tag 'powerpc-4.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/pseries: Fix parent_dn reference leak in add_dt_node()
        powerpc/pseries: Fix "OF: ERROR: Bad of_node_put() on /cpus" during DLPAR
        powerpc/eeh: Create PHB PEs after EEH is initialized
        powerpc/kprobes: Update optprobes to use emulate_update_regs()
        powerpc/powernv: Clear LPCR[PECE1] via stop-api only for deep state offline
        powerpc/sstep: mullw should calculate a 64 bit signed result
        powerpc/sstep: Fix issues with mcrf
        powerpc/sstep: Fix issues with set_cr0()
        powerpc/tm: Flush TM only if CPU has TM feature
        powerpc/sysrq: Fix oops whem ppmu is not registered
        powerpc/configs: Update for CONFIG_SND changes
        powerpc/e6500: Update machine check for L1D cache err
      d6396a73
    • Linus Torvalds's avatar
      Merge branch '4.14-fixes' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 7e6d8f83
      Linus Torvalds authored
      Pull MIPS fixes from Ralf Baechle:
      
       - Fix a build error on MSP71xx which used to rely on somehow magically
         <asm/setup.h> being pulled in which no longer happens.
      
       - Fix the __write_64bit_c0_split inline assembler where there was the
         theoretical possibility of GCC interpret the constraints such that
         bad code could result.
      
       - A __init was causing section mismatch errors on Alchemy. Just to be
         on the safe side, Manuel's patch does away with all of them.
      
       - Fix perf event init.
      
      * '4.14-fixes' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        MIPS: PCI: fix pcibios_map_irq section mismatch
        MIPS: Fix input modify in __write_64bit_c0_split()
        MIPS: MSP71xx: Include asm/setup.h
        MIPS: Fix perf event init
      7e6d8f83
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · c8107ed9
      Linus Torvalds authored
      Pull s390 fixes from Martin Schwidefsky:
      
       - A couple of bug fixes: memory management, perf, cio, dasd and
         scm_blk.
      
       - A larger change in regard to the CPU topology to improve performance
         for systems running under z/VM or KVM.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/topology: enable / disable topology dynamically
        s390/topology: alternative topology for topology-less machines
        s390/mm: fix write access check in gup_huge_pmd()
        s390/mm: make pmdp_invalidate() do invalidation only
        s390/cio: recover from bad paths
        s390/scm_blk: consistently use blk_status_t as error type
        s390/dasd: fix race during dasd initialization
        s390/perf: fix bug when creating per-thread event
      c8107ed9
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 7a6d0071
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
       - Fix compiler warnings in inside-secure
       - Fix LS1021A support in caam
       - Avoid using RBP in x86 crypto code
       - Fix bug in talitos that prevents hashing with algif
       - Fix bugs talitos hashing code that cause incorrect hash result
       - Fix memory freeing path bug in drbg
       - Fix af_alg crash when two SG lists are chained
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: af_alg - update correct dst SGL entry
        crypto: caam - fix LS1021A support on ARMv7 multiplatform kernel
        crypto: inside-secure - fix gcc-4.9 warnings
        crypto: talitos - Don't provide setkey for non hmac hashing algs
        crypto: talitos - fix hashing
        crypto: talitos - fix sha224
        crypto: x86/twofish - Fix RBP usage
        crypto: sha512-avx2 - Fix RBP usage
        crypto: x86/sha256-ssse3 - Fix RBP usage
        crypto: x86/sha256-avx2 - Fix RBP usage
        crypto: x86/sha256-avx - Fix RBP usage
        crypto: x86/sha1-ssse3 - Fix RBP usage
        crypto: x86/sha1-avx2 - Fix RBP usage
        crypto: x86/des3_ede - Fix RBP usage
        crypto: x86/cast6 - Fix RBP usage
        crypto: x86/cast5 - Fix RBP usage
        crypto: x86/camellia - Fix RBP usage
        crypto: x86/blowfish - Fix RBP usage
        crypto: drbg - fix freeing of resources
      7a6d0071