10 Feb, 2020

1 commit

  • Pull more Kbuild updates from Masahiro Yamada:

    - fix randconfig to generate a sane .config

    - rename hostprogs-y / always to hostprogs / always-y, which are more
    natual syntax.

    - optimize scripts/kallsyms

    - fix yes2modconfig and mod2yesconfig

    - make multiple directory targets ('make foo/ bar/') work

    * tag 'kbuild-v5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    kbuild: make multiple directory targets work
    kconfig: Invalidate all symbols after changing to y or m.
    kallsyms: fix type of kallsyms_token_table[]
    scripts/kallsyms: change table to store (strcut sym_entry *)
    scripts/kallsyms: rename local variables in read_symbol()
    kbuild: rename hostprogs-y/always to hostprogs/always-y
    kbuild: fix the document to use extra-y for vmlinux.lds
    kconfig: fix broken dependency in randconfig-generated .config

    Linus Torvalds
     

06 Feb, 2020

3 commits

  • Pull tracing updates from Steven Rostedt:

    - Added new "bootconfig".

    This looks for a file appended to initrd to add boot config options,
    and has been discussed thoroughly at Linux Plumbers.

    Very useful for adding kprobes at bootup.

    Only enabled if "bootconfig" is on the real kernel command line.

    - Created dynamic event creation.

    Merges common code between creating synthetic events and kprobe
    events.

    - Rename perf "ring_buffer" structure to "perf_buffer"

    - Rename ftrace "ring_buffer" structure to "trace_buffer"

    Had to rename existing "trace_buffer" to "array_buffer"

    - Allow trace_printk() to work withing (some) tracing code.

    - Sort of tracing configs to be a little better organized

    - Fixed bug where ftrace_graph hash was not being protected properly

    - Various other small fixes and clean ups

    * tag 'trace-v5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (88 commits)
    bootconfig: Show the number of nodes on boot message
    tools/bootconfig: Show the number of bootconfig nodes
    bootconfig: Add more parse error messages
    bootconfig: Use bootconfig instead of boot config
    ftrace: Protect ftrace_graph_hash with ftrace_sync
    ftrace: Add comment to why rcu_dereference_sched() is open coded
    tracing: Annotate ftrace_graph_notrace_hash pointer with __rcu
    tracing: Annotate ftrace_graph_hash pointer with __rcu
    bootconfig: Only load bootconfig if "bootconfig" is on the kernel cmdline
    tracing: Use seq_buf for building dynevent_cmd string
    tracing: Remove useless code in dynevent_arg_pair_add()
    tracing: Remove check_arg() callbacks from dynevent args
    tracing: Consolidate some synth_event_trace code
    tracing: Fix now invalid var_ref_vals assumption in trace action
    tracing: Change trace_boot to use synth_event interface
    tracing: Move tracing selftests to bottom of menu
    tracing: Move mmio tracer config up with the other tracers
    tracing: Move tracing test module configs together
    tracing: Move all function tracing configs together
    tracing: Documentation for in-kernel synthetic event API
    ...

    Linus Torvalds
     
  • Show the number of bootconfig nodes when applying new bootconfig to
    initrd.

    Since there are limitations of bootconfig not only in its filesize,
    but also the number of nodes, the number should be shown when applying
    so that user can get the feeling of scale of current bootconfig.

    Link: http://lkml.kernel.org/r/158091061337.27924.10886706631693823982.stgit@devnote2

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Add more error messages for following cases.
    - Exceeding max number of nodes
    - Config tree data is empty (e.g. comment only)
    - Config data is empty or exceeding max size
    - bootconfig is already initialized

    Link: http://lkml.kernel.org/r/158091060401.27924.9024818742827122764.stgit@devnote2

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     

04 Feb, 2020

