1. 24 Apr, 2023 5 commits
    • Linus Torvalds's avatar
      Merge branch 'x86-rep-insns': x86 user copy clarifications · a5624566
      Linus Torvalds authored
      Merge my x86 user copy updates branch.
      
      This cleans up a lot of our x86 memory copy code, particularly for user
      accesses.  I've been pushing for microarchitectural support for good
      memory copying and clearing for a long while, and it's been visible in
      how the kernel has aggressively used 'rep movs' and 'rep stos' whenever
      possible.
      
      And that micro-architectural support has been improving over the years,
      to the point where on modern CPU's the best option for a memory copy
      that would become a function call (as opposed to being something that
      can just be turned into individual 'mov' instructions) is now to inline
      the string instruction sequence instead.
      
      However, that only makes sense when we have the modern markers for this:
      the x86 FSRM and FSRS capabilities ("Fast Short REP MOVS/STOS").
      
      So this cleans up a lot of our historical code, gets rid of the legacy
      marker use ("REP_GOOD" and "ERMS") from the memcpy/memset cases, and
      replaces it with that modern reality.  Note that REP_GOOD and ERMS end
      up still being used by the known large cases (ie page copyin gand
      clearing).
      
      The reason much of this ends up being about user memory accesses is that
      the normal in-kernel cases are done by the compiler (__builtin_memcpy()
      and __builtin_memset()) and getting to the point where we can use our
      instruction rewriting to inline those to be string instructions will
      need some compiler support.
      
      In contrast, the user accessor functions are all entirely controlled by
      the kernel code, so we can change those arbitrarily.
      
      Thanks to Borislav Petkov for feedback on the series, and Jens testing
      some of this on micro-architectures I didn't personally have access to.
      
      * x86-rep-insns:
        x86: rewrite '__copy_user_nocache' function
        x86: remove 'zerorest' argument from __copy_user_nocache()
        x86: set FSRS automatically on AMD CPUs that have FSRM
        x86: improve on the non-rep 'copy_user' function
        x86: improve on the non-rep 'clear_user' function
        x86: inline the 'rep movs' in user copies for the FSRM case
        x86: move stac/clac from user copy routines into callers
        x86: don't use REP_GOOD or ERMS for user memory clearing
        x86: don't use REP_GOOD or ERMS for user memory copies
        x86: don't use REP_GOOD or ERMS for small memory clearing
        x86: don't use REP_GOOD or ERMS for small memory copies
      a5624566
    • Linus Torvalds's avatar
      iov: improve copy_iovec_from_user() code generation · 487c20b0
      Linus Torvalds authored
      Use the same pattern as the compat version of this code does: instead of
      copying the whole array to a kernel buffer and then having a separate
      phase of verifying it, just do it one entry at a time, verifying as you
      go.
      
      On Jens' /dev/zero readv() test this improves performance by ~6%.
      
      [ This was obviously triggered by Jens' ITER_UBUF updates series ]
      Reported-and-tested-by: default avatarJens Axboe <axboe@kernel.dk>
      Link: https://lore.kernel.org/all/de35d11d-bce7-e976-7372-1f2caf417103@kernel.dk/Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      487c20b0
    • Linus Torvalds's avatar
      Merge tag 'iter-ubuf.2-2023-04-21' of git://git.kernel.dk/linux · b9dff219
      Linus Torvalds authored
      Pull ITER_UBUF updates from Jens Axboe:
       "This turns singe vector imports into ITER_UBUF, rather than
        ITER_IOVEC.
      
        The former is more trivial to iterate and advance, and hence a bit
        more efficient. From some very unscientific testing, ~60% of all iovec
        imports are single vector"
      
      * tag 'iter-ubuf.2-2023-04-21' of git://git.kernel.dk/linux:
        iov_iter: Mark copy_compat_iovec_from_user() noinline
        iov_iter: import single vector iovecs as ITER_UBUF
        iov_iter: convert import_single_range() to ITER_UBUF
        iov_iter: overlay struct iovec and ubuf/len
        iov_iter: set nr_segs = 1 for ITER_UBUF
        iov_iter: remove iov_iter_iovec()
        iov_iter: add iter_iov_addr() and iter_iov_len() helpers
        ALSA: pcm: check for user backed iterator, not specific iterator type
        IB/qib: check for user backed iterator, not specific iterator type
        IB/hfi1: check for user backed iterator, not specific iterator type
        iov_iter: add iter_iovec() helper
        block: ensure bio_alloc_map_data() deals with ITER_UBUF correctly
      b9dff219
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm · d88867a2
      Linus Torvalds authored
      Pull ARM development updates from Russell King:
       "Four changes for v6.4:
      
         - simplify the path to the top vmlinux
      
         - three patches to fix vfp with instrumentation enabled (eg lockdep)"
      
      * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: 9294/2: vfp: Fix broken softirq handling with instrumentation enabled
        ARM: 9293/1: vfp: Pass successful return address via register R3
        ARM: 9292/1: vfp: Pass thread_info pointer to vfp_support_entry
        ARM: 9291/1: decompressor: simplify the path to the top vmlinux
      d88867a2
    • Ruihan Li's avatar
      scripts: Remove ICC-related dead code · 1a261a6e
      Ruihan Li authored
      Intel compiler support has already been completely removed in commit
      95207db8 ("Remove Intel compiler support").  However, it appears
      that there is still some ICC-related code in scripts/cc-version.sh.
      There is no harm in leaving the code as it is, but removing the dead
      code makes the codebase a bit cleaner.
      
      Hopefully all ICC-related stuff in the build scripts will be removed
      after this commit, given the grep output as below:
      
      	(linux/scripts) $ grep -i -w -R 'icc'
      	cc-version.sh:ICC)
      	cc-version.sh:	min_version=$($min_tool_version icc)
      	dtc/include-prefixes/arm64/qcom/sm6350.dtsi:#include <dt-bindings/interconnect/qcom,icc.h>
      
      Fixes: 95207db8 ("Remove Intel compiler support")
      Signed-off-by: default avatarRuihan Li <lrh2000@pku.edu.cn>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1a261a6e
  2. 23 Apr, 2023 9 commits
  3. 22 Apr, 2023 2 commits
  4. 21 Apr, 2023 13 commits
  5. 20 Apr, 2023 11 commits