14 Jun, 2020

3 commits

  • Pull more Kbuild updates from Masahiro Yamada:

    - fix build rules in binderfs sample

    - fix build errors when Kbuild recurses to the top Makefile

    - covert '---help---' in Kconfig to 'help'

    * tag 'kbuild-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    treewide: replace '---help---' in Kconfig files with 'help'
    kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables
    samples: binderfs: really compile this sample and fix build issues

    Linus Torvalds
     
  • Pull x86 entry updates from Thomas Gleixner:
    "The x86 entry, exception and interrupt code rework

    This all started about 6 month ago with the attempt to move the Posix
    CPU timer heavy lifting out of the timer interrupt code and just have
    lockless quick checks in that code path. Trivial 5 patches.

    This unearthed an inconsistency in the KVM handling of task work and
    the review requested to move all of this into generic code so other
    architectures can share.

    Valid request and solved with another 25 patches but those unearthed
    inconsistencies vs. RCU and instrumentation.

    Digging into this made it obvious that there are quite some
    inconsistencies vs. instrumentation in general. The int3 text poke
    handling in particular was completely unprotected and with the batched
    update of trace events even more likely to expose to endless int3
    recursion.

    In parallel the RCU implications of instrumenting fragile entry code
    came up in several discussions.

    The conclusion of the x86 maintainer team was to go all the way and
    make the protection against any form of instrumentation of fragile and
    dangerous code pathes enforcable and verifiable by tooling.

    A first batch of preparatory work hit mainline with commit
    d5f744f9a2ac ("Pull x86 entry code updates from Thomas Gleixner")

    That (almost) full solution introduced a new code section
    '.noinstr.text' into which all code which needs to be protected from
    instrumentation of all sorts goes into. Any call into instrumentable
    code out of this section has to be annotated. objtool has support to
    validate this.

    Kprobes now excludes this section fully which also prevents BPF from
    fiddling with it and all 'noinstr' annotated functions also keep
    ftrace off. The section, kprobes and objtool changes are already
    merged.

    The major changes coming with this are:

    - Preparatory cleanups

    - Annotating of relevant functions to move them into the
    noinstr.text section or enforcing inlining by marking them
    __always_inline so the compiler cannot misplace or instrument
    them.

    - Splitting and simplifying the idtentry macro maze so that it is
    now clearly separated into simple exception entries and the more
    interesting ones which use interrupt stacks and have the paranoid
    handling vs. CR3 and GS.

    - Move quite some of the low level ASM functionality into C code:

    - enter_from and exit to user space handling. The ASM code now
    calls into C after doing the really necessary ASM handling and
    the return path goes back out without bells and whistels in
    ASM.

    - exception entry/exit got the equivivalent treatment

    - move all IRQ tracepoints from ASM to C so they can be placed as
    appropriate which is especially important for the int3
    recursion issue.

    - Consolidate the declaration and definition of entry points between
    32 and 64 bit. They share a common header and macros now.

    - Remove the extra device interrupt entry maze and just use the
    regular exception entry code.

    - All ASM entry points except NMI are now generated from the shared
    header file and the corresponding macros in the 32 and 64 bit
    entry ASM.

    - The C code entry points are consolidated as well with the help of
    DEFINE_IDTENTRY*() macros. This allows to ensure at one central
    point that all corresponding entry points share the same
    semantics. The actual function body for most entry points is in an
    instrumentable and sane state.

    There are special macros for the more sensitive entry points, e.g.
    INT3 and of course the nasty paranoid #NMI, #MCE, #DB and #DF.
    They allow to put the whole entry instrumentation and RCU handling
    into safe places instead of the previous pray that it is correct
    approach.

    - The INT3 text poke handling is now completely isolated and the
    recursion issue banned. Aside of the entry rework this required
    other isolation work, e.g. the ability to force inline bsearch.

    - Prevent #DB on fragile entry code, entry relevant memory and
    disable it on NMI, #MC entry, which allowed to get rid of the
    nested #DB IST stack shifting hackery.

    - A few other cleanups and enhancements which have been made
    possible through this and already merged changes, e.g.
    consolidating and further restricting the IDT code so the IDT
    table becomes RO after init which removes yet another popular
    attack vector

    - About 680 lines of ASM maze are gone.

    There are a few open issues:

    - An escape out of the noinstr section in the MCE handler which needs
    some more thought but under the aspect that MCE is a complete
    trainwreck by design and the propability to survive it is low, this
    was not high on the priority list.

    - Paravirtualization

    When PV is enabled then objtool complains about a bunch of indirect
    calls out of the noinstr section. There are a few straight forward
    ways to fix this, but the other issues vs. general correctness were
    more pressing than parawitz.

    - KVM

    KVM is inconsistent as well. Patches have been posted, but they
    have not yet been commented on or picked up by the KVM folks.

    - IDLE

    Pretty much the same problems can be found in the low level idle
    code especially the parts where RCU stopped watching. This was
    beyond the scope of the more obvious and exposable problems and is
    on the todo list.

    The lesson learned from this brain melting exercise to morph the
    evolved code base into something which can be validated and understood
    is that once again the violation of the most important engineering
    principle "correctness first" has caused quite a few people to spend
    valuable time on problems which could have been avoided in the first
    place. The "features first" tinkering mindset really has to stop.

    With that I want to say thanks to everyone involved in contributing to
    this effort. Special thanks go to the following people (alphabetical
    order): Alexandre Chartre, Andy Lutomirski, Borislav Petkov, Brian
    Gerst, Frederic Weisbecker, Josh Poimboeuf, Juergen Gross, Lai
    Jiangshan, Macro Elver, Paolo Bonzin,i Paul McKenney, Peter Zijlstra,
    Vitaly Kuznetsov, and Will Deacon"

    * tag 'x86-entry-2020-06-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (142 commits)
    x86/entry: Force rcu_irq_enter() when in idle task
    x86/entry: Make NMI use IDTENTRY_RAW
    x86/entry: Treat BUG/WARN as NMI-like entries
    x86/entry: Unbreak __irqentry_text_start/end magic
    x86/entry: __always_inline CR2 for noinstr
    lockdep: __always_inline more for noinstr
    x86/entry: Re-order #DB handler to avoid *SAN instrumentation
    x86/entry: __always_inline arch_atomic_* for noinstr
    x86/entry: __always_inline irqflags for noinstr
    x86/entry: __always_inline debugreg for noinstr
    x86/idt: Consolidate idt functionality
    x86/idt: Cleanup trap_init()
    x86/idt: Use proper constants for table size
    x86/idt: Add comments about early #PF handling
    x86/idt: Mark init only functions __init
    x86/entry: Rename trace_hardirqs_off_prepare()
    x86/entry: Clarify irq_{enter,exit}_rcu()
    x86/entry: Remove DBn stacks
    x86/entry: Remove debug IDT frobbing
    x86/entry: Optimize local_db_save() for virt
    ...

    Linus Torvalds
     
  • Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over
    '---help---'"), the number of '---help---' has been gradually
    decreasing, but there are still more than 2400 instances.

    This commit finishes the conversion. While I touched the lines,
    I also fixed the indentation.

    There are a variety of indentation styles found.

    a) 4 spaces + '---help---'
    b) 7 spaces + '---help---'
    c) 8 spaces + '---help---'
    d) 1 space + 1 tab + '---help---'
    e) 1 tab + '---help---' (correct indentation)
    f) 1 tab + 1 space + '---help---'
    g) 1 tab + 2 spaces + '---help---'

    In order to convert all of them to 1 tab + 'help', I ran the
    following commend:

    $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