6 commits

  • New version of bitmap_parse() is unified with bitmap_parse_list(),
    and therefore:

    - weakens rules on whitespaces and commas between hex chunks;

    - in addition to

    - allows passing UINT_MAX or any other big number as the length of input
    string instead of actual string length.

    The patch covers the cases.

    Link: http://lkml.kernel.org/r/20200102043031.30357-7-yury.norov@gmail.com
    Signed-off-by: Yury Norov
    Reviewed-by: Andy Shevchenko
    Cc: Amritha Nambiar
    Cc: Arnaldo Carvalho de Melo
    Cc: Chris Wilson
    Cc: Kees Cook
    Cc: Matthew Wilcox
    Cc: Miklos Szeredi
    Cc: Rasmus Villemoes
    Cc: Steffen Klassert
    Cc: "Tobin C . Harding"
    Cc: Vineet Gupta
    Cc: Will Deacon
    Cc: Willem de Bruijn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yury Norov
     
  • bitmap_parse() is ineffective and full of opaque variables and opencoded
    parts. It leads to hard understanding and usage of it. This rework
    includes:

    - remove bitmap_shift_left() call from the cycle. Now it makes the
    complexity of the algorithm as O(nbits^2). In the suggested approach
    the input string is parsed in reverse direction, so no shifts needed;

    - relax requirement on a single comma and no white spaces between
    chunks. It is considered useful in scripting, and it aligns with
    bitmap_parselist();

    - split bitmap_parse() to small readable helpers;

    - make an explicit calculation of the end of input line at the
    beginning, so users of the bitmap_parse() won't bother doing this.

    Link: http://lkml.kernel.org/r/20200102043031.30357-6-yury.norov@gmail.com
    Signed-off-by: Yury Norov
    Cc: Amritha Nambiar
    Cc: Andy Shevchenko
    Cc: Arnaldo Carvalho de Melo
    Cc: Chris Wilson
    Cc: Kees Cook
    Cc: Matthew Wilcox
    Cc: Miklos Szeredi
    Cc: Rasmus Villemoes
    Cc: Steffen Klassert
    Cc: "Tobin C . Harding"
    Cc: Vineet Gupta
    Cc: Will Deacon
    Cc: Willem de Bruijn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yury Norov
     
  • Currently we parse user data byte after byte which leads to
    overcomplicating of parsing algorithm. There are no performance critical
    users of bitmap_parse_user(), and so we can duplicate user data to kernel
    buffer and simply call bitmap_parselist(). This rework lets us unify and
    simplify bitmap_parse() and bitmap_parse_user(), which is done in the
    following patch.

    Link: http://lkml.kernel.org/r/20200102043031.30357-5-yury.norov@gmail.com
    Signed-off-by: Yury Norov
    Reviewed-by: Andy Shevchenko
    Cc: Amritha Nambiar
    Cc: Arnaldo Carvalho de Melo
    Cc: Chris Wilson
    Cc: Kees Cook
    Cc: Matthew Wilcox
    Cc: Miklos Szeredi
    Cc: Rasmus Villemoes
    Cc: Steffen Klassert
    Cc: "Tobin C . Harding"
    Cc: Vineet Gupta
    Cc: Will Deacon
    Cc: Willem de Bruijn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yury Norov
     
  • The test is derived from bitmap_parselist() NO_LEN is reserved for use in
    following patches.

    [yury.norov@gmail.com: fix rebase issue]
    Link: http://lkml.kernel.org/r/20200102182659.6685-1-yury.norov@gmail.com
    [andriy.shevchenko@linux.intel.com: fix address space when test user buffer]
    Link: http://lkml.kernel.org/r/20200109103601.45929-2-andriy.shevchenko@linux.intel.com
    Link: http://lkml.kernel.org/r/20200102043031.30357-4-yury.norov@gmail.com
    Signed-off-by: Yury Norov
    Signed-off-by: Andy Shevchenko
    Reviewed-by: Andy Shevchenko
    Cc: Amritha Nambiar
    Cc: Arnaldo Carvalho de Melo
    Cc: Chris Wilson
    Cc: Kees Cook
    Cc: Matthew Wilcox
    Cc: Miklos Szeredi
    Cc: Rasmus Villemoes
    Cc: Steffen Klassert
    Cc: "Tobin C . Harding"
    Cc: Vineet Gupta
    Cc: Will Deacon
    Cc: Willem de Bruijn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yury Norov
     
  • Patch series "lib: rework bitmap_parse", v5.

    Similarl to the recently revisited bitmap_parselist(), bitmap_parse() is
    ineffective and overcomplicated. This series reworks it, aligns its
    interface with bitmap_parselist() and makes it simpler to use.

    The series also adds a test for the function and fixes usage of it in
    cpumask_parse() according to the new design - drops the calculating of
    length of an input string.

    bitmap_parse() takes the array of numbers to be put into the map in the BE
    order which is reversed to the natural LE order for bitmaps. For example,
    to construct bitmap containing a bit on the position 42, we have to put a
    line '400,0'. Current implementation reads chunk one by one from the
    beginning ('400' before '0') and makes bitmap shift after each successful
    parse. It makes the complexity of the whole process as O(n^2). We can do
    it in reverse direction ('0' before '400') and avoid shifting, but it
    requires reverse parsing helpers.

    This patch (of 7):

    New function works like strchrnul() with a length limited string.

    Link: http://lkml.kernel.org/r/20200102043031.30357-2-yury.norov@gmail.com
    Signed-off-by: Yury Norov
    Reviewed-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Cc: Amritha Nambiar
    Cc: Willem de Bruijn
    Cc: Kees Cook
    Cc: Matthew Wilcox
    Cc: "Tobin C . Harding"
    Cc: Will Deacon
    Cc: Miklos Szeredi
    Cc: Vineet Gupta
    Cc: Chris Wilson
    Cc: Arnaldo Carvalho de Melo
    Cc: Steffen Klassert
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yury Norov
     
  • In old days, the "host-progs" syntax was used for specifying host
    programs. It was renamed to the current "hostprogs-y" in 2004.

    It is typically useful in scripts/Makefile because it allows Kbuild to
    selectively compile host programs based on the kernel configuration.

    This commit renames like follows:

    always -> always-y
    hostprogs-y -> hostprogs

    So, scripts/Makefile will look like this:

    always-$(CONFIG_BUILD_BIN2C) += ...
    always-$(CONFIG_KALLSYMS) += ...
    ...
    hostprogs := $(always-y) $(always-m)

    I think this makes more sense because a host program is always a host
    program, irrespective of the kernel configuration. We want to specify
    which ones to compile by CONFIG options, so always-y will be handier.

    The "always", "hostprogs-y", "hostprogs-m" will be kept for backward
    compatibility for a while.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

01 Feb, 2020

