1. 11 Apr, 2019 2 commits
  2. 10 Apr, 2019 6 commits
    • Sebastian Andrzej Siewior's avatar
      x86/fpu: Use a feature number instead of mask in two more helpers · abd16d68
      Sebastian Andrzej Siewior authored
      After changing the argument of __raw_xsave_addr() from a mask to
      number Dave suggested to check if it makes sense to do the same for
      get_xsave_addr(). As it turns out it does.
      
      Only get_xsave_addr() needs the mask to check if the requested feature
      is part of what is supported/saved and then uses the number again. The
      shift operation is cheaper compared to fls64() (find last bit set).
      Also, the feature number uses less opcode space compared to the mask. :)
      
      Make the get_xsave_addr() argument a xfeature number instead of a mask
      and fix up its callers.
      
      Furthermore, use xfeature_nr and xfeature_mask consistently.
      
      This results in the following changes to the kvm code:
      
        feature -> xfeature_mask
        index -> xfeature_nr
      Suggested-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarDave Hansen <dave.hansen@intel.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
      Cc: kvm ML <kvm@vger.kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Siarhei Liakh <Siarhei.Liakh@concurrent-rt.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190403164156.19645-12-bigeasy@linutronix.de
      abd16d68
    • Sebastian Andrzej Siewior's avatar
      x86/fpu: Make __raw_xsave_addr() use a feature number instead of mask · 07baeb04
      Sebastian Andrzej Siewior authored
      Most users of __raw_xsave_addr() use a feature number, shift it to a
      mask and then __raw_xsave_addr() shifts it back to the feature number.
      
      Make __raw_xsave_addr() use the feature number as an argument.
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarDave Hansen <dave.hansen@intel.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
      Cc: kvm ML <kvm@vger.kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190403164156.19645-11-bigeasy@linutronix.de
      07baeb04
    • Rik van Riel's avatar
      x86/fpu: Add an __fpregs_load_activate() internal helper · 4ee91519
      Rik van Riel authored
      Add a helper function that ensures the floating point registers for the
      current task are active. Use with preemption disabled.
      
      While at it, add fpregs_lock/unlock() helpers too, to be used in later
      patches.
      
       [ bp: Add a comment about its intended usage. ]
      Signed-off-by: default avatarRik van Riel <riel@surriel.com>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarDave Hansen <dave.hansen@intel.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Aubrey Li <aubrey.li@intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
      Cc: kvm ML <kvm@vger.kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190403164156.19645-10-bigeasy@linutronix.de
      4ee91519
    • Sebastian Andrzej Siewior's avatar
      x86/fpu: Remove user_fpu_begin() · 0169f53e
      Sebastian Andrzej Siewior authored
      user_fpu_begin() sets fpu_fpregs_owner_ctx to task's fpu struct. This is
      always the case since there is no lazy FPU anymore.
      
      fpu_fpregs_owner_ctx is used during context switch to decide if it needs
      to load the saved registers or if the currently loaded registers are
      valid. It could be skipped during a
      
        taskA -> kernel thread -> taskA
      
      switch because the switch to the kernel thread would not alter the CPU's
      sFPU tate.
      
      Since this field is always updated during context switch and
      never invalidated, setting it manually (in user context) makes no
      difference. A kernel thread with kernel_fpu_begin() block could
      set fpu_fpregs_owner_ctx to NULL but a kernel thread does not use
      user_fpu_begin().
      
      This is a leftover from the lazy-FPU time.
      
      Remove user_fpu_begin(), it does not change fpu_fpregs_owner_ctx's
      content.
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarDave Hansen <dave.hansen@intel.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Aubrey Li <aubrey.li@intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
      Cc: kvm ML <kvm@vger.kernel.org>
      Cc: Nicolai Stange <nstange@suse.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190403164156.19645-9-bigeasy@linutronix.de
      0169f53e
    • Sebastian Andrzej Siewior's avatar
      x86/fpu: Remove fpu->initialized · 2722146e
      Sebastian Andrzej Siewior authored
      The struct fpu.initialized member is always set to one for user tasks
      and zero for kernel tasks. This avoids saving/restoring the FPU
      registers for kernel threads.
      
      The ->initialized = 0 case for user tasks has been removed in previous
      changes, for instance, by doing an explicit unconditional init at fork()
      time for FPU-less systems which was otherwise delayed until the emulated
      opcode.
      
      The context switch code (switch_fpu_prepare() + switch_fpu_finish())
      can't unconditionally save/restore registers for kernel threads. Not
      only would it slow down the switch but also load a zeroed xcomp_bv for
      XSAVES.
      
      For kernel_fpu_begin() (+end) the situation is similar: EFI with runtime
      services uses this before alternatives_patched is true. Which means that
      this function is used too early and it wasn't the case before.
      
      For those two cases, use current->mm to distinguish between user and
      kernel thread. For kernel_fpu_begin() skip save/restore of the FPU
      registers.
      
      During the context switch into a kernel thread don't do anything. There
      is no reason to save the FPU state of a kernel thread.
      
      The reordering in __switch_to() is important because the current()
      pointer needs to be valid before switch_fpu_finish() is invoked so ->mm
      is seen of the new task instead the old one.
      
      N.B.: fpu__save() doesn't need to check ->mm because it is called by
      user tasks only.
      
       [ bp: Massage. ]
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarDave Hansen <dave.hansen@intel.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Aubrey Li <aubrey.li@intel.com>
      Cc: Babu Moger <Babu.Moger@amd.com>
      Cc: "Chang S. Bae" <chang.seok.bae@intel.com>
      Cc: Dmitry Safonov <dima@arista.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: kvm ML <kvm@vger.kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Nicolai Stange <nstange@suse.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190403164156.19645-8-bigeasy@linutronix.de
      2722146e
    • Sebastian Andrzej Siewior's avatar
      x86/fpu: Don't save fxregs for ia32 frames in copy_fpstate_to_sigframe() · 39388e80
      Sebastian Andrzej Siewior authored
      In commit
      
        72a671ce ("x86, fpu: Unify signal handling code paths for x86 and x86_64 kernels")
      
      the 32bit and 64bit path of the signal delivery code were merged.
      
      The 32bit version:
      
        int save_i387_xstate_ia32(void __user *buf)
        …
               if (cpu_has_xsave)
                       return save_i387_xsave(fp);
               if (cpu_has_fxsr)
                       return save_i387_fxsave(fp);
      
      The 64bit version:
      
        int save_i387_xstate(void __user *buf)
        …
               if (user_has_fpu()) {
                       if (use_xsave())
                               err = xsave_user(buf);
                       else
                               err = fxsave_user(buf);
      
                       if (unlikely(err)) {
                               __clear_user(buf, xstate_size);
                               return err;
      
      The merge:
      
        int save_xstate_sig(void __user *buf, void __user *buf_fx, int size)
        …
               if (user_has_fpu()) {
                       /* Save the live register state to the user directly. */
                       if (save_user_xstate(buf_fx))
                               return -1;
                       /* Update the thread's fxstate to save the fsave header. */
                       if (ia32_fxstate)
                               fpu_fxsave(&tsk->thread.fpu);
      
      I don't think that we needed to save the FPU registers to ->thread.fpu
      because the registers were stored in buf_fx. Today the state will be
      restored from buf_fx after the signal was handled (I assume that this
      was also the case with lazy-FPU).
      
      Since commit
      
        66463db4 ("x86, fpu: shift drop_init_fpu() from save_xstate_sig() to handle_signal()")
      
      it is ensured that the signal handler starts with clear/fresh set of FPU
      registers which means that the previous store is futile.
      
      Remove the copy_fxregs_to_kernel() call because task's FPU state is
      cleared later in handle_signal() via fpu__clear().
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarDave Hansen <dave.hansen@intel.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
      Cc: kvm ML <kvm@vger.kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190403164156.19645-7-bigeasy@linutronix.de
      39388e80
  3. 09 Apr, 2019 5 commits
    • Sebastian Andrzej Siewior's avatar
      x86/fpu: Remove fpu->initialized usage in copy_fpstate_to_sigframe() · fbcc9e0c
      Sebastian Andrzej Siewior authored
      With lazy-FPU support the (now named variable) ->initialized was set to
      true if the CPU's FPU registers were holding a valid state of the
      FPU registers for the active process. If it was set to false then the
      FPU state was saved in fpu->state and the FPU was deactivated.
      
      With lazy-FPU gone, ->initialized is always true for user threads and
      kernel threads never call this function so ->initialized is always true
      in copy_fpstate_to_sigframe().
      
      The using_compacted_format() check is also a leftover from the lazy-FPU
      time. In the
      
        ->initialized == false
      
      case copy_to_user() would copy the compacted buffer while userland would
      expect the non-compacted format instead. So in order to save the FPU
      state in the non-compacted form it issues XSAVE to save the *current*
      FPU state.
      
      If the FPU is not enabled, the attempt raises the FPU trap, the trap
      restores the FPU contents and re-enables the FPU and XSAVE is invoked
      again and succeeds.
      
      *This* does not longer work since commit
      
        bef8b6da ("x86/fpu: Handle #NM without FPU emulation as an error")
      
      Remove the check for ->initialized because it is always true and remove
      the false condition. Update the comment to reflect that the state is
      always live.
      
       [ bp: Massage. ]
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarDave Hansen <dave.hansen@intel.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
      Cc: kvm ML <kvm@vger.kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190403164156.19645-6-bigeasy@linutronix.de
      fbcc9e0c
    • Sebastian Andrzej Siewior's avatar
      x86/fpu: Always init the state in fpu__clear() · 88f5260a
      Sebastian Andrzej Siewior authored
      fpu__clear() only initializes the state if the CPU has FPU support.
      This initialisation is also required for FPU-less systems and takes
      place in math_emulate(). Since fpu__initialize() only performs the
      initialization if ->initialized is zero it does not matter that it
      is invoked each time an opcode is emulated. It makes the removal of
      ->initialized easier if the struct is also initialized in the FPU-less
      case at the same time.
      
      Move fpu__initialize() before the FPU feature check so it is also
      performed in the FPU-less case too.
      
       [ bp: Massage a bit. ]
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarDave Hansen <dave.hansen@intel.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Aubrey Li <aubrey.li@intel.com>
      Cc: Bill Metzenthen <billm@melbpc.org.au>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
      Cc: kvm ML <kvm@vger.kernel.org>
      Cc: Nicolai Stange <nstange@suse.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190403164156.19645-5-bigeasy@linutronix.de
      88f5260a
    • Sebastian Andrzej Siewior's avatar
      x86/fpu: Remove preempt_disable() in fpu__clear() · 60e528d6
      Sebastian Andrzej Siewior authored
      The preempt_disable() section was introduced in commit
      
        a10b6a16 ("x86/fpu: Make the fpu state change in fpu__clear() scheduler-atomic")
      
      and it was said to be temporary.
      
      fpu__initialize() initializes the FPU struct to its initial value and
      then sets ->initialized to 1. The last part is the important one.
      The content of the state does not matter because it gets set via
      copy_init_fpstate_to_fpregs().
      
      A preemption here has little meaning because the registers will always be
      set to the same content after copy_init_fpstate_to_fpregs(). A softirq
      with a kernel_fpu_begin() could also force to save FPU's registers after
      fpu__initialize() without changing the outcome here.
      
      Remove the preempt_disable() section in fpu__clear(), preemption here
      does not hurt.
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarDave Hansen <dave.hansen@intel.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
      Cc: kvm ML <kvm@vger.kernel.org>
      Cc: Nicolai Stange <nstange@suse.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190403164156.19645-4-bigeasy@linutronix.de
      60e528d6
    • Sebastian Andrzej Siewior's avatar
      x86/fpu: Remove fpu__restore() · 6dd677a0
      Sebastian Andrzej Siewior authored
      There are no users of fpu__restore() so it is time to remove it. The
      comment regarding fpu__restore() and TS bit is stale since commit
      
        b3b0870e ("i387: do not preload FPU state at task switch time")
      
      and has no meaning since.
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarDave Hansen <dave.hansen@intel.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Aubrey Li <aubrey.li@intel.com>
      Cc: Babu Moger <Babu.Moger@amd.com>
      Cc: "Chang S. Bae" <chang.seok.bae@intel.com>
      Cc: Dmitry Safonov <dima@arista.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: kvm ML <kvm@vger.kernel.org>
      Cc: linux-doc@vger.kernel.org
      Cc: Nicolai Stange <nstange@suse.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190403164156.19645-3-bigeasy@linutronix.de
      6dd677a0
    • Sebastian Andrzej Siewior's avatar
      x86/fpu: Remove fpu->initialized usage in __fpu__restore_sig() · 39ea9baf
      Sebastian Andrzej Siewior authored
      This is a preparation for the removal of the ->initialized member in the
      fpu struct.
      
      __fpu__restore_sig() is deactivating the FPU via fpu__drop() and then
      setting manually ->initialized followed by fpu__restore(). The result is
      that it is possible to manipulate fpu->state and the state of registers
      won't be saved/restored on a context switch which would overwrite
      fpu->state:
      
      fpu__drop(fpu):
        ...
        fpu->initialized = 0;
        preempt_enable();
      
        <--- context switch
      
      Don't access the fpu->state while the content is read from user space
      and examined/sanitized. Use a temporary kmalloc() buffer for the
      preparation of the FPU registers and once the state is considered okay,
      load it. Should something go wrong, return with an error and without
      altering the original FPU registers.
      
      The removal of fpu__initialize() is a nop because fpu->initialized is
      already set for the user task.
      
       [ bp: Massage a bit. ]
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarDave Hansen <dave.hansen@intel.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
      Cc: kvm ML <kvm@vger.kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190403164156.19645-2-bigeasy@linutronix.de
      39ea9baf
  4. 03 Apr, 2019 1 commit
    • Jann Horn's avatar
      x86/fpu: Fix __user annotations · 89833fab
      Jann Horn authored
      In save_xstate_epilog(), use __user when type-casting userspace
      pointers.
      
      In setup_sigcontext() and x32_setup_rt_frame(), cast the userspace
      pointers to 'unsigned long __user *' before writing into them. These
      pointers are originally '__u32 __user *' or '__u64 __user *', causing
      sparse to complain when a userspace pointer is written into them. The
      casts are okay because the pointers always point to pointer-sized
      values.
      
      Thanks to Luc Van Oostenryck and Al Viro for explaining this to me.
      Signed-off-by: default avatarJann Horn <jannh@google.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Mukesh Ojha <mojha@codeaurora.org>
      Cc: Qiaowei Ren <qiaowei.ren@intel.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190329214652.258477-3-jannh@google.com
      89833fab
  5. 31 Mar, 2019 9 commits
    • Linus Torvalds's avatar
      Linux 5.1-rc3 · 79a3aaa7
      Linus Torvalds authored
      79a3aaa7
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 63fc9c23
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
       "A collection of x86 and ARM bugfixes, and some improvements to
        documentation.
      
        On top of this, a cleanup of kvm_para.h headers, which were exported
        by some architectures even though they not support KVM at all. This is
        responsible for all the Kbuild changes in the diffstat"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (28 commits)
        Documentation: kvm: clarify KVM_SET_USER_MEMORY_REGION
        KVM: doc: Document the life cycle of a VM and its resources
        KVM: selftests: complete IO before migrating guest state
        KVM: selftests: disable stack protector for all KVM tests
        KVM: selftests: explicitly disable PIE for tests
        KVM: selftests: assert on exit reason in CR4/cpuid sync test
        KVM: x86: update %rip after emulating IO
        x86/kvm/hyper-v: avoid spurious pending stimer on vCPU init
        kvm/x86: Move MSR_IA32_ARCH_CAPABILITIES to array emulated_msrs
        KVM: x86: Emulate MSR_IA32_ARCH_CAPABILITIES on AMD hosts
        kvm: don't redefine flags as something else
        kvm: mmu: Used range based flushing in slot_handle_level_range
        KVM: export <linux/kvm_para.h> and <asm/kvm_para.h> iif KVM is supported
        KVM: x86: remove check on nr_mmu_pages in kvm_arch_commit_memory_region()
        kvm: nVMX: Add a vmentry check for HOST_SYSENTER_ESP and HOST_SYSENTER_EIP fields
        KVM: SVM: Workaround errata#1096 (insn_len maybe zero on SMAP violation)
        KVM: Reject device ioctls from processes other than the VM's creator
        KVM: doc: Fix incorrect word ordering regarding supported use of APIs
        KVM: x86: fix handling of role.cr4_pae and rename it to 'gpte_size'
        KVM: nVMX: Do not inherit quadrant and invalid for the root shadow EPT
        ...
      63fc9c23
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 915ee0da
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A pile of x86 updates:
      
         - Prevent exceeding he valid physical address space in the /dev/mem
           limit checks.
      
         - Move all header content inside the header guard to prevent compile
           failures.
      
         - Fix the bogus __percpu annotation in this_cpu_has() which makes
           sparse very noisy.
      
         - Disable switch jump tables completely when retpolines are enabled.
      
         - Prevent leaking the trampoline address"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/realmode: Make set_real_mode_mem() static inline
        x86/cpufeature: Fix __percpu annotation in this_cpu_has()
        x86/mm: Don't exceed the valid physical address space
        x86/retpolines: Disable switch jump tables when retpolines are enabled
        x86/realmode: Don't leak the trampoline kernel address
        x86/boot: Fix incorrect ifdeffery scope
        x86/resctrl: Remove unused variable
      915ee0da
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 590627f7
      Linus Torvalds authored
      Pull perf tooling fixes from Thomas Gleixner:
       "Core libraries:
         - Fix max perf_event_attr.precise_ip detection.
         - Fix parser error for uncore event alias
         - Fixup ordering of kernel maps after obtaining the main kernel map
           address.
      
        Intel PT:
         - Fix TSC slip where A TSC packet can slip past MTC packets so that
           the timestamp appears to go backwards.
         - Fixes for exported-sql-viewer GUI conversion to python3.
      
        ARM coresight:
         - Fix the build by adding a missing case value for enumeration value
           introduced in newer library, that now is the required one.
      
        tool headers:
         - Syncronize kernel headers with the kernel, getting new io_uring and
           pidfd_send_signal syscalls so that 'perf trace' can handle them"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf pmu: Fix parser error for uncore event alias
        perf scripts python: exported-sql-viewer.py: Fix python3 support
        perf scripts python: exported-sql-viewer.py: Fix never-ending loop
        perf machine: Update kernel map address and re-order properly
        tools headers uapi: Sync powerpc's asm/kvm.h copy with the kernel sources
        tools headers: Update x86's syscall_64.tbl and uapi/asm-generic/unistd
        tools headers uapi: Update drm/i915_drm.h
        tools arch x86: Sync asm/cpufeatures.h with the kernel sources
        tools headers uapi: Sync linux/fcntl.h to get the F_SEAL_FUTURE_WRITE addition
        tools headers uapi: Sync asm-generic/mman-common.h and linux/mman.h
        perf evsel: Fix max perf_event_attr.precise_ip detection
        perf intel-pt: Fix TSC slip
        perf cs-etm: Add missing case value
      590627f7
    • Linus Torvalds's avatar
      Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c29d8541
      Linus Torvalds authored
      Pull CPU hotplug fixes from Thomas Gleixner:
       "Two SMT/hotplug related fixes:
      
         - Prevent crash when HOTPLUG_CPU is disabled and the CPU bringup
           aborts. This is triggered with the 'nosmt' command line option, but
           can happen by any abort condition. As the real unplug code is not
           compiled in, prevent the fail by keeping the CPU in zombie state.
      
         - Enforce HOTPLUG_CPU for SMP on x86 to avoid the above situation
           completely. With 'nosmt' being a popular option it's required to
           unplug the half brought up sibling CPUs (due to the MCE wreckage)
           completely"
      
      * 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/smp: Enforce CONFIG_HOTPLUG_CPU when SMP=y
        cpu/hotplug: Prevent crash when CPU bringup fails on CONFIG_HOTPLUG_CPU=n
      c29d8541
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 573efdc5
      Linus Torvalds authored
      Pull locking fixlet from Thomas Gleixner:
       "Trivial update to the maintainers file"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        MAINTAINERS: Remove deleted file from futex file pattern
      573efdc5
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f78b5be2
      Linus Torvalds authored
      Pull core fixes from Thomas Gleixner:
       "A small set of core updates:
      
         - Make the watchdog respect the selected CPU mask again. That was
           broken by the rework of the watchdog thread management and caused
           inconsistent state and NMI watchdog being unstoppable.
      
         - Ensure that the objtool build can find the libelf location.
      
         - Remove dead kcore stub code"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        watchdog: Respect watchdog cpumask on CPU hotplug
        objtool: Query pkg-config for libelf location
        proc/kcore: Remove unused kclist_add_remap()
      f78b5be2
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 6536c5f2
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Three non-regression fixes.
      
         - Our optimised memcmp could read past the end of one of the buffers
           and potentially trigger a page fault leading to an oops.
      
         - Some of our code to read energy management data on PowerVM had an
           endian bug leading to bogus results.
      
         - When reporting a machine check exception we incorrectly reported
           TLB multihits as D-Cache multhits due to a missing entry in the
           array of causes.
      
        Thanks to: Chandan Rajendra, Gautham R. Shenoy, Mahesh Salgaonkar,
        Segher Boessenkool, Vaidyanathan Srinivasan"
      
      * tag 'powerpc-5.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/pseries/mce: Fix misleading print for TLB mutlihit
        powerpc/pseries/energy: Use OF accessor functions to read ibm,drc-indexes
        powerpc/64: Fix memcmp reading past the end of src/dest
      6536c5f2
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-fix-5.1-rc3' of git://git.infradead.org/users/vkoul/slave-dma · c877b3df
      Linus Torvalds authored
      Pull dmaengine fixes from Vinod Koul:
      
       - Revert "dmaengine: stm32-mdma: Add a check on read_u32_array" as that
         caused regression
      
       - Fix MAINTAINER file uniphier-mdmac.c file path
      
      * tag 'dmaengine-fix-5.1-rc3' of git://git.infradead.org/users/vkoul/slave-dma:
        MAINTAINERS: Fix uniphier-mdmac.c file path
        dmaengine: stm32-mdma: Revert "dmaengine: stm32-mdma: Add a check on read_u32_array"
      c877b3df
  6. 30 Mar, 2019 10 commits
    • Linus Torvalds's avatar
      Merge tag 'led-fixes-for-5.1-rc3' of... · b5c8314f
      Linus Torvalds authored
      Merge tag 'led-fixes-for-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds
      
      Pull LED fixes from Jacek Anaszewski:
      
       - fix refcnt leak on interface rename
      
       - use memcpy in device_name_store() to avoid including garbage from a
         previous, longer value in the device_name
      
       - fix a potential NULL pointer dereference in case of_match_device()
         cannot find a match
      
      * tag 'led-fixes-for-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
        leds: trigger: netdev: use memcpy in device_name_store
        leds: pca9532: fix a potential NULL pointer dereference
        leds: trigger: netdev: fix refcnt leak on interface rename
      b5c8314f
    • Linus Torvalds's avatar
      Merge tag 'gpio-v5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio · 3af9a525
      Linus Torvalds authored
      Pull GPIO fixes from Linus Walleij:
       "As you can see [in the git history] I was away on leave and Bartosz
        kindly stepped in and collected a slew of fixes, I pulled them into my
        tree in two sets and merged some two more fixes (fixing my own caused
        bugs) on top.
      
        Summary:
      
         - Revert the extended use of gpio_set_config() and think about how we
           can do this properly.
      
         - Fix up the SPI CS GPIO handling so it now works properly on the SPI
           bus children, as intended.
      
         - Error paths and driver fixes"
      
      * tag 'gpio-v5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
        gpio: mockup: use simple_read_from_buffer() in debugfs read callback
        gpio: of: Fix of_gpiochip_add() error path
        gpio: of: Check for "spi-cs-high" in child instead of parent node
        gpio: of: Check propname before applying "cs-gpios" quirks
        gpio: mockup: fix debugfs read
        Revert "gpio: use new gpio_set_config() helper in more places"
        gpio: aspeed: fix a potential NULL pointer dereference
        gpio: amd-fch: Fix bogus SPDX identifier
        gpio: adnp: Fix testing wrong value in adnp_gpio_direction_input
        gpio: exar: add a check for the return value of ida_simple_get fails
      3af9a525
    • Rasmus Villemoes's avatar
      leds: trigger: netdev: use memcpy in device_name_store · 90934643
      Rasmus Villemoes authored
      If userspace doesn't end the input with a newline (which can easily
      happen if the write happens from a C program that does write(fd,
      iface, strlen(iface))), we may end up including garbage from a
      previous, longer value in the device_name. For example
      
      # cat device_name
      
      # printf 'eth12' > device_name
      # cat device_name
      eth12
      # printf 'eth3' > device_name
      # cat device_name
      eth32
      
      I highly doubt anybody is relying on this behaviour, so switch to
      simply copying the bytes (we've already checked that size is <
      IFNAMSIZ) and unconditionally zero-terminate it; of course, we also
      still have to strip a trailing newline.
      
      This is also preparation for future patches.
      
      Fixes: 06f502f5 ("leds: trigger: Introduce a NETDEV trigger")
      Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarJacek Anaszewski <jacek.anaszewski@gmail.com>
      90934643
    • Kangjie Lu's avatar
      leds: pca9532: fix a potential NULL pointer dereference · 0aab8e4d
      Kangjie Lu authored
      In case of_match_device cannot find a match, return -EINVAL to avoid
      NULL pointer dereference.
      
      Fixes: fa4191a6 ("leds: pca9532: Add device tree support")
      Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
      Signed-off-by: default avatarJacek Anaszewski <jacek.anaszewski@gmail.com>
      0aab8e4d
    • Linus Torvalds's avatar
      Merge tag 'staging-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 32faca66
      Linus Torvalds authored
      Pull staging driver fixes from Greg KH:
       "Here are some small staging driver fixes for 5.1-rc3, and one driver
        removal.
      
        The biggest thing here is the removal of the mt7621-eth driver as a
        "real" network driver was merged in 5.1-rc1 for this hardware, so this
        old driver can now be removed.
      
        Other than that, there are just a number of small fixes, all resolving
        reported issues and some potential corner cases for error handling
        paths.
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'staging-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: vt6655: Remove vif check from vnt_interrupt
        staging: erofs: keep corrupted fs from crashing kernel in erofs_readdir()
        staging: octeon-ethernet: fix incorrect PHY mode
        staging: vc04_services: Fix an error code in vchiq_probe()
        staging: erofs: fix error handling when failed to read compresssed data
        staging: vt6655: Fix interrupt race condition on device start up.
        staging: rtlwifi: Fix potential NULL pointer dereference of kzalloc
        staging: rtl8712: uninitialized memory in read_bbreg_hdl()
        staging: rtlwifi: rtl8822b: fix to avoid potential NULL pointer dereference
        staging: rtl8188eu: Fix potential NULL pointer dereference of kcalloc
        staging, mt7621-pci: fix build without pci support
        staging: speakup_soft: Fix alternate speech with other synths
        staging: axis-fifo: add CONFIG_OF dependency
        staging: olpc_dcon_xo_1: add missing 'const' qualifier
        staging: comedi: ni_mio_common: Fix divide-by-zero for DIO cmdtest
        staging: erofs: fix to handle error path of erofs_vmap()
        staging: mt7621-dts: update ethernet settings.
        staging: remove mt7621-eth
      32faca66
    • Linus Torvalds's avatar
      Merge tag 'tty-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 52afe190
      Linus Torvalds authored
      Pull tty/serial fixes from Greg KH:
       "Here are some small tty and serial driver fixes for 5.1-rc3.
      
        Nothing major here, just a number of potential problems fixes for
        error handling paths, as well as some other minor bugfixes for
        reported issues with 5.1-rc1.
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'tty-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        tty: fix NULL pointer issue when tty_port ops is not set
        Disable kgdboc failed by echo space to /sys/module/kgdboc/parameters/kgdboc
        dt-bindings: serial: Add compatible for Mediatek MT8183
        tty/serial: atmel: RS485 HD w/DMA: enable RX after TX is stopped
        tty/serial: atmel: Add is_half_duplex helper
        serial: sh-sci: Fix setting SCSCR_TIE while transferring data
        serial: ar933x_uart: Fix build failure with disabled console
        tty: serial: qcom_geni_serial: Initialize baud in qcom_geni_console_setup
        sc16is7xx: missing unregister/delete driver on error in sc16is7xx_init()
        tty: mxs-auart: fix a potential NULL pointer dereference
        tty: atmel_serial: fix a potential NULL pointer dereference
        serial: max310x: Fix to avoid potential NULL pointer dereference
        serial: mvebu-uart: Fix to avoid a potential NULL pointer dereference
      52afe190
    • Linus Torvalds's avatar
      Merge tag 'usb-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 8d02a9a8
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are some small USB fixes for 5.1-rc3.
      
        Nothing major at all here, just a small collection of fixes for
        reported issues, and potential problems with error handling paths.
        Also a few new device ids, as normal.
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'usb-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (25 commits)
        USB: serial: option: add Olicard 600
        USB: serial: cp210x: add new device id
        usb: u132-hcd: fix resource leak
        usb: cdc-acm: fix race during wakeup blocking TX traffic
        usb: mtu3: fix EXTCON dependency
        usb: usb251xb: fix to avoid potential NULL pointer dereference
        usb: core: Try generic PHY_MODE_USB_HOST if usb_phy_roothub_set_mode fails
        phy: sun4i-usb: Support set_mode to USB_HOST for non-OTG PHYs
        xhci: Don't let USB3 ports stuck in polling state prevent suspend
        usb: xhci: dbc: Don't free all memory with spinlock held
        xhci: Fix port resume done detection for SS ports with LPM enabled
        USB: serial: mos7720: fix mos_parport refcount imbalance on error path
        USB: gadget: f_hid: fix deadlock in f_hidg_write()
        usb: gadget: net2272: Fix net2272_dequeue()
        usb: gadget: net2280: Fix net2280_dequeue()
        usb: gadget: net2280: Fix overrun of OUT messages
        usb: dwc3: pci: add support for Comet Lake PCH ID
        usb: usb251xb: Remove unnecessary comparison of unsigned integer with >= 0
        usb: common: Consider only available nodes for dr_mode
        usb: typec: tcpm: Try PD-2.0 if sink does not respond to 3.0 source-caps
        ...
      8d02a9a8
    • Linus Torvalds's avatar
      Merge tag 'acpi-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 782492a7
      Linus Torvalds authored
      Pull ACPI fix from Rafael Wysocki:
       "This corrects a previous attempt to make Linux use its own set of ACPI
        debug flags different from the upstream ACPICA's default (Erik
        Schmauss)"
      
      * tag 'acpi-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: use different default debug value than ACPICA
      782492a7
    • Linus Torvalds's avatar
      Merge tag 'pm-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 8e377a1c
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These fix CPU base frequency reporting in the intel_pstate driver and
        a use-after-free in the scpi-cpufreq driver.
      
        Specifics:
      
         - Fix the ACPI CPPC library to actually follow the specification when
           decoding the guaranteed performance register information and make
           the intel_pstate driver to fall back to the nominal frequency when
           reporting the base frequency if the guaranteed performance register
           information is not there (Srinivas Pandruvada).
      
         - Fix use-after-free in the exit callback of the scpi-cpufreq left
           after an update during the 5.0 development cycle (Vincent Stehlé)"
      
      * tag 'pm-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: scpi: Fix use after free
        cpufreq: intel_pstate: Also use CPPC nominal_perf for base_frequency
        ACPI / CPPC: Fix guaranteed performance handling
      8e377a1c
    • Linus Torvalds's avatar
      Merge branch 'fixes-v5.1-a' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · 12195302
      Linus Torvalds authored
      Pull security layer fixes from James Morris:
       "Yama and LSM config fixes"
      
      * 'fixes-v5.1-a' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        LSM: Revive CONFIG_DEFAULT_SECURITY_* for "make oldconfig"
        Yama: mark local symbols as static
      12195302
  7. 29 Mar, 2019 7 commits
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 922c010c
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "22 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (22 commits)
        fs/proc/proc_sysctl.c: fix NULL pointer dereference in put_links
        fs: fs_parser: fix printk format warning
        checkpatch: add %pt as a valid vsprintf extension
        mm/migrate.c: add missing flush_dcache_page for non-mapped page migrate
        drivers/block/zram/zram_drv.c: fix idle/writeback string compare
        mm/page_isolation.c: fix a wrong flag in set_migratetype_isolate()
        mm/memory_hotplug.c: fix notification in offline error path
        ptrace: take into account saved_sigmask in PTRACE{GET,SET}SIGMASK
        fs/proc/kcore.c: make kcore_modules static
        include/linux/list.h: fix list_is_first() kernel-doc
        mm/debug.c: fix __dump_page when mapping->host is not set
        mm: mempolicy: make mbind() return -EIO when MPOL_MF_STRICT is specified
        include/linux/hugetlb.h: convert to use vm_fault_t
        iommu/io-pgtable-arm-v7s: request DMA32 memory, and improve debugging
        mm: add support for kmem caches in DMA32 zone
        ocfs2: fix inode bh swapping mixup in ocfs2_reflink_inodes_lock
        mm/hotplug: fix offline undo_isolate_page_range()
        fs/open.c: allow opening only regular files during execve()
        mailmap: add Changbin Du
        mm/debug.c: add a cast to u64 for atomic64_read()
        ...
      922c010c
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · f9007cc6
      Linus Torvalds authored
      Pull arm64 fix from Catalin Marinas:
       "Use memblock_alloc() instead of memblock_alloc_low() in
        request_standard_resources(), the latter being limited to the low 4G
        memory range on arm64"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: replace memblock_alloc_low with memblock_alloc
      f9007cc6
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · c0b7f2a5
      Linus Torvalds authored
      Pull IOMMU fixes from Joerg Roedel:
      
       - Fix a bug in the AMD IOMMU driver not handling exclusion ranges
         correctly. In fact the driver did not reserve these ranges for IOVA
         allocations, so that dma-handles could be allocated in an exclusion
         range, leading to data corruption. Exclusion ranges have not been
         used by any firmware up to now, so this issue remained undiscovered
         for quite some time.
      
       - Fix wrong warning messages that the IOMMU core code prints when it
         tries to allocate the default domain for an iommu group and the
         driver does not support any of the default domain types (like Intel
         VT-d).
      
      * tag 'iommu-fixes-v5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/amd: Reserve exclusion range in iova-domain
        iommu: Don't print warning when IOMMU driver only supports unmanaged domains
      c0b7f2a5
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · eed4897d
      Linus Torvalds authored
      Pull driver core fix from Greg KH:
       "Here is a single driver core patch for 5.1-rc3.
      
        After 5.1-rc1, all of the users of BUS_ATTR() are finally removed, so
        we can now drop this macro from include/linux/device.h so that no more
        new users will be created.
      
        This patch has been in linux-next for a while, with no reported
        issues"
      
      * tag 'driver-core-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        driver core: remove BUS_ATTR()
      eed4897d
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 6f510923
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are some binder, habanalabs, and vboxguest driver fixes for
        5.1-rc3.
      
        The Binder fixes resolve some reported issues found by testing, first
        by the selinux developers, and then earlier today by syzbot.
      
        The habanalabs fixes are all minor, resolving a number of tiny things.
      
        The vboxguest patches are a bit larger. They resolve the fact that
        virtual box decided to change their api in their latest release in a
        way that broke the existing kernel code, despite saying that they were
        never going to do that. So this is a bit of a "new feature", but is
        good to get merged so that 5.1 will work with the latest release. The
        changes are not large and of course virtual box "swears" they will not
        break this again, but no one is holding their breath here.
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'char-misc-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        virt: vbox: Implement passing requestor info to the host for VirtualBox 6.0.x
        binder: fix race between munmap() and direct reclaim
        binder: fix BUG_ON found by selinux-testsuite
        habanalabs: cast to expected type
        habanalabs: prevent host crash during suspend/resume
        habanalabs: perform accounting for active CS
        habanalabs: fix mapping with page size bigger than 4KB
        habanalabs: complete user context cleanup before hard reset
        habanalabs: fix bug when mapping very large memory area
        habanalabs: fix MMU number of pages calculation
      6f510923
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 3467b907
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Thirteen fixes, seven of which are for IBM fibre channel and three
        additional for fairly serious bugs in drivers (qla2xxx, mpt3sas,
        aacraid).
      
        Of the three core fixes, the most significant is probably the missed
        run queue causing an indefinite hang. The others are fixing a
        potential use after free on device close and silencing an incorrect
        warning"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: ibmvfc: Clean up transport events
        scsi: ibmvfc: Byte swap status and error codes when logging
        scsi: ibmvfc: Add failed PRLI to cmd_status lookup array
        scsi: ibmvfc: Remove "failed" from logged errors
        scsi: zfcp: reduce flood of fcrscn1 trace records on multi-element RSCN
        scsi: zfcp: fix scsi_eh host reset with port_forced ERP for non-NPIV FCP devices
        scsi: zfcp: fix rport unblock if deleted SCSI devices on Scsi_Host
        scsi: sd: Quiesce warning if device does not report optimal I/O size
        scsi: sd: Fix a race between closing an sd device and sd I/O
        scsi: core: Run queue when state is set to running after being blocked
        scsi: qla4xxx: fix a potential NULL pointer dereference
        scsi: aacraid: Insure we don't access PCIe space during AER/EEH
        scsi: mpt3sas: Fix kernel panic during expander reset
      3467b907
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 4ad52836
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "A new ID for the i801 driver and some Documentation fixes to make it
        easier for people to find the bindings (which is also a basis for
        further improvements in that area)"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: wmt: make bindings file name match the driver
        i2c: sun6i-p2wi: make bindings file name match the driver
        i2c: stu300: make bindings file name match the driver
        i2c: mt65xx: make bindings file name match the driver
        i2c: iop3xx: make bindings file name match the driver
        i2c: i801: Add support for Intel Comet Lake
      4ad52836