12 Jun, 2020

9 commits

  • Pull the Kernel Concurrency Sanitizer from Thomas Gleixner:
    "The Kernel Concurrency Sanitizer (KCSAN) is a dynamic race detector,
    which relies on compile-time instrumentation, and uses a
    watchpoint-based sampling approach to detect races.

    The feature was under development for quite some time and has already
    found legitimate bugs.

    Unfortunately it comes with a limitation, which was only understood
    late in the development cycle:

    It requires an up to date CLANG-11 compiler

    CLANG-11 is not yet released (scheduled for June), but it's the only
    compiler today which handles the kernel requirements and especially
    the annotations of functions to exclude them from KCSAN
    instrumentation correctly.

    These annotations really need to work so that low level entry code and
    especially int3 text poke handling can be completely isolated.

    A detailed discussion of the requirements and compiler issues can be
    found here:

    https://lore.kernel.org/lkml/CANpmjNMTsY_8241bS7=XAfqvZHFLrVEkv_uM4aDUWE_kh3Rvbw@mail.gmail.com/

    We came to the conclusion that trying to work around compiler
    limitations and bugs again would end up in a major trainwreck, so
    requiring a working compiler seemed to be the best choice.

    For Continous Integration purposes the compiler restriction is
    manageable and that's where most xxSAN reports come from.

    For a change this limitation might make GCC people actually look at
    their bugs. Some issues with CSAN in GCC are 7 years old and one has
    been 'fixed' 3 years ago with a half baken solution which 'solved' the
    reported issue but not the underlying problem.

    The KCSAN developers also ponder to use a GCC plugin to become
    independent, but that's not something which will show up in a few
    days.

    Blocking KCSAN until wide spread compiler support is available is not
    a really good alternative because the continuous growth of lockless
    optimizations in the kernel demands proper tooling support"

    * tag 'locking-kcsan-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (76 commits)
    compiler_types.h, kasan: Use __SANITIZE_ADDRESS__ instead of CONFIG_KASAN to decide inlining
    compiler.h: Move function attributes to compiler_types.h
    compiler.h: Avoid nested statement expression in data_race()
    compiler.h: Remove data_race() and unnecessary checks from {READ,WRITE}_ONCE()
    kcsan: Update Documentation to change supported compilers
    kcsan: Remove 'noinline' from __no_kcsan_or_inline
    kcsan: Pass option tsan-instrument-read-before-write to Clang
    kcsan: Support distinguishing volatile accesses
    kcsan: Restrict supported compilers
    kcsan: Avoid inserting __tsan_func_entry/exit if possible
    ubsan, kcsan: Don't combine sanitizer with kcov on clang
    objtool, kcsan: Add kcsan_disable_current() and kcsan_enable_current_nowarn()
    kcsan: Add __kcsan_{enable,disable}_current() variants
    checkpatch: Warn about data_race() without comment
    kcsan: Use GFP_ATOMIC under spin lock
    Improve KCSAN documentation a bit
    kcsan: Make reporting aware of KCSAN tests
    kcsan: Fix function matching in report
    kcsan: Change data_race() to no longer require marking racing accesses
    kcsan: Move kcsan_{disable,enable}_current() to kcsan-checks.h
    ...

    Linus Torvalds
     
  • Pull updates from Andrew Morton:
    "A few fixes and stragglers.

    Subsystems affected by this patch series: mm/memory-failure, ocfs2,
    lib/lzo, misc"

    * emailed patches from Andrew Morton :
    amdgpu: a NULL ->mm does not mean a thread is a kthread
    lib/lzo: fix ambiguous encoding bug in lzo-rle
    ocfs2: fix build failure when TCP/IP is disabled
    mm/memory-failure: send SIGBUS(BUS_MCEERR_AR) only to current thread
    mm/memory-failure: prioritize prctl(PR_MCE_KILL) over vm.memory_failure_early_kill

    Linus Torvalds
     
  • In some rare cases, for input data over 32 KB, lzo-rle could encode two
    different inputs to the same compressed representation, so that
    decompression is then ambiguous (i.e. data may be corrupted - although
    zram is not affected because it operates over 4 KB pages).

    This modifies the compressor without changing the decompressor or the
    bitstream format, such that:

    - there is no change to how data produced by the old compressor is
    decompressed

    - an old decompressor will correctly decode data from the updated
    compressor

    - performance and compression ratio are not affected

    - we avoid introducing a new bitstream format

    In testing over 12.8M real-world files totalling 903 GB, three files
    were affected by this bug. I also constructed 37M semi-random 64 KB
    files totalling 2.27 TB, and saw no affected files. Finally I tested
    over files constructed to contain each of the ~1024 possible bad input
    sequences; for all of these cases, updated lzo-rle worked correctly.

    There is no significant impact to performance or compression ratio.

    Signed-off-by: Dave Rodgman
    Signed-off-by: Andrew Morton
    Cc: Mark Rutland
    Cc: Dave Rodgman
    Cc: Willy Tarreau
    Cc: Sergey Senozhatsky
    Cc: Markus F.X.J. Oberhumer
    Cc: Minchan Kim
    Cc: Nitin Gupta
    Cc: Chao Yu
    Cc:
    Link: http://lkml.kernel.org/r/20200507100203.29785-1-dave.rodgman@arm.com
    Signed-off-by: Linus Torvalds

    Dave Rodgman
     
  • Pull more x86 updates from Thomas Gleixner:
    "A set of fixes and updates for x86:

    - Unbreak paravirt VDSO clocks.

    While the VDSO code was moved into lib for sharing a subtle check
    for the validity of paravirt clocks got replaced. While the
    replacement works perfectly fine for bare metal as the update of
    the VDSO clock mode is synchronous, it fails for paravirt clocks
    because the hypervisor can invalidate them asynchronously.

    Bring it back as an optional function so it does not inflict this
    on architectures which are free of PV damage.

    - Fix the jiffies to jiffies64 mapping on 64bit so it does not
    trigger an ODR violation on newer compilers

    - Three fixes for the SSBD and *IB* speculation mitigation maze to
    ensure consistency, not disabling of some *IB* variants wrongly and
    to prevent a rogue cross process shutdown of SSBD. All marked for
    stable.

    - Add yet more CPU models to the splitlock detection capable list
    !@#%$!

    - Bring the pr_info() back which tells that TSC deadline timer is
    enabled.

    - Reboot quirk for MacBook6,1"

    * tag 'x86-urgent-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/vdso: Unbreak paravirt VDSO clocks
    lib/vdso: Provide sanity check for cycles (again)
    clocksource: Remove obsolete ifdef
    x86_64: Fix jiffies ODR violation
    x86/speculation: PR_SPEC_FORCE_DISABLE enforcement for indirect branches.
    x86/speculation: Prevent rogue cross-process SSBD shutdown
    x86/speculation: Avoid force-disabling IBPB based on STIBP and enhanced IBRS.
    x86/cpu: Add Sapphire Rapids CPU model number
    x86/split_lock: Add Icelake microserver and Tigerlake CPU models
    x86/apic: Make TSC deadline timer detection message visible
    x86/reboot/quirks: Add MacBook6,1 reboot quirk

    Linus Torvalds
     
  • Pull timer fix from Thomas Gleixner:
    "A small fix for the VDSO code to force inline
    __cvdso_clock_gettime_common() so the compiler
    can't generate horrible code"

    * tag 'timers-urgent-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    lib/vdso: Force inlining of __cvdso_clock_gettime_common()

    Linus Torvalds
     
  • Merge some more updates from Andrew Morton:

    - various hotfixes and minor things

    - hch's use_mm/unuse_mm clearnups

    Subsystems affected by this patch series: mm/hugetlb, scripts, kcov,
    lib, nilfs, checkpatch, lib, mm/debug, ocfs2, lib, misc.

    * emailed patches from Andrew Morton :
    kernel: set USER_DS in kthread_use_mm
    kernel: better document the use_mm/unuse_mm API contract
    kernel: move use_mm/unuse_mm to kthread.c
    kernel: move use_mm/unuse_mm to kthread.c
    stacktrace: cleanup inconsistent variable type
    lib: test get_count_order/long in test_bitops.c
    mm: add comments on pglist_data zones
    ocfs2: fix spelling mistake and grammar
    mm/debug_vm_pgtable: fix kernel crash by checking for THP support
    lib: fix bitmap_parse() on 64-bit big endian archs
    checkpatch: correct check for kernel parameters doc
    nilfs2: fix null pointer dereference at nilfs_segctor_do_construct()
    lib/lz4/lz4_decompress.c: document deliberate use of `&'
    kcov: check kcov_softirq in kcov_remote_stop()
    scripts/spelling: add a few more typos
    khugepaged: selftests: fix timeout condition in wait_for_scan()

    Linus Torvalds
     
  • The first version of Clang that supports -tsan-distinguish-volatile will
    be able to support KCSAN. The first Clang release to do so, will be
    Clang 11. This is due to satisfying all the following requirements:

    1. Never emit calls to __tsan_func_{entry,exit}.

    2. __no_kcsan functions should not call anything, not even
    kcsan_{enable,disable}_current(), when using __{READ,WRITE}_ONCE => Requires
    leaving them plain!

    3. Support atomic_{read,set}*() with KCSAN, which rely on
    arch_atomic_{read,set}*() using __{READ,WRITE}_ONCE() => Because of
    #2, rely on Clang 11's -tsan-distinguish-volatile support. We will
    double-instrument atomic_{read,set}*(), but that's reasonable given
    it's still lower cost than the data_race() variant due to avoiding 2
    extra calls (kcsan_{en,dis}able_current() calls).

    4. __always_inline functions inlined into __no_kcsan functions are never
    instrumented.

    5. __always_inline functions inlined into instrumented functions are
    instrumented.

    6. __no_kcsan_or_inline functions may be inlined into __no_kcsan functions =>
    Implies leaving 'noinline' off of __no_kcsan_or_inline.

    7. Because of #6, __no_kcsan and __no_kcsan_or_inline functions should never be
    spuriously inlined into instrumented functions, causing the accesses of the
    __no_kcsan function to be instrumented.

    Older versions of Clang do not satisfy #3. The latest GCC currently
    doesn't support at least #1, #3, and #7.

    Signed-off-by: Marco Elver
    Signed-off-by: Borislav Petkov
    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra (Intel)
    Acked-by: Will Deacon
    Link: https://lkml.kernel.org/r/CANpmjNMTsY_8241bS7=XAfqvZHFLrVEkv_uM4aDUWE_kh3Rvbw@mail.gmail.com
    Link: https://lkml.kernel.org/r/20200521142047.169334-7-elver@google.com

    Marco Elver
     
  • Clang does not allow -fsanitize-coverage=trace-{pc,cmp} together
    with -fsanitize=bounds or with ubsan:

    clang: error: argument unused during compilation: '-fsanitize-coverage=trace-pc' [-Werror,-Wunused-command-line-argument]
    clang: error: argument unused during compilation: '-fsanitize-coverage=trace-cmp' [-Werror,-Wunused-command-line-argument]

    To avoid the warning, check whether clang can handle this correctly or
    disallow ubsan and kcsan when kcov is enabled.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Marco Elver
    Signed-off-by: Borislav Petkov
    Signed-off-by: Thomas Gleixner
    Acked-by: Marco Elver
    Acked-by: Peter Zijlstra (Intel)
    Link: https://bugs.llvm.org/show_bug.cgi?id=45831
    Link: https://lore.kernel.org/lkml/20200505142341.1096942-1-arnd@arndb.de
    Link: https://lkml.kernel.org/r/20200521142047.169334-2-elver@google.com

    Arnd Bergmann
     
  • Merge the state of the locking kcsan branch before the read/write_once()
    and the atomics modifications got merged.

    Squash the fallout of the rebase on top of the read/write once and atomic
    fallback work into the merge. The history of the original branch is
    preserved in tag locking-kcsan-2020-06-02.

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

11 Jun, 2020

7 commits

  • For code that needs the ultimate performance (it can inline the @cmp
    function too) or simply needs to avoid calling external functions for
    whatever reason, provide an __always_inline variant of bsearch().

    [ tglx: Renamed to __inline_bsearch() as suggested by Andy ]

    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexandre Chartre
    Acked-by: Andy Lutomirski
    Link: https://lkml.kernel.org/r/20200505135313.624443814@linutronix.de

    Peter Zijlstra
     
  • That code is already not traceable. Move it into the noinstr section so the
    objtool section validation does not trigger.

    Annotate the warning code as "safe". While it might be not under all
    circumstances, getting the information out is important enough.

    Should this ever trigger from the sensitive code which is shielded against
    instrumentation, e.g. low level entry, then the printk is the least of the
    worries.

    Addresses the objtool warnings:
    vmlinux.o: warning: objtool: context_tracking_recursion_enter()+0x7: call to __this_cpu_preempt_check() leaves .noinstr.text section
    vmlinux.o: warning: objtool: __context_tracking_exit()+0x17: call to __this_cpu_preempt_check() leaves .noinstr.text section
    vmlinux.o: warning: objtool: __context_tracking_enter()+0x2a: call to __this_cpu_preempt_check() leaves .noinstr.text section

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexandre Chartre
    Acked-by: Peter Zijlstra
    Link: https://lkml.kernel.org/r/20200505134340.902709267@linutronix.de

    Thomas Gleixner
     
  • Add some tests for get_count_order/long in test_bitops.c.

    [akpm@linux-foundation.org: define local `i']
    [akpm@linux-foundation.org: enhancement, warning fix, cleanup per Geert]
    [akpm@linux-foundation.org: fix loop bound, per Wei Yang]

    Signed-off-by: Wei Yang
    Signed-off-by: Andrew Morton
    Reviewed-by: Andy Shevchenko
    Cc: Christian Brauner
    Cc: Geert Uytterhoeven
    Link: http://lkml.kernel.org/r/20200602223728.32722-1-richard.weiyang@gmail.com
    Signed-off-by: Linus Torvalds

    Wei Yang
     
  • Commit 2d6261583be0 ("lib: rework bitmap_parse()") does not take into
    account order of halfwords on 64-bit big endian architectures. As
    result (at least) Receive Packet Steering, IRQ affinity masks and
    runtime kernel test "test_bitmap" get broken on s390.

    [andriy.shevchenko@linux.intel.com: convert infinite while loop to a for loop]
    Link: http://lkml.kernel.org/r/20200609140535.87160-1-andriy.shevchenko@linux.intel.com

    Fixes: 2d6261583be0 ("lib: rework bitmap_parse()")
    Signed-off-by: Alexander Gordeev
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Andrew Morton
    Reviewed-by: Andy Shevchenko
    Cc: Yury Norov
    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
    Cc:
    Link: http://lkml.kernel.org/r/1591634471-17647-1-git-send-email-agordeev@linux.ibm.com
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • This operation was intentional, but tools such as smatch will warn that it
    might not have been.

    Signed-off-by: Andrew Morton
    Cc: Yann Collet
    Cc: Vasily Averin
    Cc: Gao Xiang
    Link: http://lkml.kernel.org/r/3bf931c6ea0cae3e23f3485801986859851b4f04.camel@perches.com
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Pull READ/WRITE_ONCE rework from Will Deacon:
    "This the READ_ONCE rework I've been working on for a while, which
    bumps the minimum GCC version and improves code-gen on arm64 when
    stack protector is enabled"

    [ Side note: I'm _really_ tempted to raise the minimum gcc version to
    4.9, so that we can just say that we require _Generic() support.

    That would allow us to more cleanly handle a lot of the cases where we
    depend on very complex macros with 'sizeof' or __builtin_choose_expr()
    with __builtin_types_compatible_p() etc.

    This branch has a workaround for sparse not handling _Generic(),
    either, but that was already fixed in the sparse development branch,
    so it's really just gcc-4.9 that we'd require. - Linus ]

    * 'rwonce/rework' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux:
    compiler_types.h: Use unoptimized __unqual_scalar_typeof for sparse
    compiler_types.h: Optimize __unqual_scalar_typeof compilation time
    compiler.h: Enforce that READ_ONCE_NOCHECK() access size is sizeof(long)
    compiler-types.h: Include naked type in __pick_integer_type() match
    READ_ONCE: Fix comment describing 2x32-bit atomicity
    gcov: Remove old GCC 3.4 support
    arm64: barrier: Use '__unqual_scalar_typeof' for acquire/release macros
    locking/barriers: Use '__unqual_scalar_typeof' for load-acquire macros
    READ_ONCE: Drop pointer qualifiers when reading from scalar types
    READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses
    READ_ONCE: Simplify implementations of {READ,WRITE}_ONCE()
    arm64: csum: Disable KASAN for do_csum()
    fault_inject: Don't rely on "return value" from WRITE_ONCE()
    net: tls: Avoid assigning 'const' pointer to non-const pointer
    netfilter: Avoid assigning 'const' pointer to non-const pointer
    compiler/gcc: Raise minimum GCC version for kernel builds to 4.8

    Linus Torvalds
     
  • Pull MTD updates from Richard Weinberger:
    "MTD core changes:
    - partition parser: Support MTD names containing one or more colons.
    - mtdblock: clear cache_state to avoid writing to bad blocks
    repeatedly.

    Raw NAND core changes:
    - Stop using nand_release(), patched all drivers.
    - Give more information about the ECC weakness when not matching the
    chip's requirement.
    - MAINTAINERS updates.
    - Support emulated SLC mode on MLC NANDs.
    - Support "constrained" controllers, adapt the core and ONFI/JEDEC
    table parsing and Micron's code.
    - Take check_only into account.
    - Add an invalid ECC mode to discriminate with valid ones.
    - Return an enum from of_get_nand_ecc_algo().
    - Drop OOB_FIRST placement scheme.
    - Introduce nand_extract_bits().
    - Ensure a consistent bitflips numbering.
    - BCH lib:
    - Allow easy bit swapping.
    - Rework a little bit the exported function names.
    - Fix nand_gpio_waitrdy().
    - Propage CS selection to sub operations.
    - Add a NAND_NO_BBM_QUIRK flag.
    - Give the possibility to verify a read operation is supported.
    - Add a helper to check supported operations.
    - Avoid indirect access to ->data_buf().
    - Rename the use_bufpoi variables.
    - Fix comments about the use of bufpoi.
    - Rename a NAND chip option.
    - Reorder the nand_chip->options flags.
    - Translate obscure bitfields into readable macros.
    - Timings:
    - Fix default values.
    - Add mode information to the timings structure.

    Raw NAND controller driver changes:
    - Fixed many error paths.
    - Arasan
    - New driver
    - Au1550nd:
    - Various cleanups
    - Migration to ->exec_op()
    - brcmnand:
    - Misc cleanup.
    - Support v2.1-v2.2 controllers.
    - Remove unused including .
    - Correctly verify erased pages.
    - Fix Hamming OOB layout.
    - Cadence
    - Make cadence_nand_attach_chip static.
    - Cafe:
    - Set the NAND_NO_BBM_QUIRK flag
    - cmx270:
    - Remove this controller driver.
    - cs553x:
    - Misc cleanup
    - Migration to ->exec_op()
    - Davinci:
    - Misc cleanup.
    - Migration to ->exec_op()
    - Denali:
    - Add more delays before latching incoming data
    - Diskonchip:
    - Misc cleanup
    - Migration to ->exec_op()
    - Fsmc:
    - Change to non-atomic bit operations.
    - GPMI:
    - Use nand_extract_bits()
    - Fix runtime PM imbalance.
    - Ingenic:
    - Migration to exec_op()
    - Fix the RB gpio active-high property on qi, lb60
    - Make qi_lb60_ooblayout_ops static.
    - Marvell:
    - Misc cleanup and small fixes
    - Nandsim:
    - Fix the error paths, driver wide.
    - Omap_elm:
    - Fix runtime PM imbalance.
    - STM32_FMC2:
    - Misc cleanups (error cases, comments, timeout valus, cosmetic
    changes).

    SPI NOR core changes:
    - Add, update support and fix few flashes.
    - Prepare BFPT parsing for JESD216 rev D.
    - Kernel doc fixes.

    CFI changes:
    - Support the absence of protection registers for Intel CFI flashes.
    - Replace zero-length array with flexible-arrays"

    * tag 'mtd/for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (208 commits)
    mtd: clear cache_state to avoid writing to bad blocks repeatedly
    mtd: parser: cmdline: Support MTD names containing one or more colons
    mtd: physmap_of_gemini: remove defined but not used symbol 'syscon_match'
    mtd: rawnand: Add an invalid ECC mode to discriminate with valid ones
    mtd: rawnand: Return an enum from of_get_nand_ecc_algo()
    mtd: rawnand: Drop OOB_FIRST placement scheme
    mtd: rawnand: Avoid a typedef
    mtd: Fix typo in mtd_ooblayout_set_databytes() description
    mtd: rawnand: Stop using nand_release()
    mtd: rawnand: nandsim: Reorganize ns_cleanup_module()
    mtd: rawnand: nandsim: Rename a label in ns_init_module()
    mtd: rawnand: nandsim: Manage lists on error in ns_init_module()
    mtd: rawnand: nandsim: Fix the label pointing on nand_cleanup()
    mtd: rawnand: nandsim: Free erase_block_wear on error
    mtd: rawnand: nandsim: Use an additional label when freeing the nandsim object
    mtd: rawnand: nandsim: Stop using nand_release()
    mtd: rawnand: nandsim: Free the partition names in ns_free()
    mtd: rawnand: nandsim: Free the allocated device on error in ns_init()
    mtd: rawnand: nandsim: Free partition names on error in ns_init()
    mtd: rawnand: nandsim: Fix the two ns_alloc_device() error paths
    ...

    Linus Torvalds
     

