Skip to content
  1. Feb 27, 2021
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.12-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 8b83369d
      Linus Torvalds authored
      Pull RISC-V updates from Palmer Dabbelt:
       "A handful of new RISC-V related patches for this merge window:
      
         - A check to ensure drivers are properly using uaccess. This isn't
           manifesting with any of the drivers I'm currently using, but may
           catch errors in new drivers.
      
         - Some preliminary support for the FU740, along with the HiFive
           Unleashed it will appear on.
      
         - NUMA support for RISC-V, which involves making the arm64 code
           generic.
      
         - Support for kasan on the vmalloc region.
      
         - A handful of new drivers for the Kendryte K210, along with the DT
           plumbing required to boot on a handful of K210-based boards.
      
         - Support for allocating ASIDs.
      
         - Preliminary support for kernels larger than 128MiB.
      
         - Various other improvements to our KASAN support, including the
           utilization of huge pages when allocating the KASAN regions.
      
        We may have already found a bug with the KASAN_VMALLOC code, but it's
        passing my tests. There's a fix in the works, but that will probably
        miss the merge window.
      
      * tag 'riscv-for-linus-5.12-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (75 commits)
        riscv: Improve kasan population by using hugepages when possible
        riscv: Improve kasan population function
        riscv: Use KASAN_SHADOW_INIT define for kasan memory initialization
        riscv: Improve kasan definitions
        riscv: Get rid of MAX_EARLY_MAPPING_SIZE
        soc: canaan: Sort the Makefile alphabetically
        riscv: Disable KSAN_SANITIZE for vDSO
        riscv: Remove unnecessary declaration
        riscv: Add Canaan Kendryte K210 SD card defconfig
        riscv: Update Canaan Kendryte K210 defconfig
        riscv: Add Kendryte KD233 board device tree
        riscv: Add SiPeed MAIXDUINO board device tree
        riscv: Add SiPeed MAIX GO board device tree
        riscv: Add SiPeed MAIX DOCK board device tree
        riscv: Add SiPeed MAIX BiT board device tree
        riscv: Update Canaan Kendryte K210 device tree
        dt-bindings: add resets property to dw-apb-timer
        dt-bindings: fix sifive gpio properties
        dt-bindings: update sifive uart compatible string
        dt-bindings: update sifive clint compatible string
        ...
      8b83369d
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 8f47d753
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "The big one is a fix for the VHE enabling path during early boot,
        where the code enabling the MMU wasn't necessarily in the identity map
        of the new page-tables, resulting in a consistent crash with 64k
        pages. In fixing that, we noticed some missing barriers too, so we
        added those for the sake of architectural compliance.
      
        Other than that, just the usual merge window trickle. There'll be more
        to come, too.
      
        Summary:
      
         - Fix lockdep false alarm on resume-from-cpuidle path
      
         - Fix memory leak in kexec_file
      
         - Fix module linker script to work with GDB
      
         - Fix error code when trying to use uprobes with AArch32 instructions
      
         - Fix late VHE enabling with 64k pages
      
         - Add missing ISBs after TLB invalidation
      
         - Fix seccomp when tracing syscall -1
      
         - Fix stacktrace return code at end of stack
      
         - Fix inconsistent whitespace for pointer return values
      
         - Fix compiler warnings when building with W=1"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: stacktrace: Report when we reach the end of the stack
        arm64: ptrace: Fix seccomp of traced syscall -1 (NO_SYSCALL)
        arm64: Add missing ISB after invalidating TLB in enter_vhe
        arm64: Add missing ISB after invalidating TLB in __primary_switch
        arm64: VHE: Enable EL2 MMU from the idmap
        KVM: arm64: make the hyp vector table entries local
        arm64/mm: Fixed some coding style issues
        arm64: uprobe: Return EOPNOTSUPP for AARCH32 instruction probing
        kexec: move machine_kexec_post_load() to public interface
        arm64 module: set plt* section addresses to 0x0
        arm64: kexec_file: fix memory leakage in create_dtb() when fdt_open_into() fails
        arm64: spectre: Prevent lockdep splat on v4 mitigation enable path
      8f47d753
    • Linus Torvalds's avatar
      Merge tag 'm68knommu-for-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu · a422ce5b
      Linus Torvalds authored
      Pull m68knommu update from Greg Ungerer:
       "Only a single change. NULL parameter check in the local ColdFire
        clocking code"
      
      * tag 'm68knommu-for-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
        m68k: let clk_enable() return immediately if clk is NULL
      a422ce5b
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 8b1e2c50
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "Two fixes:
      
         - Fix an unsafe printf string usage in a kmem trace event
      
         - Fix spelling in output from the latency-collector tool"
      
      * tag 'trace-v5.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing/tools: fix a couple of spelling mistakes
        mm, tracing: Fix kmem_cache_free trace event to not print stale pointers
      8b1e2c50
    • Linus Torvalds's avatar
      Merge tag 'orphan-handling-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 2bd3f4ee
      Linus Torvalds authored
      Pull orphan handling fix from Kees Cook:
       "Another case of bogus .eh_frame emission was noticed under
        CONFIG_GCOV_KERNEL=y.
      
        Summary:
      
         - Define SANITIZER_DISCARDS with CONFIG_GCOV_KERNEL=y (Nathan
           Chancellor)"
      
      * tag 'orphan-handling-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        vmlinux.lds.h: Define SANITIZER_DISCARDS with CONFIG_GCOV_KERNEL=y
      2bd3f4ee
    • Linus Torvalds's avatar
      Merge tag 'clang-lto-v5.12-rc1-fix1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · fe1072ff
      Linus Torvalds authored
      Pull clang LTO fixes from Kees Cook:
       "This gets parisc building again and moves LTO artifact caching cleanup
        from the 'distclean' build target to 'clean'.
      
        Summary:
      
         - Fix parisc build for ftrace vs mcount (Sami Tolvanen)
      
         - Move .thinlto-cache remove to "clean" from "distclean" (Masahiro Yamada)"
      
      * tag 'clang-lto-v5.12-rc1-fix1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        kbuild: Move .thinlto-cache removal to 'make clean'
        parisc: select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
      fe1072ff
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.12b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 5c2e7a0a
      Linus Torvalds authored
      Pull more xen updates from Juergen Gross:
      
       - A small series for Xen event channels adding some sysfs nodes for per
         pv-device settings and statistics, and two fixes of theoretical
         problems.
      
       - two minor fixes (one for an unlikely error path, one for a comment).
      
      * tag 'for-linus-5.12b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen-front-pgdir-shbuf: don't record wrong grant handle upon error
        xen: Replace lkml.org links with lore
        xen/evtchn: use READ/WRITE_ONCE() for accessing ring indices
        xen/evtchn: use smp barriers for user event ring
        xen/events: add per-xenbus device event statistics and settings
      5c2e7a0a
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · d94d1400
      Linus Torvalds authored
      Pull more KVM updates from Paolo Bonzini:
       "x86:
      
         - take into account HVA before retrying on MMU notifier race
      
         - fixes for nested AMD guests without NPT
      
         - allow INVPCID in guest without PCID
      
         - disable PML in hardware when not in use
      
         - MMU code cleanups:
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (28 commits)
        KVM: SVM: Fix nested VM-Exit on #GP interception handling
        KVM: vmx/pmu: Fix dummy check if lbr_desc->event is created
        KVM: x86/mmu: Consider the hva in mmu_notifier retry
        KVM: x86/mmu: Skip mmu_notifier check when handling MMIO page fault
        KVM: Documentation: rectify rst markup in KVM_GET_SUPPORTED_HV_CPUID
        KVM: nSVM: prepare guest save area while is_guest_mode is true
        KVM: x86/mmu: Remove a variety of unnecessary exports
        KVM: x86: Fold "write-protect large" use case into generic write-protect
        KVM: x86/mmu: Don't set dirty bits when disabling dirty logging w/ PML
        KVM: VMX: Dynamically enable/disable PML based on memslot dirty logging
        KVM: x86: Further clarify the logic and comments for toggling log dirty
        KVM: x86: Move MMU's PML logic to common code
        KVM: x86/mmu: Make dirty log size hook (PML) a value, not a function
        KVM: x86/mmu: Expand on the comment in kvm_vcpu_ad_need_write_protect()
        KVM: nVMX: Disable PML in hardware when running L2
        KVM: x86/mmu: Consult max mapping level when zapping collapsible SPTEs
        KVM: x86/mmu: Pass the memslot to the rmap callbacks
        KVM: x86/mmu: Split out max mapping level calculation to helper
        KVM: x86/mmu: Expand collapsible SPTE zap for TDP MMU to ZONE_DEVICE and HugeTLB pages
        KVM: nVMX: no need to undo inject_page_fault change on nested vmexit
        ...
      d94d1400
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 245137cd
      Linus Torvalds authored
      Merge more updates from Andrew Morton:
       "118 patches:
      
         - The rest of MM.
      
           Includes kfence - another runtime memory validator. Not as thorough
           as KASAN, but it has unmeasurable overhead and is intended to be
           usable in production builds.
      
         - Everything else
      
        Subsystems affected by this patch series: alpha, procfs, sysctl,
        misc, core-kernel, MAINTAINERS, lib, bitops, checkpatch, init,
        coredump, seq_file, gdb, ubsan, initramfs, and mm (thp, cma,
        vmstat, memory-hotplug, mlock, rmap, zswap, zsmalloc, cleanups,
        kfence, kasan2, and pagemap2)"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (118 commits)
        MIPS: make userspace mapping young by default
        initramfs: panic with memory information
        ubsan: remove overflow checks
        kgdb: fix to kill breakpoints on initmem after boot
        scripts/gdb: fix list_for_each
        x86: fix seq_file iteration for pat/memtype.c
        seq_file: document how per-entry resources are managed.
        fs/coredump: use kmap_local_page()
        init/Kconfig: fix a typo in CC_VERSION_TEXT help text
        init: clean up early_param_on_off() macro
        init/version.c: remove Version_<LINUX_VERSION_CODE> symbol
        checkpatch: do not apply "initialise globals to 0" check to BPF progs
        checkpatch: don't warn about colon termination in linker scripts
        checkpatch: add kmalloc_array_node to unnecessary OOM message check
        checkpatch: add warning for avoiding .L prefix symbols in assembly files
        checkpatch: improve TYPECAST_INT_CONSTANT test message
        checkpatch: prefer ftrace over function entry/exit printks
        checkpatch: trivial style fixes
        checkpatch: ignore warning designated initializers using NR_CPUS
        checkpatch: improve blank line after declaration test
        ...
      245137cd
    • Huang Pei's avatar
      MIPS: make userspace mapping young by default · f685a533
      Huang Pei authored
      
      
      MIPS page fault path(except huge page) takes 3 exceptions (1 TLB Miss + 2
      TLB Invalid), butthe second TLB Invalid exception is just triggered by
      __update_tlb from do_page_fault writing tlb without _PAGE_VALID set.  With
      this patch, user space mapping prot is made young by default (with both
      _PAGE_VALID and _PAGE_YOUNG set), and it only take 1 TLB Miss + 1 TLB
      Invalid exception
      
      Remove pte_sw_mkyoung without polluting MM code and make page fault delay
      of MIPS on par with other architecture
      
      Link: https://lkml.kernel.org/r/20210204013942.8398-1-huangpei@loongson.cn
      Signed-off-by: default avatarHuang Pei <huangpei@loongson.cn>
      Reviewed-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Acked-by: default avatar <huangpei@loongson.cn>
      Acked-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: <ambrosehua@gmail.com>
      Cc: Bibo Mao <maobibo@loongson.cn>
      Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
      Cc: Paul Burton <paulburton@kernel.org>
      Cc: Li Xuefeng <lixuefeng@loongson.cn>
      Cc: Yang Tiezhu <yangtiezhu@loongson.cn>
      Cc: Gao Juxin <gaojuxin@loongson.cn>
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f685a533
    • Florian Fainelli's avatar
      initramfs: panic with memory information · dd23e809
      Florian Fainelli authored
      
      
      On systems with large amounts of reserved memory we may fail to
      successfully complete unpack_to_rootfs() and be left with:
      
       Kernel panic - not syncing: write error
      
      this is not too helpful to understand what happened, so let's wrap the
      panic() calls with a surrounding show_mem() such that we have a chance of
      understanding the memory conditions leading to these allocation failures.
      
      [akpm@linux-foundation.org: replace macro with C function]
      
      Link: https://lkml.kernel.org/r/20210114231517.1854379-1-f.fainelli@gmail.com
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Cc: Barret Rhoden <brho@google.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      dd23e809
    • Andrey Ryabinin's avatar
      ubsan: remove overflow checks · 6aaa31ae
      Andrey Ryabinin authored
      Since GCC 8.0 -fsanitize=signed-integer-overflow doesn't work with
      -fwrapv.  -fwrapv makes signed overflows defines and GCC essentially
      disables ubsan checks.  On GCC < 8.0 -fwrapv doesn't have influence on
      -fsanitize=signed-integer-overflow setting, so it kinda works but
      generates false-positves and violates uaccess rules:
      
      lib/iov_iter.o: warning: objtool: iovec_from_user()+0x22d: call to
      __ubsan_handle_add_overflow() with UACCESS enabled
      
      Disable signed overflow checks to avoid these problems.  Remove unsigned
      overflow checks as well.  Unsigned overflow appeared as side effect of
      commit cdf8a76f
      
       ("ubsan: move cc-option tests into Kconfig"), but it
      never worked (kernel doesn't boot).  And unsigned overflows are allowed by
      C standard, so it just pointless.
      
      Link: https://lkml.kernel.org/r/20210209232348.20510-1-ryabinin.a.a@gmail.com
      Signed-off-by: default avatarAndrey Ryabinin <ryabinin.a.a@gmail.com>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6aaa31ae
    • Sumit Garg's avatar
      kgdb: fix to kill breakpoints on initmem after boot · d54ce615
      Sumit Garg authored
      
      
      Currently breakpoints in kernel .init.text section are not handled
      correctly while allowing to remove them even after corresponding pages
      have been freed.
      
      Fix it via killing .init.text section breakpoints just prior to initmem
      pages being freed.
      
      Doug: "HW breakpoints aren't handled by this patch but it's probably
      not such a big deal".
      
      Link: https://lkml.kernel.org/r/20210224081652.587785-1-sumit.garg@linaro.org
      Signed-off-by: default avatarSumit Garg <sumit.garg@linaro.org>
      Suggested-by: default avatarDoug Anderson <dianders@chromium.org>
      Acked-by: default avatarDoug Anderson <dianders@chromium.org>
      Acked-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
      Tested-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d54ce615
    • George Prekas's avatar
      scripts/gdb: fix list_for_each · db7fbf49
      George Prekas authored
      
      
      If the list is uninitialized (next pointer is NULL), list_for_each gets
      stuck in an infinite loop. Print a message and treat list as empty.
      
      Link: https://lkml.kernel.org/r/4ae23bb1-c333-f669-da2d-fa35c4f49018@amazon.com
      Signed-off-by: default avatarGeorge Prekas <prekageo@amazon.com>
      Reviewed-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
      Cc: Kieran Bingham <kbingham@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      db7fbf49
    • NeilBrown's avatar
      x86: fix seq_file iteration for pat/memtype.c · 3d2fc4c0
      NeilBrown authored
      The memtype seq_file iterator allocates a buffer in the ->start and ->next
      functions and frees it in the ->show function.  The preferred handling for
      such resources is to free them in the subsequent ->next or ->stop function
      call.
      
      Since Commit 1f4aace6 ("fs/seq_file.c: simplify seq_file iteration
      code and interface") there is no guarantee that ->show will be called
      after ->next, so this function can now leak memory.
      
      So move the freeing of the buffer to ->next and ->stop.
      
      Link: https://lkml.kernel.org/r/161248539022.21478.13874455485854739066.stgit@noble1
      Fixes: 1f4aace6
      
       ("fs/seq_file.c: simplify seq_file iteration code and interface")
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Cc: Xin Long <lucien.xin@gmail.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Vlad Yasevich <vyasevich@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3d2fc4c0
    • NeilBrown's avatar
      seq_file: document how per-entry resources are managed. · b3656d82
      NeilBrown authored
      Patch series "Fix some seq_file users that were recently broken".
      
      A recent change to seq_file broke some users which were using seq_file
      in a non-"standard" way ...  though the "standard" isn't documented, so
      they can be excused.  The result is a possible leak - of memory in one
      case, of references to a 'transport' in the other.
      
      These three patches:
       1/ document and explain the problem
       2/ fix the problem user in x86
       3/ fix the problem user in net/sctp
      
      This patch (of 3):
      
      Users of seq_file will sometimes find it convenient to take a resource,
      such as a lock or memory allocation, in the ->start or ->next operations.
      These are per-entry resources, distinct from per-session resources which
      are taken in ->start and released in ->stop.
      
      The preferred management of these is release the resource on the
      subsequent call to ->next or ->stop.
      
      However prior to Commit 1f4aace6 ("fs/seq_file.c: simplify seq_file
      iteration code and interface") it happened that ->show would always be
      called after ->start or ->next, and a few users chose to release the
      resource in ->show.
      
      This is no longer reliable.  Since the mentioned commit, ->next will
      always come after a successful ->show (to ensure m->index is updated
      correctly), so the original ordering cannot be maintained.
      
      This patch updates the documentation to clearly state the required
      behaviour.  Other patches will fix the few problematic users.
      
      [akpm@linux-foundation.org: fix typo, per Willy]
      
      Link: https://lkml.kernel.org/r/161248518659.21478.2484341937387294998.stgit@noble1
      Link: https://lkml.kernel.org/r/161248539020.21478.3147971477400875336.stgit@noble1
      Fixes: 1f4aace6
      
       ("fs/seq_file.c: simplify seq_file iteration code and interface")
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Cc: Xin Long <lucien.xin@gmail.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Vlad Yasevich <vyasevich@gmail.com>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b3656d82
    • Ira Weiny's avatar
      fs/coredump: use kmap_local_page() · 3159ed57
      Ira Weiny authored
      
      
      In dump_user_range() there is no reason for the mapping to be global.  Use
      kmap_local_page() rather than kmap.
      
      Link: https://lkml.kernel.org/r/20210203223328.558945-1-ira.weiny@intel.com
      Signed-off-by: default avatarIra Weiny <ira.weiny@intel.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3159ed57
    • Bhaskar Chowdhury's avatar
      init/Kconfig: fix a typo in CC_VERSION_TEXT help text · f9c8bc46
      Bhaskar Chowdhury authored
      
      
      s/compier/compiler/
      
      Link: https://lkml.kernel.org/r/20210224223325.29099-1-unixbhaskar@gmail.com
      Signed-off-by: default avatarBhaskar Chowdhury <unixbhaskar@gmail.com>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f9c8bc46
    • Masahiro Yamada's avatar
      init: clean up early_param_on_off() macro · a5a673f7
      Masahiro Yamada authored
      
      
      Use early_param() to define early_param_on_off().
      
      Link: https://lkml.kernel.org/r/20210201041532.4025025-1-masahiroy@kernel.org
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Reviewed-by: default avatarJohan Hovold <johan@kernel.org>
      Reviewed-by: default avatarMiguel Ojeda <ojeda@kernel.org>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Joe Perches <joe@perches.com>
      Cc: Nick Desaulniers <ndesaulniers@gooogle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a5a673f7
    • Masahiro Yamada's avatar
      init/version.c: remove Version_<LINUX_VERSION_CODE> symbol · 073a9ecb
      Masahiro Yamada authored
      This code hunk creates a Version_<LINUX_VERSION_CODE> symbol if
      CONFIG_KALLSYMS is disabled.  For example, building the kernel v5.10 for
      allnoconfig creates the following symbol:
      
        $ nm vmlinux | grep Version_
        c116b028 B Version_330240
      
      There is no in-tree user of this symbol.
      
      Commit 197dcffc ("init/version.c: define version_string only if
      CONFIG_KALLSYMS is not defined") mentions that Version_* is only used
      with ksymoops.
      
      However, a commit in the pre-git era [1] had added the statement,
      "ksymoops is useless on 2.6.  Please use the Oops in its original format".
      
      That statement existed until commit 4eb92411
      
       ("Documentation:
      admin-guide: update bug-hunting.rst") finally removed the stale
      ksymoops information.
      
      This symbol is no longer needed.
      
      [1] https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=ad68b2f085f5c79e4759ca2d13947b3c885ee831
      
      Link: https://lkml.kernel.org/r/20210120033452.2895170-1-masahiroy@kernel.org
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Daniel Guilak <guilak@linux.vnet.ibm.com>
      Cc: Lee Revell <rlrevell@joe-job.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      073a9ecb
    • Song Liu's avatar
      checkpatch: do not apply "initialise globals to 0" check to BPF progs · 5b8f82e1
      Song Liu authored
      
      
      BPF programs explicitly initialise global variables to 0 to make sure
      clang (v10 or older) do not put the variables in the common section.  Skip
      "initialise globals to 0" check for BPF programs to elimiate error
      messages like:
      
          ERROR: do not initialise globals to 0
          #19: FILE: samples/bpf/tracex1_kern.c:21:
      
      Link: https://lkml.kernel.org/r/20210209211954.490077-1-songliubraving@fb.com
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      Acked-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5b8f82e1
    • Chris Down's avatar
      checkpatch: don't warn about colon termination in linker scripts · 263afd39
      Chris Down authored
      
      
      This check erroneously flags cases like the one in my recent printk
      enumeration patch[0], where the spaces are syntactic, and `section:' vs.
      `section :' is syntactically important:
      
          ERROR: space prohibited before that ':' (ctx:WxW)
          #258: FILE: include/asm-generic/vmlinux.lds.h:314:
          +       .printk_fmts : AT(ADDR(.printk_fmts) - LOAD_OFFSET) {
      
      0: https://lore.kernel.org/patchwork/patch/1375749/
      
      Link: https://lkml.kernel.org/r/YBwhqsc2TIVeid3t@chrisdown.name
      Link: https://lkml.kernel.org/r/YB6UsjCOy1qrrlSD@chrisdown.name
      Signed-off-by: default avatarChris Down <chris@chrisdown.name>
      Acked-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      263afd39
    • Joe Perches's avatar
      checkpatch: add kmalloc_array_node to unnecessary OOM message check · 58f02267
      Joe Perches authored
      commit 5799b255
      
       ("include/linux/slab.h: add kmalloc_array_node() and
      kcalloc_node()") was added in 2017.  Update the unnecessary OOM message
      test to include it.
      
      Link: https://lkml.kernel.org/r/b9dc4a808b1518e08ab8761480d9872e5d18e7cd.camel@perches.com
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Reported-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      58f02267
    • Aditya Srivastava's avatar
      checkpatch: add warning for avoiding .L prefix symbols in assembly files · de93245c
      Aditya Srivastava authored
      
      
      objtool requires that all code must be contained in an ELF symbol.  Symbol
      names that have a '.L' prefix do not emit symbol table entries, as they
      have special meaning for the assembler.
      
      '.L' prefixed symbols can be used within a code region, but should be
      avoided for denoting a range of code via 'SYM_*_START/END' annotations.
      
      Add a new check to emit a warning on finding the usage of '.L' symbols for
      '.S' files, if it denotes range of code via SYM_*_START/END annotation
      pair.
      
      Link: https://lkml.kernel.org/r/20210123190459.9701-1-yashsri421@gmail.com
      Link: https://lore.kernel.org/lkml/20210112210154.GI4646@sirena.org.uk
      Signed-off-by: default avatarAditya Srivastava <yashsri421@gmail.com>
      Suggested-by: default avatarMark Brown <broonie@kernel.org>
      Acked-by: default avatarJoe Perches <joe@perches.com>
      Acked-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Cc: Aditya Srivastava <yashsri421@gmail.com>
      Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
      Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      de93245c
    • Joe Perches's avatar
      checkpatch: improve TYPECAST_INT_CONSTANT test message · 0972b8bf
      Joe Perches authored
      
      
      Improve the TYPECAST_INT_CONSTANT test by showing the suggested conversion
      for various type of uses like (unsigned int)1 to 1U.
      
      Link: https://lkml.kernel.org/r/ecefe8dcb93fe7028311b69dd297ba52224233d4.camel@perches.com
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Cc: Douglas Gilbert <dgilbert@interlog.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0972b8bf
    • Joe Perches's avatar
      checkpatch: prefer ftrace over function entry/exit printks · adb2da82
      Joe Perches authored
      
      
      Prefer using ftrace over function entry/exit logging messages.
      
      Warn with various function entry/exit only logging that only
      use __func__ with or without descriptive decoration.
      
      Link: https://lkml.kernel.org/r/47c01081533a417c99c9a80a4cd537f8c308503f.camel@perches.com
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      adb2da82
    • Dwaipayan Ray's avatar
      checkpatch: trivial style fixes · ea7dbab3
      Dwaipayan Ray authored
      
      
      Indentations should use tabs wherever possible.
      Replace spaces by tabs for indents.
      
      Link: https://lkml.kernel.org/r/20210105103044.40282-1-dwaipayanray1@gmail.com
      Signed-off-by: default avatarDwaipayan Ray <dwaipayanray1@gmail.com>
      Acked-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ea7dbab3
    • Peng Wang's avatar
      checkpatch: ignore warning designated initializers using NR_CPUS · 35cdcbfc
      Peng Wang authored
      
      
      Some max_length wants to hold as large room as possible to ensure enough
      size to tackle with the biggest NR_CPUS.  An example below:
      
      kernel/cgroup/cpuset.c:
      static struct cftype legacy_files[] = {
              {
                      .name = "cpus",
                      .seq_show = cpuset_common_seq_show,
                      .write = cpuset_write_resmask,
                      .max_write_len = (100U + 6 * NR_CPUS),
                      .private = FILE_CPULIST,
              },
      	...
      }
      
      Link: https://lkml.kernel.org/r/5d4998aa8a8ac7efada2c7daffa9e73559f8b186.1609331255.git.rocking@linux.alibaba.com
      Signed-off-by: default avatarPeng Wang <rocking@linux.alibaba.com>
      Acked-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      35cdcbfc
    • Joe Perches's avatar
      checkpatch: improve blank line after declaration test · b5e8736a
      Joe Perches authored
      
      
      Avoid multiple false positives by ignoring attributes.
      
      Various attributes like volatile and ____cacheline_aligned_in_smp cause
      checkpatch to emit invalid "Missing a blank line after declarations"
      messages.
      
      Use copies of $sline and $prevline, remove $Attribute and $Sparse, and use
      the existing tests to avoid these false positives.
      
      Miscellanea:
      
      o Add volatile to $Attribute
      
      This also reduces checkpatch runtime a bit by moving the indentation
      comparison test to the start of the block to avoid multiple unnecessary
      regex tests.
      
      Link: https://lkml.kernel.org/r/9015fd00742bf4e5b824ad6d7fd7189530958548.camel@perches.com
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b5e8736a
    • Geert Uytterhoeven's avatar
      include/linux/bitops.h: spelling s/synomyn/synonym/ · 4945cca2
      Geert Uytterhoeven authored
      
      
      Fix a misspelling of "synonym".
      
      Link: https://lkml.kernel.org/r/20210108105305.2028120-1-geert+renesas@glider.be
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4945cca2
    • Masahiro Yamada's avatar
      lib/cmdline: remove an unneeded local variable in next_arg() · 96251a75
      Masahiro Yamada authored
      
      
      The local variable 'next' is unneeded because you can simply advance the
      existing pointer 'args'.
      
      Link: https://lkml.kernel.org/r/20210201014707.3828753-1-masahiroy@kernel.org
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      96251a75
    • Vijayanand Jitta's avatar
      lib: stackdepot: fix ignoring return value warning · 64427985
      Vijayanand Jitta authored
      
      
      Fix the below ignoring return value warning for kstrtobool in
      is_stack_depot_disabled function.
      
      lib/stackdepot.c: In function 'is_stack_depot_disabled':
      lib/stackdepot.c:154:2: warning: ignoring return value of 'kstrtobool'
      declared with attribute 'warn_unused_result' [-Wunused-result]
      
      Link: https://lkml.kernel.org/r/1612163048-28026-1-git-send-email-vjitta@codeaurora.org
      Fixes: b9779abb09a8 ("lib: stackdepot: add support to disable stack depot")
      Signed-off-by: default avatarVijayanand Jitta <vjitta@codeaurora.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      64427985
    • Vijayanand Jitta's avatar
      lib: stackdepot: add support to disable stack depot · e1fdc403
      Vijayanand Jitta authored
      
      
      Add a kernel parameter stack_depot_disable to disable stack depot.  So
      that stack hash table doesn't consume any memory when stack depot is
      disabled.
      
      The use case is CONFIG_PAGE_OWNER without page_owner=on.  Without this
      patch, stackdepot will consume the memory for the hashtable.  By default,
      it's 8M which is never trivial.
      
      With this option, in CONFIG_PAGE_OWNER configured system, page_owner=off,
      stack_depot_disable in kernel command line, we could save the wasted
      memory for the hashtable.
      
      [akpm@linux-foundation.org: fix CONFIG_STACKDEPOT=n build]
      
      Link: https://lkml.kernel.org/r/1611749198-24316-2-git-send-email-vjitta@codeaurora.org
      Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
      Signed-off-by: default avatarVijayanand Jitta <vjitta@codeaurora.org>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Yogesh Lal <ylal@codeaurora.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e1fdc403
    • Yogesh Lal's avatar
      lib: stackdepot: add support to configure STACK_HASH_SIZE · d2620936
      Yogesh Lal authored
      
      
      Use CONFIG_STACK_HASH_ORDER to configure STACK_HASH_SIZE.
      
      Aim is to have configurable value for  STACK_HASH_SIZE,
      so depend on use case one can configure it.
      
      One example is of Page Owner, CONFIG_PAGE_OWNER works only if
      page_owner=on via kernel parameter on CONFIG_PAGE_OWNER configured system.
      Thus, unless admin enable it via command line option, the stackdepot will
      just waste 8M memory without any customer.
      
      Making it configurable and use lower value helps to enable features like
      CONFIG_PAGE_OWNER without any significant overhead.
      
      Link: https://lkml.kernel.org/r/1611749198-24316-1-git-send-email-vjitta@codeaurora.org
      Signed-off-by: default avatarYogesh Lal <ylal@codeaurora.org>
      Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
      Signed-off-by: default avatarVijayanand Jitta <vjitta@codeaurora.org>
      Reviewed-by: default avatarMinchan Kim <minchan@kernel.org>
      Reviewed-by: default avatarAlexander Potapenko <glider@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: Lin...
      d2620936
    • Francis Laniel's avatar
      string.h: move fortified functions definitions in a dedicated header. · a28a6e86
      Francis Laniel authored
      
      
      This patch adds fortify-string.h to contain fortified functions
      definitions.  Thus, the code is more separated and compile time is
      approximately 1% faster for people who do not set CONFIG_FORTIFY_SOURCE.
      
      Link: https://lkml.kernel.org/r/20210111092141.22946-1-laniel_francis@privacyrequired.com
      Link: https://lkml.kernel.org/r/20210111092141.22946-2-laniel_francis@privacyrequired.com
      Signed-off-by: default avatarFrancis Laniel <laniel_francis@privacyrequired.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a28a6e86
    • Huang Shijie's avatar
      lib/genalloc.c: change return type to unsigned long for bitmap_set_ll · 0e24465d
      Huang Shijie authored
      
      
      Just as bitmap_clear_ll(), change return type to unsigned long
      for bitmap_set_ll to avoid the possible overflow in future.
      
      Link: https://lkml.kernel.org/r/20210105031644.2771-1-sjhuang@iluvatar.ai
      Signed-off-by: default avatarHuang Shijie <sjhuang@iluvatar.ai>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0e24465d
    • Vlastimil Babka's avatar
      MAINTAINERS: add uapi directories to API/ABI section · 7b4693e6
      Vlastimil Babka authored
      
      
      Let's add include/uapi/ and arch/*/include/uapi/ to API/ABI section, so
      that for patches modifying them, get_maintainers.pl suggests CCing
      linux-api@ so people don't forget.
      
      Link: https://lkml.kernel.org/r/20210217174745.13591-1-vbabka@suse.cz
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Reported-by: default avatarDavid Hildenbrand <david@redhat.com>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7b4693e6
    • Randy Dunlap's avatar
      kernel: delete repeated words in comments · c034f48e
      Randy Dunlap authored
      
      
      Drop repeated words in kernel/events/.
      {if, the, that, with, time}
      
      Drop repeated words in kernel/locking/.
      {it, no, the}
      
      Drop repeated words in kernel/sched/.
      {in, not}
      
      Link: https://lkml.kernel.org/r/20210127023412.26292-1-rdunlap@infradead.org
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Acked-by: Will Deacon <will@kernel.org>	[kernel/locking/]
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: "Paul E. McKenney" <paulmck@kernel.org>
      Cc: Juri Lelli <juri.lelli@redhat.com>
      Cc: Vincent Guittot <vincent.guittot@linaro.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c034f48e
    • Hubert Jasudowicz's avatar
      groups: simplify struct group_info allocation · e1e01411
      Hubert Jasudowicz authored
      
      
      Combine kmalloc and vmalloc into a single call.  Use struct_size macro
      instead of direct size calculation.
      
      Link: https://lkml.kernel.org/r/ba9ba5beea9a44b7196c41a0d9528abd5f20dd2e.1611620846.git.hubert.jasudowicz@gmail.com
      Signed-off-by: default avatarHubert Jasudowicz <hubert.jasudowicz@gmail.com>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Micah Morton <mortonm@chromium.org>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
      Cc: Thomas Cedeno <thomascedeno@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e1e01411
    • Hubert Jasudowicz's avatar
      groups: use flexible-array member in struct group_info · c1f26493
      Hubert Jasudowicz authored
      
      
      Replace zero-size array with flexible array member, as recommended by
      the docs.
      
      Link: https://lkml.kernel.org/r/155995eed35c3c1bdcc56e69d8997c8e4c46740a.1611620846.git.hubert.jasudowicz@gmail.com
      Signed-off-by: default avatarHubert Jasudowicz <hubert.jasudowicz@gmail.com>
      Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
      Cc: Micah Morton <mortonm@chromium.org>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Thomas Cedeno <thomascedeno@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c1f26493