11 commits

  • Don't instrument 3 more files that contain debugging facilities and
    produce large amounts of uninteresting coverage for every syscall.

    The following snippets are sprinkled all over the place in kcov traces
    in a debugging kernel. We already try to disable instrumentation of
    stack unwinding code and of most debug facilities. I guess we did not
    use fault-inject.c at the time, and stacktrace.c was somehow missed (or
    something has changed in kernel/configs). This change both speeds up
    kcov (kernel doesn't need to store these PCs, user-space doesn't need to
    process them) and frees trace buffer capacity for more useful coverage.

    should_fail
    lib/fault-inject.c:149
    fail_dump
    lib/fault-inject.c:45

    stack_trace_save
    kernel/stacktrace.c:124
    stack_trace_consume_entry
    kernel/stacktrace.c:86
    stack_trace_consume_entry
    kernel/stacktrace.c:89
    ... a hundred frames skipped ...
    stack_trace_consume_entry
    kernel/stacktrace.c:93
    stack_trace_consume_entry
    kernel/stacktrace.c:86

    Link: http://lkml.kernel.org/r/20200116111449.217744-1-dvyukov@gmail.com
    Signed-off-by: Dmitry Vyukov
    Reviewed-by: Andrey Konovalov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitry Vyukov
     
  • It saves 25% of .text for arm64, and more for BE architectures.

    Before:
    $ size lib/find_bit.o
    text data bss dec hex filename
    1012 56 0 1068 42c lib/find_bit.o

    After:
    $ size lib/find_bit.o
    text data bss dec hex filename
    776 56 0 832 340 lib/find_bit.o

    Link: http://lkml.kernel.org/r/20200103202846.21616-3-yury.norov@gmail.com
    Signed-off-by: Yury Norov
    Cc: Thomas Gleixner
    Cc: Allison Randal
    Cc: William Breathitt Gray
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yury Norov
     
  • _find_next_bit and _find_next_bit_le are very similar functions. It's
    possible to join them by adding 1 parameter and a couple of simple
    checks. It's simplify maintenance and make possible to shrink the size
    of .text by un-inlining the unified function (in the following patch).

    Link: http://lkml.kernel.org/r/20200103202846.21616-2-yury.norov@gmail.com
    Signed-off-by: Yury Norov
    Cc: Allison Randal
    Cc: Joe Perches
    Cc: Thomas Gleixner
    Cc: William Breathitt Gray
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yury Norov
     
  • ext2_swab() is defined locally in lib/find_bit.c However it is not
    specific to ext2, neither to bitmaps.

    There are many potential users of it, so rename it to just swab() and
    move to include/uapi/linux/swab.h

    ABI guarantees that size of unsigned long corresponds to BITS_PER_LONG,
    therefore drop unneeded cast.

    Link: http://lkml.kernel.org/r/20200103202846.21616-1-yury.norov@gmail.com
    Signed-off-by: Yury Norov
    Cc: Allison Randal
    Cc: Joe Perches
    Cc: Thomas Gleixner
    Cc: William Breathitt Gray
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yury Norov
     
  • Clang warns:

    ../lib/scatterlist.c:314:5: warning: misleading indentation; statement
    is not part of the previous 'if' [-Wmisleading-indentation]
    return -ENOMEM;
    ^
    ../lib/scatterlist.c:311:4: note: previous statement is here
    if (prv)
    ^
    1 warning generated.

    This warning occurs because there is a space before the tab on this
    line. Remove it so that the indentation is consistent with the Linux
    kernel coding style and clang no longer warns.

    Link: http://lkml.kernel.org/r/20191218033606.11942-1-natechancellor@gmail.com
    Link: https://github.com/ClangBuiltLinux/linux/issues/830
    Fixes: edce6820a9fd ("scatterlist: prevent invalid free when alloc fails")
    Signed-off-by: Nathan Chancellor
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nathan Chancellor
     
  • Add a new function to zlib.h checking if s390 Deflate-Conversion
    facility is installed and enabled.

    Link: http://lkml.kernel.org/r/20200103223334.20669-6-zaslonko@linux.ibm.com
    Signed-off-by: Mikhail Zaslonko
    Cc: Chris Mason
    Cc: Christian Borntraeger
    Cc: David Sterba
    Cc: Eduard Shishkin
    Cc: Heiko Carstens
    Cc: Ilya Leoshkevich
    Cc: Josef Bacik
    Cc: Richard Purdie
    Cc: Vasily Gorbik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mikhail Zaslonko
     
  • Add the new kernel command line parameter 'dfltcc=' to configure s390
    zlib hardware support.

    Format: { on | off | def_only | inf_only | always }
    on: s390 zlib hardware support for compression on
    level 1 and decompression (default)
    off: No s390 zlib hardware support
    def_only: s390 zlib hardware support for deflate
    only (compression on level 1)
    inf_only: s390 zlib hardware support for inflate
    only (decompression)
    always: Same as 'on' but ignores the selected compression
    level always using hardware support (used for debugging)

    Link: http://lkml.kernel.org/r/20200103223334.20669-5-zaslonko@linux.ibm.com
    Signed-off-by: Mikhail Zaslonko
    Cc: Chris Mason
    Cc: Christian Borntraeger
    Cc: David Sterba
    Cc: Eduard Shishkin
    Cc: Heiko Carstens
    Cc: Ilya Leoshkevich
    Cc: Josef Bacik
    Cc: Richard Purdie
    Cc: Vasily Gorbik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mikhail Zaslonko
     
  • Add decompression functions to zlib_dfltcc library. Update zlib_inflate
    functions with the hooks for s390 hardware support and adjust workspace
    structures with extra parameter lists required for hardware inflate
    decompression.

    Link: http://lkml.kernel.org/r/20200103223334.20669-4-zaslonko@linux.ibm.com
    Signed-off-by: Ilya Leoshkevich
    Signed-off-by: Mikhail Zaslonko
    Co-developed-by: Ilya Leoshkevich
    Cc: Chris Mason
    Cc: Christian Borntraeger
    Cc: David Sterba
    Cc: Eduard Shishkin
    Cc: Heiko Carstens
    Cc: Josef Bacik
    Cc: Richard Purdie
    Cc: Vasily Gorbik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mikhail Zaslonko
     
  • Patch series "S390 hardware support for kernel zlib", v3.

    With IBM z15 mainframe the new DFLTCC instruction is available. It
    implements deflate algorithm in hardware (Nest Acceleration Unit - NXU)
    with estimated compression and decompression performance orders of
    magnitude faster than the current zlib.

    This patchset adds s390 hardware compression support to kernel zlib.
    The code is based on the userspace zlib implementation:

    https://github.com/madler/zlib/pull/410

    The coding style is also preserved for future maintainability. There is
    only limited set of userspace zlib functions represented in kernel.
    Apart from that, all the memory allocation should be performed in
    advance. Thus, the workarea structures are extended with the parameter
    lists required for the DEFLATE CONVENTION CALL instruction.

    Since kernel zlib itself does not support gzip headers, only Adler-32
    checksum is processed (also can be produced by DFLTCC facility). Like
    it was implemented for userspace, kernel zlib will compress in hardware
    on level 1, and in software on all other levels. Decompression will
    always happen in hardware (when enabled).

    Two DFLTCC compression calls produce the same results only when they
    both are made on machines of the same generation, and when the
    respective buffers have the same offset relative to the start of the
    page. Therefore care should be taken when using hardware compression
    when reproducible results are desired. However it does always produce
    the standard conform output which can be inflated anyway.

    The new kernel command line parameter 'dfltcc' is introduced to
    configure s390 zlib hardware support:

    Format: { on | off | def_only | inf_only | always }
    on: s390 zlib hardware support for compression on
    level 1 and decompression (default)
    off: No s390 zlib hardware support
    def_only: s390 zlib hardware support for deflate
    only (compression on level 1)
    inf_only: s390 zlib hardware support for inflate
    only (decompression)
    always: Same as 'on' but ignores the selected compression
    level always using hardware support (used for debugging)

    The main purpose of the integration of the NXU support into the kernel
    zlib is the use of hardware deflate in btrfs filesystem with on-the-fly
    compression enabled. Apart from that, hardware support can also be used
    during boot for decompressing the kernel or the ramdisk image

    With the patch for btrfs expanding zlib buffer from 1 to 4 pages (patch
    6) the following performance results have been achieved using the
    ramdisk with btrfs. These are relative numbers based on throughput rate
    and compression ratio for zlib level 1:

    Input data Deflate rate Inflate rate Compression ratio
    NXU/Software NXU/Software NXU/Software
    stream of zeroes 1.46 1.02 1.00
    random ASCII data 10.44 3.00 0.96
    ASCII text (dickens) 6,21 3.33 0.94
    binary data (vmlinux) 8,37 3.90 1.02

    This means that s390 hardware deflate can provide up to 10 times faster
    compression (on level 1) and up to 4 times faster decompression (refers
    to all compression levels) for btrfs zlib.

    Disclaimer: Performance results are based on IBM internal tests using DD
    command-line utility on btrfs on a Fedora 30 based internal driver in
    native LPAR on a z15 system. Results may vary based on individual
    workload, configuration and software levels.

    This patch (of 9):

    Create zlib_dfltcc library with the s390 DEFLATE CONVERSION CALL
    implementation and related compression functions. Update zlib_deflate
    functions with the hooks for s390 hardware support and adjust workspace
    structures with extra parameter lists required for hardware deflate.

    Link: http://lkml.kernel.org/r/20200103223334.20669-2-zaslonko@linux.ibm.com
    Signed-off-by: Ilya Leoshkevich
    Signed-off-by: Mikhail Zaslonko
    Co-developed-by: Ilya Leoshkevich
    Cc: Chris Mason
    Cc: Christian Borntraeger
    Cc: David Sterba
    Cc: Eduard Shishkin
    Cc: Heiko Carstens
    Cc: Josef Bacik
    Cc: Richard Purdie
    Cc: Vasily Gorbik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mikhail Zaslonko
     
  • In case memory resources for _ptr2_ were allocated, release them before
    return.

    Notice that in case _ptr1_ happens to be NULL, krealloc() behaves
    exactly like kmalloc().

    Addresses-Coverity-ID: 1490594 ("Resource leak")
    Link: http://lkml.kernel.org/r/20200123160115.GA4202@embeddedor
    Fixes: 3f15801cdc23 ("lib: add kasan test module")
    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Dmitry Vyukov
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gustavo A. R. Silva
     
  • On 32-bit platform the size of long is only 32 bits which makes wrong
    offset in the array of 64 bit size.

    Calculate offset based on BITS_PER_LONG.

    Link: http://lkml.kernel.org/r/20200109103601.45929-1-andriy.shevchenko@linux.intel.com
    Fixes: 30544ed5de43 ("lib/bitmap: introduce bitmap_replace() helper")
    Signed-off-by: Andy Shevchenko
    Reported-by: Guenter Roeck
    Cc: Rasmus Villemoes
    Cc: Yury Norov
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     