10 Jun, 2020

9 commits

  • Pull tracing updates from Steven Rostedt:
    "No new features this release. Mostly clean ups, restructuring and
    documentation.

    - Have ftrace_bug() show ftrace errors before the WARN, as the WARN
    will reboot the box before the error messages are printed if
    panic_on_warn is set.

    - Have traceoff_on_warn disable tracing sooner (before prints)

    - Write a message to the trace buffer that its being disabled when
    disable_trace_on_warning() is set.

    - Separate out synthetic events from histogram code to let it be used
    by other parts of the kernel.

    - More documentation on histogram design.

    - Other small fixes and clean ups"

    * tag 'trace-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    tracing: Remove obsolete PREEMPTIRQ_EVENTS kconfig option
    tracing/doc: Fix ascii-art in histogram-design.rst
    tracing: Add a trace print when traceoff_on_warning is triggered
    ftrace,bug: Improve traceoff_on_warn
    selftests/ftrace: Distinguish between hist and synthetic event checks
    tracing: Move synthetic events to a separate file
    tracing: Fix events.rst section numbering
    tracing/doc: Fix typos in histogram-design.rst
    tracing: Add hist_debug trace event files for histogram debugging
    tracing: Add histogram-design document
    tracing: Check state.disabled in synth event trace functions
    tracing/probe: reverse arguments to list_add
    tools/bootconfig: Add a summary of test cases and return error
    ftrace: show debugging information when panic_on_warn set

    Linus Torvalds
     
  • …kernel/git/shuah/linux-kselftest

    Pull Kunit updates from Shuah Khan:
    "This consists of:

    - Several config fragment fixes from Anders Roxell to improve test
    coverage.

    - Improvements to kunit run script to use defconfig as default and
    restructure the code for config/build/exec/parse from Vitor Massaru
    Iha and David Gow.

    - Miscellaneous documentation warn fix"

    * tag 'linux-kselftest-kunit-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
    security: apparmor: default KUNIT_* fragments to KUNIT_ALL_TESTS
    fs: ext4: default KUNIT_* fragments to KUNIT_ALL_TESTS
    drivers: base: default KUNIT_* fragments to KUNIT_ALL_TESTS
    lib: Kconfig.debug: default KUNIT_* fragments to KUNIT_ALL_TESTS
    kunit: default KUNIT_* fragments to KUNIT_ALL_TESTS
    kunit: Kconfig: enable a KUNIT_ALL_TESTS fragment
    kunit: Fix TabError, remove defconfig code and handle when there is no kunitconfig
    kunit: use KUnit defconfig by default
    kunit: use --build_dir=.kunit as default
    Documentation: test.h - fix warnings
    kunit: kunit_tool: Separate out config/build/exec/parse

    Linus Torvalds
     
  • …/git/shuah/linux-kselftest

    Pull kselftest updates from Shuah Khan:
    "This consists of:

    - Several fixes from Masami Hiramatsu to improve coverage for lib and
    sysctl tests.

    - Clean up to vdso test and a new test for getcpu() from Mark Brown.

    - Add new gen_tar selftests Makefile target generate selftest package
    running "make gen_tar" in selftests directory from Veronika
    Kabatova.

    - Other miscellaneous fixes to timens, exec, tpm2 tests"

    * tag 'linux-kselftest-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
    selftests/sysctl: Make sysctl test driver as a module
    selftests/sysctl: Fix to load test_sysctl module
    lib: Make test_sysctl initialized as module
    lib: Make prime number generator independently selectable
    selftests/ftrace: Return unsupported if no error_log file
    selftests/ftrace: Use printf for backslash included command
    selftests/timens: handle a case when alarm clocks are not supported
    Kernel selftests: Add check if TPM devices are supported
    selftests: vdso: Add a selftest for vDSO getcpu()
    selftests: vdso: Use a header file to prototype parse_vdso API
    selftests: vdso: Rename vdso_test to vdso_test_gettimeofday
    selftests/exec: Verify execve of non-regular files fail
    selftests: introduce gen_tar Makefile target

    Linus Torvalds
     
  • Convert comments that reference mmap_sem to reference mmap_lock instead.

    [akpm@linux-foundation.org: fix up linux-next leftovers]
    [akpm@linux-foundation.org: s/lockaphore/lock/, per Vlastimil]
    [akpm@linux-foundation.org: more linux-next fixups, per Michel]

    Signed-off-by: Michel Lespinasse
    Signed-off-by: Andrew Morton
    Reviewed-by: Vlastimil Babka
    Reviewed-by: Daniel Jordan
    Cc: Davidlohr Bueso
    Cc: David Rientjes
    Cc: Hugh Dickins
    Cc: Jason Gunthorpe
    Cc: Jerome Glisse
    Cc: John Hubbard
    Cc: Laurent Dufour
    Cc: Liam Howlett
    Cc: Matthew Wilcox
    Cc: Peter Zijlstra
    Cc: Ying Han
    Link: http://lkml.kernel.org/r/20200520052908.204642-13-walken@google.com
    Signed-off-by: Linus Torvalds

    Michel Lespinasse
     
  • Convert the last few remaining mmap_sem rwsem calls to use the new mmap
    locking API. These were missed by coccinelle for some reason (I think
    coccinelle does not support some of the preprocessor constructs in these
    files ?)

    [akpm@linux-foundation.org: convert linux-next leftovers]
    [akpm@linux-foundation.org: more linux-next leftovers]
    [akpm@linux-foundation.org: more linux-next leftovers]

    Signed-off-by: Michel Lespinasse
    Signed-off-by: Andrew Morton
    Reviewed-by: Daniel Jordan
    Reviewed-by: Laurent Dufour
    Reviewed-by: Vlastimil Babka
    Cc: Davidlohr Bueso
    Cc: David Rientjes
    Cc: Hugh Dickins
    Cc: Jason Gunthorpe
    Cc: Jerome Glisse
    Cc: John Hubbard
    Cc: Liam Howlett
    Cc: Matthew Wilcox
    Cc: Peter Zijlstra
    Cc: Ying Han
    Link: http://lkml.kernel.org/r/20200520052908.204642-6-walken@google.com
    Signed-off-by: Linus Torvalds

    Michel Lespinasse
     
  • This change converts the existing mmap_sem rwsem calls to use the new mmap
    locking API instead.

    The change is generated using coccinelle with the following rule:

    // spatch --sp-file mmap_lock_api.cocci --in-place --include-headers --dir .

    @@
    expression mm;
    @@
    (
    -init_rwsem
    +mmap_init_lock
    |
    -down_write
    +mmap_write_lock
    |
    -down_write_killable
    +mmap_write_lock_killable
    |
    -down_write_trylock
    +mmap_write_trylock
    |
    -up_write
    +mmap_write_unlock
    |
    -downgrade_write
    +mmap_write_downgrade
    |
    -down_read
    +mmap_read_lock
    |
    -down_read_killable
    +mmap_read_lock_killable
    |
    -down_read_trylock
    +mmap_read_trylock
    |
    -up_read
    +mmap_read_unlock
    )
    -(&mm->mmap_sem)
    +(mm)

    Signed-off-by: Michel Lespinasse
    Signed-off-by: Andrew Morton
    Reviewed-by: Daniel Jordan
    Reviewed-by: Laurent Dufour
    Reviewed-by: Vlastimil Babka
    Cc: Davidlohr Bueso
    Cc: David Rientjes
    Cc: Hugh Dickins
    Cc: Jason Gunthorpe
    Cc: Jerome Glisse
    Cc: John Hubbard
    Cc: Liam Howlett
    Cc: Matthew Wilcox
    Cc: Peter Zijlstra
    Cc: Ying Han
    Link: http://lkml.kernel.org/r/20200520052908.204642-5-walken@google.com
    Signed-off-by: Linus Torvalds

    Michel Lespinasse
     
  • Patch series "mm: consolidate definitions of page table accessors", v2.

    The low level page table accessors (pXY_index(), pXY_offset()) are
    duplicated across all architectures and sometimes more than once. For
    instance, we have 31 definition of pgd_offset() for 25 supported
    architectures.

    Most of these definitions are actually identical and typically it boils
    down to, e.g.

    static inline unsigned long pmd_index(unsigned long address)
    {
    return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
    }

    static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
    {
    return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address);
    }

    These definitions can be shared among 90% of the arches provided
    XYZ_SHIFT, PTRS_PER_XYZ and xyz_page_vaddr() are defined.

    For architectures that really need a custom version there is always
    possibility to override the generic version with the usual ifdefs magic.

    These patches introduce include/linux/pgtable.h that replaces
    include/asm-generic/pgtable.h and add the definitions of the page table
    accessors to the new header.

    This patch (of 12):

    The linux/mm.h header includes to allow inlining of the
    functions involving page table manipulations, e.g. pte_alloc() and
    pmd_alloc(). So, there is no point to explicitly include
    in the files that include .

    The include statements in such cases are remove with a simple loop:

    for f in $(git grep -l "include ") ; do
    sed -i -e '/include / d' $f
    done

    Signed-off-by: Mike Rapoport
    Signed-off-by: Andrew Morton
    Cc: Arnd Bergmann
    Cc: Borislav Petkov
    Cc: Brian Cain
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Ungerer
    Cc: Guan Xuetao
    Cc: Guo Ren
    Cc: Heiko Carstens
    Cc: Helge Deller
    Cc: Ingo Molnar
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Matthew Wilcox
    Cc: Matt Turner
    Cc: Max Filippov
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Mike Rapoport
    Cc: Nick Hu
    Cc: Paul Walmsley
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Stafford Horne
    Cc: Thomas Bogendoerfer
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vincent Chen
    Cc: Vineet Gupta
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Link: http://lkml.kernel.org/r/20200514170327.31389-1-rppt@kernel.org
    Link: http://lkml.kernel.org/r/20200514170327.31389-2-rppt@kernel.org
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Now the last users of show_stack() got converted to use an explicit log
    level, show_stack_loglvl() can drop it's redundant suffix and become once
    again well known show_stack().

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Link: http://lkml.kernel.org/r/20200418201944.482088-51-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     
  • Align the last users of show_stack() by KERN_DEFAULT as the surrounding
    headers/messages.

    Signed-off-by: Dmitry Safonov
    Signed-off-by: Andrew Morton
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Will Deacon
    Link: http://lkml.kernel.org/r/20200418201944.482088-50-dima@arista.com
    Signed-off-by: Linus Torvalds

    Dmitry Safonov
     

09 Jun, 2020

4 commits

  • The original x86 VDSO implementation checked for the validity of the clock
    source read by testing whether the returned signed cycles value is less
    than zero. This check was also used by the vdso read function to signal
    that the current selected clocksource is not VDSO capable.

    During the rework of the VDSO code the check was removed and replaced with
    a check for the clocksource mode being != NONE.

    This turned out to be a mistake because the check is necessary for paravirt
    and hyperv clock sources. The reason is that these clock sources have their
    own internal sequence counter to validate the clocksource at the point of
    reading it. This is necessary because the hypervisor can invalidate the
    clocksource asynchronously so a check during the VDSO data update is not
    sufficient. Having a separate indicator for the validity is slower than
    just validating the cycles value. The check for it being negative turned
    out to be the fastest implementation and safe as it would require an uptime
    of ~73 years with a 4GHz counter frequency to result in a false positive.

    Add an optional function to validate the cycles with a default
    implementation which allows the compiler to optimize it out for
    architectures which do not require it.

    Fixes: 5d51bee725cc ("clocksource: Add common vdso clock mode storage")
    Reported-by: Miklos Szeredi
    Signed-off-by: Thomas Gleixner
    Tested-by: Miklos Szeredi
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/20200606221531.963970768@linutronix.de

    Thomas Gleixner
     
  • Merge still more updates from Andrew Morton:
    "Various trees. Mainly those parts of MM whose linux-next dependents
    are now merged. I'm still sitting on ~160 patches which await merges
    from -next.

    Subsystems affected by this patch series: mm/proc, ipc, dynamic-debug,
    panic, lib, sysctl, mm/gup, mm/pagemap"

    * emailed patches from Andrew Morton : (52 commits)
    doc: cgroup: update note about conditions when oom killer is invoked
    module: move the set_fs hack for flush_icache_range to m68k
    nommu: use flush_icache_user_range in brk and mmap
    binfmt_flat: use flush_icache_user_range
    exec: use flush_icache_user_range in read_code
    exec: only build read_code when needed
    m68k: implement flush_icache_user_range
    arm: rename flush_cache_user_range to flush_icache_user_range
    xtensa: implement flush_icache_user_range
    sh: implement flush_icache_user_range
    asm-generic: add a flush_icache_user_range stub
    mm: rename flush_icache_user_range to flush_icache_user_page
    arm,sparc,unicore32: remove flush_icache_user_range
    riscv: use asm-generic/cacheflush.h
    powerpc: use asm-generic/cacheflush.h
    openrisc: use asm-generic/cacheflush.h
    m68knommu: use asm-generic/cacheflush.h
    microblaze: use asm-generic/cacheflush.h
    ia64: use asm-generic/cacheflush.h
    hexagon: use asm-generic/cacheflush.h
    ...

    Linus Torvalds
     
  • Testing is done by a new parameter debug.test_sysctl.boot_int which
    defaults to 0 and it's expected that the tester passes a boot parameter
    that sets it to 1. The test checks if it's set to 1.

    To distinguish true failure from parameter not being set, the test
    checks /proc/cmdline for the expected parameter, and whether test_sysctl
    is built-in and not a module.

    [vbabka@suse.cz: skip the new test if boot_int sysctl is not present]
    Link: http://lkml.kernel.org/r/305af605-1e60-cf84-fada-6ce1ca37c102@suse.cz

    Signed-off-by: Vlastimil Babka
    Signed-off-by: Andrew Morton
    Cc: Alexey Dobriyan
    Cc: Christian Brauner
    Cc: David Rientjes
    Cc: "Eric W . Biederman"
    Cc: Greg Kroah-Hartman
    Cc: "Guilherme G . Piccoli"
    Cc: Iurii Zaikin
    Cc: Ivan Teterevkov
    Cc: Kees Cook
    Cc: Luis Chamberlain
    Cc: Masami Hiramatsu
    Cc: Matthew Wilcox
    Cc: Michal Hocko
    Cc: Michal Hocko
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/20200427180433.7029-6-vbabka@suse.cz
    Signed-off-by: Linus Torvalds

    Vlastimil Babka
     
  • Instead of enabling dynamic debug globally with CONFIG_DYNAMIC_DEBUG,
    CONFIG_DYNAMIC_DEBUG_CORE will only enable core function of dynamic
    debug. With the DYNAMIC_DEBUG_MODULE defined for any modules, dynamic
    debug will be tied to them.

    This is useful for people who only want to enable dynamic debug for
    kernel modules without worrying about kernel image size and memory
    consumption is increasing too much.

    [orson.zhai@unisoc.com: v2]
    Link: http://lkml.kernel.org/r/1587408228-10861-1-git-send-email-orson.unisoc@gmail.com

    Signed-off-by: Orson Zhai
    Signed-off-by: Andrew Morton
    Acked-by: Greg Kroah-Hartman
    Acked-by: Petr Mladek
    Cc: Jonathan Corbet
    Cc: Sergey Senozhatsky
    Cc: Steven Rostedt
    Cc: Jason Baron
    Cc: Randy Dunlap
    Link: http://lkml.kernel.org/r/1586521984-5890-1-git-send-email-orson.unisoc@gmail.com
    Signed-off-by: Linus Torvalds

    Orson Zhai
     