30 Jan, 2020

1 commit

  • …kernel/git/shuah/linux-kselftest

    Pull Kselftest kunit updates from Shuah Khan:
    "This kunit update consists of:

    - Support for building kunit as a module from Alan Maguire

    - AppArmor KUnit tests for policy unpack from Mike Salvatore"

    * tag 'linux-kselftest-5.6-rc1-kunit' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
    kunit: building kunit as a module breaks allmodconfig
    kunit: update documentation to describe module-based build
    kunit: allow kunit to be loaded as a module
    kunit: remove timeout dependence on sysctl_hung_task_timeout_seconds
    kunit: allow kunit tests to be loaded as a module
    kunit: hide unexported try-catch interface in try-catch-impl.h
    kunit: move string-stream.h to lib/kunit
    apparmor: add AppArmor KUnit tests for policy unpack

    Linus Torvalds
     

29 Jan, 2020

3 commits

  • Pull networking updates from David Miller:

    1) Add WireGuard

    2) Add HE and TWT support to ath11k driver, from John Crispin.

    3) Add ESP in TCP encapsulation support, from Sabrina Dubroca.

    4) Add variable window congestion control to TIPC, from Jon Maloy.

    5) Add BCM84881 PHY driver, from Russell King.

    6) Start adding netlink support for ethtool operations, from Michal
    Kubecek.

    7) Add XDP drop and TX action support to ena driver, from Sameeh
    Jubran.

    8) Add new ipv4 route notifications so that mlxsw driver does not have
    to handle identical routes itself. From Ido Schimmel.

    9) Add BPF dynamic program extensions, from Alexei Starovoitov.

    10) Support RX and TX timestamping in igc, from Vinicius Costa Gomes.

    11) Add support for macsec HW offloading, from Antoine Tenart.

    12) Add initial support for MPTCP protocol, from Christoph Paasch,
    Matthieu Baerts, Florian Westphal, Peter Krystad, and many others.

    13) Add Octeontx2 PF support, from Sunil Goutham, Geetha sowjanya, Linu
    Cherian, and others.

    * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (1469 commits)
    net: phy: add default ARCH_BCM_IPROC for MDIO_BCM_IPROC
    udp: segment looped gso packets correctly
    netem: change mailing list
    qed: FW 8.42.2.0 debug features
    qed: rt init valid initialization changed
    qed: Debug feature: ilt and mdump
    qed: FW 8.42.2.0 Add fw overlay feature
    qed: FW 8.42.2.0 HSI changes
    qed: FW 8.42.2.0 iscsi/fcoe changes
    qed: Add abstraction for different hsi values per chip
    qed: FW 8.42.2.0 Additional ll2 type
    qed: Use dmae to write to widebus registers in fw_funcs
    qed: FW 8.42.2.0 Parser offsets modified
    qed: FW 8.42.2.0 Queue Manager changes
    qed: FW 8.42.2.0 Expose new registers and change windows
    qed: FW 8.42.2.0 Internal ram offsets modifications
    MAINTAINERS: Add entry for Marvell OcteonTX2 Physical Function driver
    Documentation: net: octeontx2: Add RVU HW and drivers overview
    octeontx2-pf: ethtool RSS config support
    octeontx2-pf: Add basic ethtool support
    ...

    Linus Torvalds
     
  • Pull crypto updates from Herbert Xu:
    "API:
    - Removed CRYPTO_TFM_RES flags
    - Extended spawn grabbing to all algorithm types
    - Moved hash descsize verification into API code

    Algorithms:
    - Fixed recursive pcrypt dead-lock
    - Added new 32 and 64-bit generic versions of poly1305
    - Added cryptogams implementation of x86/poly1305

    Drivers:
    - Added support for i.MX8M Mini in caam
    - Added support for i.MX8M Nano in caam
    - Added support for i.MX8M Plus in caam
    - Added support for A33 variant of SS in sun4i-ss
    - Added TEE support for Raven Ridge in ccp
    - Added in-kernel API to submit TEE commands in ccp
    - Added AMD-TEE driver
    - Added support for BCM2711 in iproc-rng200
    - Added support for AES256-GCM based ciphers for chtls
    - Added aead support on SEC2 in hisilicon"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (244 commits)
    crypto: arm/chacha - fix build failured when kernel mode NEON is disabled
    crypto: caam - add support for i.MX8M Plus
    crypto: x86/poly1305 - emit does base conversion itself
    crypto: hisilicon - fix spelling mistake "disgest" -> "digest"
    crypto: chacha20poly1305 - add back missing test vectors and test chunking
    crypto: x86/poly1305 - fix .gitignore typo
    tee: fix memory allocation failure checks on drv_data and amdtee
    crypto: ccree - erase unneeded inline funcs
    crypto: ccree - make cc_pm_put_suspend() void
    crypto: ccree - split overloaded usage of irq field
    crypto: ccree - fix PM race condition
    crypto: ccree - fix FDE descriptor sequence
    crypto: ccree - cc_do_send_request() is void func
    crypto: ccree - fix pm wrongful error reporting
    crypto: ccree - turn errors to debug msgs
    crypto: ccree - fix AEAD decrypt auth fail
    crypto: ccree - fix typo in comment
    crypto: ccree - fix typos in error msgs
    crypto: atmel-{aes,sha,tdes} - Retire crypto_platform_data
    crypto: x86/sha - Eliminate casts on asm implementations
    ...

    Linus Torvalds
     
  • Pull scheduler updates from Ingo Molnar:
    "These were the main changes in this cycle:

    - More -rt motivated separation of CONFIG_PREEMPT and
    CONFIG_PREEMPTION.

    - Add more low level scheduling topology sanity checks and warnings
    to filter out nonsensical topologies that break scheduling.

    - Extend uclamp constraints to influence wakeup CPU placement

    - Make the RT scheduler more aware of asymmetric topologies and CPU
    capacities, via uclamp metrics, if CONFIG_UCLAMP_TASK=y

    - Make idle CPU selection more consistent

    - Various fixes, smaller cleanups, updates and enhancements - please
    see the git log for details"

    * 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (58 commits)
    sched/fair: Define sched_idle_cpu() only for SMP configurations
    sched/topology: Assert non-NUMA topology masks don't (partially) overlap
    idle: fix spelling mistake "iterrupts" -> "interrupts"
    sched/fair: Remove redundant call to cpufreq_update_util()
    sched/psi: create /proc/pressure and /proc/pressure/{io|memory|cpu} only when psi enabled
    sched/fair: Fix sgc->{min,max}_capacity calculation for SD_OVERLAP
    sched/fair: calculate delta runnable load only when it's needed
    sched/cputime: move rq parameter in irqtime_account_process_tick
    stop_machine: Make stop_cpus() static
    sched/debug: Reset watchdog on all CPUs while processing sysrq-t
    sched/core: Fix size of rq::uclamp initialization
    sched/uclamp: Fix a bug in propagating uclamp value in new cgroups
    sched/fair: Load balance aggressively for SCHED_IDLE CPUs
    sched/fair : Improve update_sd_pick_busiest for spare capacity case
    watchdog: Remove soft_lockup_hrtimer_cnt and related code
    sched/rt: Make RT capacity-aware
    sched/fair: Make EAS wakeup placement consider uclamp restrictions
    sched/fair: Make task_fits_capacity() consider uclamp restrictions
    sched/uclamp: Rename uclamp_util_with() into uclamp_rq_util_with()
    sched/uclamp: Make uclamp util helpers use and return UL values
    ...

    Linus Torvalds
     

28 Jan, 2020

6 commits

  • Pull timer updates from Thomas Gleixner:
    "The timekeeping and timers departement provides:

    - Time namespace support:

    If a container migrates from one host to another then it expects
    that clocks based on MONOTONIC and BOOTTIME are not subject to
    disruption. Due to different boot time and non-suspended runtime
    these clocks can differ significantly on two hosts, in the worst
    case time goes backwards which is a violation of the POSIX
    requirements.

    The time namespace addresses this problem. It allows to set offsets
    for clock MONOTONIC and BOOTTIME once after creation and before
    tasks are associated with the namespace. These offsets are taken
    into account by timers and timekeeping including the VDSO.

    Offsets for wall clock based clocks (REALTIME/TAI) are not provided
    by this mechanism. While in theory possible, the overhead and code
    complexity would be immense and not justified by the esoteric
    potential use cases which were discussed at Plumbers '18.

    The overhead for tasks in the root namespace (ie where host time
    offsets = 0) is in the noise and great effort was made to ensure
    that especially in the VDSO. If time namespace is disabled in the
    kernel configuration the code is compiled out.

    Kudos to Andrei Vagin and Dmitry Sofanov who implemented this
    feature and kept on for more than a year addressing review
    comments, finding better solutions. A pleasant experience.

    - Overhaul of the alarmtimer device dependency handling to ensure
    that the init/suspend/resume ordering is correct.

    - A new clocksource/event driver for Microchip PIT64

    - Suspend/resume support for the Hyper-V clocksource

    - The usual pile of fixes, updates and improvements mostly in the
    driver code"

    * tag 'timers-core-2020-01-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (71 commits)
    alarmtimer: Make alarmtimer_get_rtcdev() a stub when CONFIG_RTC_CLASS=n
    alarmtimer: Use wakeup source from alarmtimer platform device
    alarmtimer: Make alarmtimer platform device child of RTC device
    alarmtimer: Update alarmtimer_get_rtcdev() docs to reflect reality
    hrtimer: Add missing sparse annotation for __run_timer()
    lib/vdso: Only read hrtimer_res when needed in __cvdso_clock_getres()
    MIPS: vdso: Define BUILD_VDSO32 when building a 32bit kernel
    clocksource/drivers/hyper-v: Set TSC clocksource as default w/ InvariantTSC
    clocksource/drivers/hyper-v: Untangle stimers and timesync from clocksources
    clocksource/drivers/timer-microchip-pit64b: Fix sparse warning
    clocksource/drivers/exynos_mct: Rename Exynos to lowercase
    clocksource/drivers/timer-ti-dm: Fix uninitialized pointer access
    clocksource/drivers/timer-ti-dm: Switch to platform_get_irq
    clocksource/drivers/timer-ti-dm: Convert to devm_platform_ioremap_resource
    clocksource/drivers/em_sti: Fix variable declaration in em_sti_probe
    clocksource/drivers/em_sti: Convert to devm_platform_ioremap_resource
    clocksource/drivers/bcm2835_timer: Fix memory leak of timer
    clocksource/drivers/cadence-ttc: Use ttc driver as platform driver
    clocksource/drivers/timer-microchip-pit64b: Add Microchip PIT64B support
    clocksource/drivers/hyper-v: Reserve PAGE_SIZE space for tsc page
    ...

    Linus Torvalds
     
  • Pull debugobjects update from Thomas Gleixner:
    "A single commit for debug objects which fixes a pile of potential data
    races detected by KCSAN"

    * tag 'core-debugobjects-2020-01-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    debugobjects: Fix various data races

    Linus Torvalds
     
  • Pull ioremap updates from Christoph Hellwig:
    "Remove the ioremap_nocache API (plus wrappers) that are always
    identical to ioremap"

    * tag 'ioremap-5.6' of git://git.infradead.org/users/hch/ioremap:
    remove ioremap_nocache and devm_ioremap_nocache
    MIPS: define ioremap_nocache to ioremap

    Linus Torvalds
     
  • Pull block driver updates from Jens Axboe:
    "Like the core side, not a lot of changes here, just two main items:

    - Series of patches (via Coly) with fixes for bcache (Coly,
    Christoph)

    - MD pull request from Song"

    * tag 'for-5.6/drivers-2020-01-27' of git://git.kernel.dk/linux-block: (31 commits)
    bcache: reap from tail of c->btree_cache in bch_mca_scan()
    bcache: reap c->btree_cache_freeable from the tail in bch_mca_scan()
    bcache: remove member accessed from struct btree
    bcache: print written and keys in trace_bcache_btree_write
    bcache: avoid unnecessary btree nodes flushing in btree_flush_write()
    bcache: add code comments for state->pool in __btree_sort()
    lib: crc64: include for 'crc64_be'
    bcache: use read_cache_page_gfp to read the superblock
    bcache: store a pointer to the on-disk sb in the cache and cached_dev structures
    bcache: return a pointer to the on-disk sb from read_super
    bcache: transfer the sb_page reference to register_{bdev,cache}
    bcache: fix use-after-free in register_bcache()
    bcache: properly initialize 'path' and 'err' in register_bcache()
    bcache: rework error unwinding in register_bcache
    bcache: use a separate data structure for the on-disk super block
    bcache: cached_dev_free needs to put the sb page
    md/raid1: introduce wait_for_serialization
    md/raid1: use bucket based mechanism for IO serialization
    md: introduce a new struct for IO serialization
    md: don't destroy serial_info_pool if serialize_policy is true
    ...

    Linus Torvalds
     
  • Pull livepatching updates from Jiri Kosina:
    "Fixes for selftests and samples for 'shadow variables' livepatching
    feature, from Petr Mladek"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching:
    livepatch: Handle allocation failure in the sample of shadow variable API
    livepatch/samples/selftest: Use klp_shadow_alloc() API correctly
    livepatch/selftest: Clean up shadow variable names and type
    livepatch/sample: Use the right type for the leaking data pointer

    Linus Torvalds
     
  • Pull arm64 updates from Will Deacon:
    "The changes are a real mixed bag this time around.

    The only scary looking one from the diffstat is the uapi change to
    asm-generic/mman-common.h, but this has been acked by Arnd and is
    actually just adding a pair of comments in an attempt to prevent
    allocation of some PROT values which tend to get used for
    arch-specific purposes. We'll be using them for Branch Target
    Identification (a CFI-like hardening feature), which is currently
    under review on the mailing list.

    New architecture features:

    - Support for Armv8.5 E0PD, which benefits KASLR in the same way as
    KPTI but without the overhead. This allows KPTI to be disabled on
    CPUs that are not affected by Meltdown, even is KASLR is enabled.

    - Initial support for the Armv8.5 RNG instructions, which claim to
    provide access to a high bandwidth, cryptographically secure
    hardware random number generator. As well as exposing these to
    userspace, we also use them as part of the KASLR seed and to seed
    the crng once all CPUs have come online.

    - Advertise a bunch of new instructions to userspace, including
    support for Data Gathering Hint, Matrix Multiply and 16-bit
    floating point.

    Kexec:

    - Cleanups in preparation for relocating with the MMU enabled

    - Support for loading crash dump kernels with kexec_file_load()

    Perf and PMU drivers:

    - Cleanups and non-critical fixes for a couple of system PMU drivers

    FPU-less (aka broken) CPU support:

    - Considerable fixes to support CPUs without the FP/SIMD extensions,
    including their presence in heterogeneous systems. Good luck
    finding a 64-bit userspace that handles this.

    Modern assembly function annotations:

    - Start migrating our use of ENTRY() and ENDPROC() over to the
    new-fangled SYM_{CODE,FUNC}_{START,END} macros, which are intended
    to aid debuggers

    Kbuild:

    - Cleanup detection of LSE support in the assembler by introducing
    'as-instr'

    - Remove compressed Image files when building clean targets

    IP checksumming:

    - Implement optimised IPv4 checksumming routine when hardware offload
    is not in use. An IPv6 version is in the works, pending testing.

    Hardware errata:

    - Work around Cortex-A55 erratum #1530923

    Shadow call stack:

    - Work around some issues with Clang's integrated assembler not
    liking our perfectly reasonable assembly code

    - Avoid allocating the X18 register, so that it can be used to hold
    the shadow call stack pointer in future

    ACPI:

    - Fix ID count checking in IORT code. This may regress broken
    firmware that happened to work with the old implementation, in
    which case we'll have to revert it and try something else

    - Fix DAIF corruption on return from GHES handler with pseudo-NMIs

    Miscellaneous:

    - Whitelist some CPUs that are unaffected by Spectre-v2

    - Reduce frequency of ASID rollover when KPTI is compiled in but
    inactive

    - Reserve a couple of arch-specific PROT flags that are already used
    by Sparc and PowerPC and are planned for later use with BTI on
    arm64

    - Preparatory cleanup of our entry assembly code in preparation for
    moving more of it into C later on

    - Refactoring and cleanup"

    * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (73 commits)
    arm64: acpi: fix DAIF manipulation with pNMI
    arm64: kconfig: Fix alignment of E0PD help text
    arm64: Use v8.5-RNG entropy for KASLR seed
    arm64: Implement archrandom.h for ARMv8.5-RNG
    arm64: kbuild: remove compressed images on 'make ARCH=arm64 (dist)clean'
    arm64: entry: Avoid empty alternatives entries
    arm64: Kconfig: select HAVE_FUTEX_CMPXCHG
    arm64: csum: Fix pathological zero-length calls
    arm64: entry: cleanup sp_el0 manipulation
    arm64: entry: cleanup el0 svc handler naming
    arm64: entry: mark all entry code as notrace
    arm64: assembler: remove smp_dmb macro
    arm64: assembler: remove inherit_daif macro
    ACPI/IORT: Fix 'Number of IDs' handling in iort_id_map()
    mm: Reserve asm-generic prot flags 0x10 and 0x20 for arch use
    arm64: Use macros instead of hard-coded constants for MAIR_EL1
    arm64: Add KRYO{3,4}XX CPU cores to spectre-v2 safe list
    arm64: kernel: avoid x18 in __cpu_soft_restart
    arm64: kvm: stop treating register x18 as caller save
    arm64/lib: copy_page: avoid x18 register in assembler code
    ...

    Linus Torvalds
     