08 Jun, 2020

2 commits

  • Pull networking fixes from David Miller:

    - Fix the build with certain Kconfig combinations for the Chelsio
    inline TLS device, from Rohit Maheshwar and Vinay Kumar Yadavi.

    - Fix leak in genetlink, from Cong Lang.

    - Fix out of bounds packet header accesses in seg6, from Ahmed
    Abdelsalam.

    - Two XDP fixes in the ENA driver, from Sameeh Jubran

    - Use rwsem in device rename instead of a seqcount because this code
    can sleep, from Ahmed S. Darwish.

    - Fix WoL regressions in r8169, from Heiner Kallweit.

    - Fix qed crashes in kdump mode, from Alok Prasad.

    - Fix the callbacks used for certain thermal zones in mlxsw, from Vadim
    Pasternak.

    * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (35 commits)
    net: dsa: lantiq_gswip: fix and improve the unsupported interface error
    mlxsw: core: Use different get_trend() callbacks for different thermal zones
    net: dp83869: Reset return variable if PHY strap is read
    rhashtable: Drop raw RCU deref in nested_table_free
    cxgb4: Use kfree() instead kvfree() where appropriate
    net: qed: fixes crash while running driver in kdump kernel
    vsock/vmci: make vmci_vsock_transport_cb() static
    net: ethtool: Fix comment mentioning typo in IS_ENABLED()
    net: phy: mscc: fix Serdes configuration in vsc8584_config_init
    net: mscc: Fix OF_MDIO config check
    net: marvell: Fix OF_MDIO config check
    net: dp83867: Fix OF_MDIO config check
    net: dp83869: Fix OF_MDIO config check
    net: ethernet: mvneta: fix MVNETA_SKB_HEADROOM alignment
    ethtool: linkinfo: remove an unnecessary NULL check
    net/xdp: use shift instead of 64 bit division
    crypto/chtls:Fix compile error when CONFIG_IPV6 is disabled
    inet_connection_sock: clear inet_num out of destroy helper
    yam: fix possible memory leak in yam_init_driver
    lan743x: Use correct MAC_CR configuration for 1 GBit speed
    ...

    Linus Torvalds
     
  • Pull driver core updates from Greg KH:
    "Here is the set of driver core patches for 5.8-rc1.

    Not all that huge this release, just a number of small fixes and
    updates:

    - software node fixes

    - kobject now sends KOBJ_REMOVE when it is removed from sysfs, not
    when it is removed from memory (which could come much later)

    - device link additions and fixes based on testing on more devices

    - firmware core cleanups

    - other minor changes, full details in the shortlog

    All have been in linux-next for a while with no reported issues"

    * tag 'driver-core-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (23 commits)
    driver core: Update device link status correctly for SYNC_STATE_ONLY links
    firmware_loader: change enum fw_opt to u32
    software node: implement software_node_unregister()
    kobject: send KOBJ_REMOVE uevent when the object is removed from sysfs
    driver core: Remove unnecessary is_fwnode_dev variable in device_add()
    drivers property: When no children in primary, try secondary
    driver core: platform: Fix spelling errors in platform.c
    driver core: Remove check in driver_deferred_probe_force_trigger()
    of: platform: Batch fwnode parsing when adding all top level devices
    driver core: fw_devlink: Add support for batching fwnode parsing
    driver core: Look for waiting consumers only for a fwnode's primary device
    driver core: Move code to the right part of the file
    Revert "Revert "driver core: Set fw_devlink to "permissive" behavior by default""
    drivers: base: Fix NULL pointer exception in __platform_driver_probe() if a driver developer is foolish
    firmware_loader: move fw_fallback_config to a private kernel symbol namespace
    driver core: Add missing '\n' in log messages
    driver/base/soc: Use kobj_to_dev() API
    Add documentation on meaning of -EPROBE_DEFER
    driver core: platform: remove redundant assignment to variable ret
    debugfs: Use the correct style for SPDX License Identifier
    ...

    Linus Torvalds
     

07 Jun, 2020

2 commits

  • This patch replaces some unnecessary uses of rcu_dereference_raw
    in the rhashtable code with rcu_dereference_protected.

    The top-level nested table entry is only marked as RCU because it
    shares the same type as the tree entries underneath it. So it
    doesn't need any RCU protection.

    We also don't need RCU protection when we're freeing a nested RCU
    table because by this stage we've long passed a memory barrier
    when anyone could change the nested table.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • Pull Kbuild updates from Masahiro Yamada:

    - fix warnings in 'make clean' for ARCH=um, hexagon, h8300, unicore32

    - ensure to rebuild all objects when the compiler is upgraded

    - exclude system headers from dependency tracking and fixdep processing

    - fix potential bit-size mismatch between the kernel and BPF user-mode
    helper

    - add the new syntax 'userprogs' to build user-space programs for the
    target architecture (the same arch as the kernel)

    - compile user-space sample code under samples/ for the target arch
    instead of the host arch

    - make headers_install fail if a CONFIG option is leaked to user-space

    - sanitize the output format of scripts/checkstack.pl

    - handle ARM 'push' instruction in scripts/checkstack.pl

    - error out before modpost if a module name conflict is found

    - error out when multiple directories are passed to M= because this
    feature is broken for a long time

    - add CONFIG_DEBUG_INFO_COMPRESSED to support compressed debug info

    - a lot of cleanups of modpost

    - dump vmlinux symbols out into vmlinux.symvers, and reuse it in the
    second pass of modpost

    - do not run the second pass of modpost if nothing in modules is
    updated

    - install modules.builtin(.modinfo) by 'make install' as well as by
    'make modules_install' because it is useful even when
    CONFIG_MODULES=n

    - add new command line variables, GZIP, BZIP2, LZOP, LZMA, LZ4, and XZ
    to allow users to use alternatives such as pigz, pbzip2, etc.

    * tag 'kbuild-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (96 commits)
    kbuild: add variables for compression tools
    Makefile: install modules.builtin even if CONFIG_MODULES=n
    mksysmap: Fix the mismatch of '.L' symbols in System.map
    kbuild: doc: rename LDFLAGS to KBUILD_LDFLAGS
    modpost: change elf_info->size to size_t
    modpost: remove is_vmlinux() helper
    modpost: strip .o from modname before calling new_module()
    modpost: set have_vmlinux in new_module()
    modpost: remove mod->skip struct member
    modpost: add mod->is_vmlinux struct member
    modpost: remove is_vmlinux() call in check_for_{gpl_usage,unused}()
    modpost: remove mod->is_dot_o struct member
    modpost: move -d option in scripts/Makefile.modpost
    modpost: remove -s option
    modpost: remove get_next_text() and make {grab,release_}file static
    modpost: use read_text_file() and get_line() for reading text files
    modpost: avoid false-positive file open error
    modpost: fix potential mmap'ed file overrun in get_src_version()
    modpost: add read_text_file() and get_line() helpers
    modpost: do not call get_modinfo() for vmlinux(.o)
    ...

    Linus Torvalds
     