27 Jan, 2020

1 commit


25 Jan, 2020

1 commit

  • The range passed to user_access_begin() by strncpy_from_user() and
    strnlen_user() starts at 'src' and goes up to the limit of userspace
    although reads will be limited by the 'count' param.

    On 32 bits powerpc (book3s/32) access has to be granted for each
    256Mbytes segment and the cost increases with the number of segments to
    unlock.

    Limit the range with 'count' param.

    Fixes: 594cc251fdd0 ("make 'user_access_begin()' do 'access_ok()'")
    Signed-off-by: Christophe Leroy
    Signed-off-by: Linus Torvalds

    Christophe Leroy
     

24 Jan, 2020

2 commits

  • Pull XArray fixes from Matthew Wilcox:
    "Primarily bugfixes, mostly around handling index wrap-around
    correctly.

    A couple of doc fixes and adding missing APIs.

    I had an oops live on stage at linux.conf.au this year, and it turned
    out to be a bug in xas_find() which I can't prove isn't triggerable in
    the current codebase. Then in looking for the bug, I spotted two more
    bugs.

    The bots have had a few days to chew on this with no problems
    reported, and it passes the test-suite (which now has more tests to
    make sure these problems don't come back)"

    * tag 'xarray-5.5' of git://git.infradead.org/users/willy/linux-dax:
    XArray: Add xa_for_each_range
    XArray: Fix xas_find returning too many entries
    XArray: Fix xa_find_after with multi-index entries
    XArray: Fix infinite loop with entry at ULONG_MAX
    XArray: Add wrappers for nested spinlocks
    XArray: Improve documentation of search marks
    XArray: Fix xas_pause at ULONG_MAX

    Linus Torvalds
     
  • The crc64_be() is declared in so include
    this where the symbol is defined to avoid the following
    warning:

    lib/crc64.c:43:12: warning: symbol 'crc64_be' was not declared. Should it be static?

    Signed-off-by: Ben Dooks (Codethink)
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Coly Li
    Signed-off-by: Jens Axboe

    Ben Dooks (Codethink)
     

22 Jan, 2020

1 commit

  • When this was originally ported, the 12-byte nonce vectors were left out
    to keep things simple. I agree that we don't need nor want a library
    interface for 12-byte nonces. But these test vectors were specially
    crafted to look at issues in the underlying primitives and related
    interactions. Therefore, we actually want to keep around all of the
    test vectors, and simply have a helper function to test them with.

    Secondly, the sglist-based chunking code in the library interface is
    rather complicated, so this adds a developer-only test for ensuring that
    all the book keeping is correct, across a wide array of possibilities.

    Signed-off-by: Jason A. Donenfeld
    Signed-off-by: Herbert Xu

    Jason A. Donenfeld
     

18 Jan, 2020

3 commits


17 Jan, 2020

1 commit

  • The counters obj_pool_free, and obj_nr_tofree, and the flag obj_freeing are
    read locklessly outside the pool_lock critical sections. If read with plain
    accesses, this would result in data races.

    This is addressed as follows:

    * reads outside critical sections become READ_ONCE()s (pairing with
    WRITE_ONCE()s added);

    * writes become WRITE_ONCE()s (pairing with READ_ONCE()s added); since
    writes happen inside critical sections, only the write and not the read
    of RMWs needs to be atomic, thus WRITE_ONCE(var, var +/- X) is
    sufficient.

    The data races were reported by KCSAN:

    BUG: KCSAN: data-race in __free_object / fill_pool

    write to 0xffffffff8beb04f8 of 4 bytes by interrupt on cpu 1:
    __free_object+0x1ee/0x8e0 lib/debugobjects.c:404
    __debug_check_no_obj_freed+0x199/0x330 lib/debugobjects.c:969
    debug_check_no_obj_freed+0x3c/0x44 lib/debugobjects.c:994
    slab_free_hook mm/slub.c:1422 [inline]

    read to 0xffffffff8beb04f8 of 4 bytes by task 1 on cpu 2:
    fill_pool+0x3d/0x520 lib/debugobjects.c:135
    __debug_object_init+0x3c/0x810 lib/debugobjects.c:536
    debug_object_init lib/debugobjects.c:591 [inline]
    debug_object_activate+0x228/0x320 lib/debugobjects.c:677
    debug_rcu_head_queue kernel/rcu/rcu.h:176 [inline]

    BUG: KCSAN: data-race in __debug_object_init / fill_pool

    read to 0xffffffff8beb04f8 of 4 bytes by task 10 on cpu 6:
    fill_pool+0x3d/0x520 lib/debugobjects.c:135
    __debug_object_init+0x3c/0x810 lib/debugobjects.c:536
    debug_object_init_on_stack+0x39/0x50 lib/debugobjects.c:606
    init_timer_on_stack_key kernel/time/timer.c:742 [inline]

    write to 0xffffffff8beb04f8 of 4 bytes by task 1 on cpu 3:
    alloc_object lib/debugobjects.c:258 [inline]
    __debug_object_init+0x717/0x810 lib/debugobjects.c:544
    debug_object_init lib/debugobjects.c:591 [inline]
    debug_object_activate+0x228/0x320 lib/debugobjects.c:677
    debug_rcu_head_queue kernel/rcu/rcu.h:176 [inline]

    BUG: KCSAN: data-race in free_obj_work / free_object

    read to 0xffffffff9140c190 of 4 bytes by task 10 on cpu 6:
    free_object+0x4b/0xd0 lib/debugobjects.c:426
    debug_object_free+0x190/0x210 lib/debugobjects.c:824
    destroy_timer_on_stack kernel/time/timer.c:749 [inline]

    write to 0xffffffff9140c190 of 4 bytes by task 93 on cpu 1:
    free_obj_work+0x24f/0x480 lib/debugobjects.c:313
    process_one_work+0x454/0x8d0 kernel/workqueue.c:2264
    worker_thread+0x9a/0x780 kernel/workqueue.c:2410

    Reported-by: Qian Cai
    Signed-off-by: Marco Elver
    Signed-off-by: Thomas Gleixner
    Link: https://lore.kernel.org/r/20200116185529.11026-1-elver@google.com

    Marco Elver