05 Jun, 2020

4 commits

  • Pull ARM/SoC driver updates from Arnd Bergmann:
    "These are updates to SoC specific drivers that did not have another
    subsystem maintainer tree to go through for some reason:

    - Some bus and memory drivers for the MIPS P5600 based Baikal-T1 SoC
    that is getting added through the MIPS tree.

    - There are new soc_device identification drivers for TI K3, Qualcomm
    MSM8939

    - New reset controller drivers for NXP i.MX8MP, Renesas RZ/G1H, and
    Hisilicon hi6220

    - The SCMI firmware interface can now work across ARM SMC/HVC as a
    transport.

    - Mediatek platforms now use a new driver for their "MMSYS" hardware
    block that controls clocks and some other aspects in behalf of the
    media and gpu drivers.

    - Some Tegra processors have improved power management support,
    including getting woken up by the PMIC and cluster power down
    during idle.

    - A new v4l staging driver for Tegra is added.

    - Cleanups and minor bugfixes for TI, NXP, Hisilicon, Mediatek, and
    Tegra"

    * tag 'arm-drivers-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (155 commits)
    clk: sprd: fix compile-testing
    bus: bt1-axi: Build the driver into the kernel
    bus: bt1-apb: Build the driver into the kernel
    bus: bt1-axi: Use sysfs_streq instead of strncmp
    bus: bt1-axi: Optimize the return points in the driver
    bus: bt1-apb: Use sysfs_streq instead of strncmp
    bus: bt1-apb: Use PTR_ERR_OR_ZERO to return from request-regs method
    bus: bt1-apb: Fix show/store callback identations
    bus: bt1-apb: Include linux/io.h
    dt-bindings: memory: Add Baikal-T1 L2-cache Control Block binding
    memory: Add Baikal-T1 L2-cache Control Block driver
    bus: Add Baikal-T1 APB-bus driver
    bus: Add Baikal-T1 AXI-bus driver
    dt-bindings: bus: Add Baikal-T1 APB-bus binding
    dt-bindings: bus: Add Baikal-T1 AXI-bus binding
    staging: tegra-video: fix V4L2 dependency
    tee: fix crypto select
    drivers: soc: ti: knav_qmss_queue: Make knav_gp_range_ops static
    soc: ti: add k3 platforms chipid module driver
    dt-bindings: soc: ti: add binding for k3 platforms chipid module
    ...

    Linus Torvalds
     
  • The latest compiler expects slightly different function prototypes
    for the ubsan helpers:

    lib/ubsan.c:192:6: error: conflicting types for built-in function '__ubsan_handle_add_overflow'; expected 'void(void *, void *, void *)' [-Werror=builtin-declaration-mismatch]
    192 | void __ubsan_handle_add_overflow(struct overflow_data *data,
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    lib/ubsan.c:200:6: error: conflicting types for built-in function '__ubsan_handle_sub_overflow'; expected 'void(void *, void *, void *)' [-Werror=builtin-declaration-mismatch]
    200 | void __ubsan_handle_sub_overflow(struct overflow_data *data,
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    lib/ubsan.c:207:6: error: conflicting types for built-in function '__ubsan_handle_mul_overflow'; expected 'void(void *, void *, void *)' [-Werror=builtin-declaration-mismatch]
    207 | void __ubsan_handle_mul_overflow(struct overflow_data *data,
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    lib/ubsan.c:214:6: error: conflicting types for built-in function '__ubsan_handle_negate_overflow'; expected 'void(void *, void *)' [-Werror=builtin-declaration-mismatch]
    214 | void __ubsan_handle_negate_overflow(struct overflow_data *data,
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    lib/ubsan.c:234:6: error: conflicting types for built-in function '__ubsan_handle_divrem_overflow'; expected 'void(void *, void *, void *)' [-Werror=builtin-declaration-mismatch]
    234 | void __ubsan_handle_divrem_overflow(struct overflow_data *data,
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Change the Linux implementation to match these, using a local typed
    pointer.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Reviewed-by: Kees Cook
    Cc: Andrey Ryabinin
    Cc: Herbert Xu
    Cc: Julien Grall
    Link: http://lkml.kernel.org/r/20200429185948.4189600-1-arnd@arndb.de
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     
  • Test some bit clears/sets to make sure assembly doesn't change, and that
    the set_bit and clear_bit functions work and don't cause sparse warnings.

    Instruct Kbuild to build this file with extra warning level -Wextra, to
    catch new issues, and also doesn't hurt to build with C=1.

    This was used to test changes to arch/x86/include/asm/bitops.h.

    In particular, sparse (C=1) was very concerned when the last bit before a
    natural boundary, like 7, or 31, was being tested, as this causes sign
    extension (0xffffff7f) for instance when clearing bit 7.

    Recommended usage:

    make defconfig
    scripts/config -m CONFIG_TEST_BITOPS
    make modules_prepare
    make C=1 W=1 lib/test_bitops.ko
    objdump -S -d lib/test_bitops.ko
    insmod lib/test_bitops.ko
    rmmod lib/test_bitops.ko

    , there should be no compiler/sparse warnings and no
    error messages in log.

    Link: http://lkml.kernel.org/r/20200310221747.2848474-2-jesse.brandeburg@intel.com
    Signed-off-by: Jesse Brandeburg
    Reviewed-by: Andy Shevchenko
    Cc: Thomas Gleixner
    CcL Ingo Molnar
    Signed-off-by: Andrew Morton
    Cc: Borislav Petkov
    Cc: Rasmus Villemoes
    Cc: Dan Williams
    Cc: Peter Zijlstra
    Cc: Wei Yang
    Cc: Christian Brauner
    Signed-off-by: Linus Torvalds

    Jesse Brandeburg
     
  • If the given type has fraction smaller than max_frac/FPROP_FRAC_BASE, the
    code could be modified to call __fprop_inc_percpu() directly and easier to
    understand. After this patch, fprop_reflect_period_percpu() will be
    called twice, and quicky return on pl->period == p->period test, so it
    would not result to significant downside of performance.

    Thanks for Jan's guidance.

    Signed-off-by: Tan Hu
    Signed-off-by: Andrew Morton
    Reviewed-by: Jan Kara
    Cc:
    Cc: Yi Wang
    Cc:
    Link: http://lkml.kernel.org/r/1589004753-27554-1-git-send-email-tan.hu@zte.com.cn
    Signed-off-by: Linus Torvalds

    Tan Hu