11 Jul, 2021

1 commit

  • Pull Kbuild updates from Masahiro Yamada:

    - Increase the -falign-functions alignment for the debug option.

    - Remove ugly libelf checks from the top Makefile.

    - Make the silent build (-s) more silent.

    - Re-compile the kernel if KBUILD_BUILD_TIMESTAMP is specified.

    - Various script cleanups

    * tag 'kbuild-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (27 commits)
    scripts: add generic syscallnr.sh
    scripts: check duplicated syscall number in syscall table
    sparc: syscalls: use pattern rules to generate syscall headers
    parisc: syscalls: use pattern rules to generate syscall headers
    nds32: add arch/nds32/boot/.gitignore
    kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set
    kbuild: modpost: Explicitly warn about unprototyped symbols
    kbuild: remove trailing slashes from $(KBUILD_EXTMOD)
    kconfig.h: explain IS_MODULE(), IS_ENABLED()
    kconfig: constify long_opts
    scripts/setlocalversion: simplify the short version part
    scripts/setlocalversion: factor out 12-chars hash construction
    scripts/setlocalversion: add more comments to -dirty flag detection
    scripts/setlocalversion: remove workaround for old make-kpkg
    scripts/setlocalversion: remove mercurial, svn and git-svn supports
    kbuild: clean up ${quiet} checks in shell scripts
    kbuild: sink stdout from cmd for silent build
    init: use $(call cmd,) for generating include/generated/compile.h
    kbuild: merge scripts/mkmakefile to top Makefile
    sh: move core-y in arch/sh/Makefile to arch/sh/Kbuild
    ...

    Linus Torvalds
     

09 Jul, 2021

6 commits

  • Like syscallhdr.sh and syscalltbl.sh, add a simple script to generate
    the __NR_syscalls, which should not be exported to userspace.

    This script is useful to replace arch/mips/kernel/syscalls/syscallnr.sh,
    refactor arch/s390/kernel/syscalls/syscalltbl, and eliminate the code
    surrounded by #ifdef __KERNEL__ / #endif from exported uapi/asm/unistd_*.h
    files.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Currently, syscall{hdr,tbl}.sh sorts the entire syscall table, but you
    can assume it is already sorted by the syscall number.

    The generated syscall table does not work if the same syscall number
    appears twice. Check it in the script.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Add "auto" to the usage message so that it's a little clearer that you can
    pass "auto" as the second argument. When passing "auto" the script tries
    to find the base path automatically instead of requiring it be passed on
    the commandline. Also use [] to indicate the variable argument
    and that it is optional so that we can differentiate from the literal
    "auto" that should be passed.

    Link: https://lkml.kernel.org/r/20210511003845.2429846-11-swboyd@chromium.org
    Signed-off-by: Stephen Boyd
    Cc: Jiri Olsa
    Cc: Alexei Starovoitov
    Cc: Jessica Yu
    Cc: Evan Green
    Cc: Hsin-Yi Wang
    Cc: Konstantin Khlebnikov
    Cc: Sasha Levin
    Cc: Andy Shevchenko
    Cc: Baoquan He
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Dave Young
    Cc: Ingo Molnar
    Cc: Matthew Wilcox
    Cc: Petr Mladek
    Cc: Rasmus Villemoes
    Cc: Sergey Senozhatsky
    Cc: Steven Rostedt
    Cc: Thomas Gleixner
    Cc: Vivek Goyal
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • Sometimes if you're using tools that have linked things improperly or have
    new features/sections that older tools don't expect you'll see warnings
    printed to stderr. We don't really care about these warnings, so let's
    just silence these messages to cleanup output of this script.

    Link: https://lkml.kernel.org/r/20210511003845.2429846-10-swboyd@chromium.org
    Signed-off-by: Stephen Boyd
    Cc: Jiri Olsa
    Cc: Alexei Starovoitov
    Cc: Jessica Yu
    Cc: Evan Green
    Cc: Hsin-Yi Wang
    Cc: Konstantin Khlebnikov
    Cc: Sasha Levin
    Cc: Andy Shevchenko
    Cc: Baoquan He
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Dave Young
    Cc: Ingo Molnar
    Cc: Matthew Wilcox
    Cc: Petr Mladek
    Cc: Rasmus Villemoes
    Cc: Sergey Senozhatsky
    Cc: Steven Rostedt
    Cc: Thomas Gleixner
    Cc: Vivek Goyal
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • Now that stacktraces contain the build ID information we can update this
    script to use debuginfod-find to locate the debuginfo for the vmlinux and
    modules automatically. This can replace the existing code that requires
    specifying a path to vmlinux or tries to find the vmlinux and modules
    automatically by using the release number. Work it into the script as a
    fallback option if the vmlinux isn't specified on the commandline.

    Link: https://lkml.kernel.org/r/20210511003845.2429846-9-swboyd@chromium.org
    Signed-off-by: Stephen Boyd
    Cc: Jiri Olsa
    Cc: Alexei Starovoitov
    Cc: Jessica Yu
    Cc: Evan Green
    Cc: Hsin-Yi Wang
    Cc: Konstantin Khlebnikov
    Cc: Sasha Levin
    Cc: Petr Mladek
    Cc: Steven Rostedt
    Cc: Andy Shevchenko
    Cc: Matthew Wilcox
    Cc: Baoquan He
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Dave Young
    Cc: Ingo Molnar
    Cc: Rasmus Villemoes
    Cc: Sergey Senozhatsky
    Cc: Thomas Gleixner
    Cc: Vivek Goyal
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • Wire up memfd_secret system call on architectures that define
    ARCH_HAS_SET_DIRECT_MAP, namely arm64, risc-v and x86.

    Link: https://lkml.kernel.org/r/20210518072034.31572-7-rppt@kernel.org
    Signed-off-by: Mike Rapoport
    Acked-by: Palmer Dabbelt
    Acked-by: Arnd Bergmann
    Acked-by: Catalin Marinas
    Acked-by: David Hildenbrand
    Acked-by: James Bottomley
    Cc: Alexander Viro
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Christopher Lameter
    Cc: Dan Williams
    Cc: Dave Hansen
    Cc: David Hildenbrand
    Cc: Elena Reshetova
    Cc: Hagen Paul Pfeifer
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: James Bottomley
    Cc: "Kirill A. Shutemov"
    Cc: Mark Rutland
    Cc: Matthew Wilcox
    Cc: Michael Kerrisk
    Cc: Palmer Dabbelt
    Cc: Paul Walmsley
    Cc: Peter Zijlstra
    Cc: Rick Edgecombe
    Cc: Roman Gushchin
    Cc: Shakeel Butt
    Cc: Shuah Khan
    Cc: Thomas Gleixner
    Cc: Tycho Andersen
    Cc: Will Deacon
    Cc: kernel test robot
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

07 Jul, 2021

1 commit

  • Pull coccinelle updates from Julia Lawall:
    "There are two new semantic patches:

    - minmax: To use min and max instead of ? :

    - swap: To use swap when possible

    Some other semantic patches have been updated to better conform to
    Linux kernel developer expectations or to make the explanation message
    more clear.

    Finally, there is a fix for the coccicheck script"

    * 'for-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux:
    coccinelle: api: remove kobj_to_dev.cocci script
    scripts: coccicheck: fix troubles on non-English builds
    coccinelle: misc: minmax: suppress patch generation for err returns
    drop unneeded *s
    coccinelle: irqf_oneshot: reduce the severity due to false positives
    coccinelle: misc: add swap script
    coccinelle: misc: update uninitialized_var.cocci documentation
    coccinelle: misc: restrict patch mode in flexible_array.cocci
    coccinelle: misc: add minmax script

    Linus Torvalds
     

05 Jul, 2021

1 commit

  • Pull s390 updates from Vasily Gorbik:

    - Rework inline asm to get rid of error prone "register asm"
    constructs, which are problematic especially when code
    instrumentation is enabled.

    In particular introduce and use register pair union to allocate
    even/odd register pairs. Unfortunately this breaks compatibility with
    older clang compilers and minimum clang version for s390 has been
    raised to 13.

    https://lore.kernel.org/linux-next/CAK7LNARuSmPCEy-ak0erPrPTgZdGVypBROFhtw+=3spoGoYsyw@mail.gmail.com/

    - Fix gcc 11 warnings, which triggered various minor reworks all over
    the code.

    - Add zstd kernel image compression support.

    - Rework boot CPU lowcore handling.

    - De-duplicate and move kernel memory layout setup logic earlier.

    - Few fixes in preparation for FORTIFY_SOURCE performing compile-time
    and run-time field bounds checking for mem functions.

    - Remove broken and unused power management support leftovers in s390
    drivers.

    - Disable stack-protector for decompressor and purgatory to fix
    buildroot build.

    - Fix vt220 sclp console name to match the char device name.

    - Enable HAVE_IOREMAP_PROT and add zpci_set_irq()/zpci_clear_irq() in
    zPCI code.

    - Remove some implausible WARN_ON_ONCEs and remove arch specific
    counter transaction call backs in favour of default transaction
    handling in perf code.

    - Extend/add new uevents for online/config/mode state changes of AP
    card / queue device in zcrypt.

    - Minor entry and ccwgroup code improvements.

    - Other small various fixes and improvements all over the code.

    * tag 's390-5.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (91 commits)
    s390/dasd: use register pair instead of register asm
    s390/qdio: get rid of register asm
    s390/ioasm: use symbolic names for asm operands
    s390/ioasm: get rid of register asm
    s390/cmf: get rid of register asm
    s390/lib,string: get rid of register asm
    s390/lib,uaccess: get rid of register asm
    s390/string: get rid of register asm
    s390/cmpxchg: use register pair instead of register asm
    s390/mm,pages-states: get rid of register asm
    s390/lib,xor: get rid of register asm
    s390/timex: get rid of register asm
    s390/hypfs: use register pair instead of register asm
    s390/zcrypt: Switch to flexible array member
    s390/speculation: Use statically initialized const for instructions
    virtio/s390: get rid of open-coded kvm hypercall
    s390/pci: add zpci_set_irq()/zpci_clear_irq()
    scripts/min-tool-version.sh: Raise minimum clang version to 13.0.0 for s390
    s390/ipl: use register pair instead of register asm
    s390/mem_detect: fix tprot() program check new psw handling
    ...

    Linus Torvalds
     

03 Jul, 2021

1 commit

  • Merge more updates from Andrew Morton:
    "190 patches.

    Subsystems affected by this patch series: mm (hugetlb, userfaultfd,
    vmscan, kconfig, proc, z3fold, zbud, ras, mempolicy, memblock,
    migration, thp, nommu, kconfig, madvise, memory-hotplug, zswap,
    zsmalloc, zram, cleanups, kfence, and hmm), procfs, sysctl, misc,
    core-kernel, lib, lz4, checkpatch, init, kprobes, nilfs2, hfs,
    signals, exec, kcov, selftests, compress/decompress, and ipc"

    * emailed patches from Andrew Morton : (190 commits)
    ipc/util.c: use binary search for max_idx
    ipc/sem.c: use READ_ONCE()/WRITE_ONCE() for use_global_lock
    ipc: use kmalloc for msg_queue and shmid_kernel
    ipc sem: use kvmalloc for sem_undo allocation
    lib/decompressors: remove set but not used variabled 'level'
    selftests/vm/pkeys: exercise x86 XSAVE init state
    selftests/vm/pkeys: refill shadow register after implicit kernel write
    selftests/vm/pkeys: handle negative sys_pkey_alloc() return code
    selftests/vm/pkeys: fix alloc_random_pkey() to make it really, really random
    kcov: add __no_sanitize_coverage to fix noinstr for all architectures
    exec: remove checks in __register_bimfmt()
    x86: signal: don't do sas_ss_reset() until we are certain that sigframe won't be abandoned
    hfsplus: report create_date to kstat.btime
    hfsplus: remove unnecessary oom message
    nilfs2: remove redundant continue statement in a while-loop
    kprobes: remove duplicated strong free_insn_page in x86 and s390
    init: print out unknown kernel parameters
    checkpatch: do not complain about positive return values starting with EPOLL
    checkpatch: improve the indented label test
    checkpatch: scripts/spdxcheck.py now requires python3
    ...

    Linus Torvalds
     

02 Jul, 2021

3 commits

  • checkpatch complains about positive return values of poll functions.
    Example:

    WARNING: return of an errno should typically be negative (ie: return -EPOLLIN)
    + return EPOLLIN;

    Poll functions return positive values. The defines for the return values
    of poll functions all start with EPOLL, resulting in a number of false
    positives. An often used workaround is to assign poll function return
    values to variables and returning that variable, but that is a less than
    perfect solution.

    There is no error definition which starts with EPOLL, so it is safe to
    omit the warning for return values starting with EPOLL.

    Link: https://lkml.kernel.org/r/20210622004334.638680-1-linux@roeck-us.net
    Signed-off-by: Guenter Roeck
    Acked-by: Joe Perches
    Cc: Ricardo Ribalda
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Guenter Roeck
     
  • checkpatch identifies a label only when a terminating colon
    immediately follows an identifier.

    Bitfield definitions can appear to be labels so ignore any
    spaces between the identifier terminating colon and any digit
    that may be used to define a bitfield length.

    Miscellanea:

    o Improve the initial checkpatch comment
    o Use the more typical '&&' instead of 'and'
    o Require the initial label character to be a non-digit
    (Can't use $Ident here because $Ident allows ## concatenation)
    o Use $sline instead of $line to ignore comments
    o Use '$sline !~ /.../' instead of '!($line =~ /.../)'

    Link: https://lkml.kernel.org/r/b54d673e7cde7de5de0c9ba4dd57dd0858580ca4.camel@perches.com
    Signed-off-by: Joe Perches
    Cc: Greg Kroah-Hartman
    Cc: Manikishan Ghantasala
    Cc: Alex Elder
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Since commit d0259c42abff ("spdxcheck.py: Use Python 3"), spdxcheck.py
    explicitly expects to run as python3 script. If "python" still points to
    python v2.7 and the script is executed with "python scripts/spdxcheck.py",
    the following error may be seen even if git-python is installed for
    python3.

    Traceback (most recent call last):
    File "scripts/spdxcheck.py", line 10, in
    import git
    ImportError: No module named git

    To fix the problem, check for the existence of python3, check if
    the script is executable and not just for its existence, and execute
    it directly.

    Link: https://lkml.kernel.org/r/20210505211720.447111-1-linux@roeck-us.net
    Signed-off-by: Guenter Roeck
    Cc: Joe Perches
    Cc: Bert Vermeulen
    Cc: Dwaipayan Ray
    Cc: Lukas Bulwahn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Guenter Roeck
     

30 Jun, 2021

5 commits

  • Merge misc updates from Andrew Morton:
    "191 patches.

    Subsystems affected by this patch series: kthread, ia64, scripts,
    ntfs, squashfs, ocfs2, kernel/watchdog, and mm (gup, pagealloc, slab,
    slub, kmemleak, dax, debug, pagecache, gup, swap, memcg, pagemap,
    mprotect, bootmem, dma, tracing, vmalloc, kasan, initialization,
    pagealloc, and memory-failure)"

    * emailed patches from Andrew Morton : (191 commits)
    mm,hwpoison: make get_hwpoison_page() call get_any_page()
    mm,hwpoison: send SIGBUS with error virutal address
    mm/page_alloc: split pcp->high across all online CPUs for cpuless nodes
    mm/page_alloc: allow high-order pages to be stored on the per-cpu lists
    mm: replace CONFIG_FLAT_NODE_MEM_MAP with CONFIG_FLATMEM
    mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA
    docs: remove description of DISCONTIGMEM
    arch, mm: remove stale mentions of DISCONIGMEM
    mm: remove CONFIG_DISCONTIGMEM
    m68k: remove support for DISCONTIGMEM
    arc: remove support for DISCONTIGMEM
    arc: update comment about HIGHMEM implementation
    alpha: remove DISCONTIGMEM and NUMA
    mm/page_alloc: move free_the_page
    mm/page_alloc: fix counting of managed_pages
    mm/page_alloc: improve memmap_pages dbg msg
    mm: drop SECTION_SHIFT in code comments
    mm/page_alloc: introduce vm.percpu_pagelist_high_fraction
    mm/page_alloc: limit the number of pages on PCP lists when reclaim is active
    mm/page_alloc: scale the number of pages that are batch freed
    ...

    Linus Torvalds
     
  • Commit "mm/page_alloc: convert per-cpu list protection to local_lock" will
    introduce a zero-sized per-CPU variable, which causes pahole to generate
    invalid BTF. Only pahole versions 1.18 through 1.21 are impacted, as
    before 1.18 pahole doesn't know anything about per-CPU variables, and 1.22
    contains the proper fix for the issue.

    Luckily, pahole 1.18 got --skip_encoding_btf_vars option disabling BTF
    generation for per-CPU variables in anticipation of some unanticipated
    problems. So use this escape hatch to disable per-CPU var BTF info on
    those problematic pahole versions. Users relying on availability of
    per-CPU var BTFs would need to upgrade to pahole 1.22+, but everyone won't
    notice any regressions.

    Link: https://lkml.kernel.org/r/20210530002536.3193829-1-andrii@kernel.org
    Signed-off-by: Andrii Nakryiko
    Acked-by: Mel Gorman
    Cc: Arnaldo Carvalho de Melo
    Cc: Hao Luo
    Cc: Michal Suchanek
    Cc: Jiri Olsa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrii Nakryiko
     
  • Here are some of the more common spelling mistakes and typos that I've
    found while fixing up spelling mistakes in the kernel in the past few
    months.

    Link: https://lkml.kernel.org/r/20210514093655.8829-1-colin.king@canonical.com
    Signed-off-by: Colin Ian King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Colin Ian King
     
  • The tab stop for Perl files is by default (at least in emacs) to be 4
    spaces, where a tab is used for all 8 spaces. Add a local variable
    comment to make vim do the same by default, and this will help keep the
    file consistent in the future when others edit it via vim and not emacs.

    Link: https://lkml.kernel.org/r/20210322214032.293992979@goodmis.org
    Signed-off-by: Steven Rostedt (VMware)
    Cc: Masahiro Yamada
    Cc: "John (Warthog9) Hawley"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Steven Rostedt (VMware)
     
  • Patch series "streamline_config.pl: Fix Perl spacing".

    Talking with John Hawley about how vim and emacs deal with Perl files with
    respect to tabs and spaces, I found that some of my Perl code in the
    kernel had inconsistent spacing. The way emacs handles Perl by default is
    to use 4 spaces per indent, but make all 8 spaces into a single tab. Vim
    does not do this by default. But if you add the vim variable control:

    # vim: softtabstop=4

    to a perl file, it makes vim behave the same way as emacs.

    The first patch is to change all 8 spaces into a single tab (mostly from
    people editing the file with vim). The next patch adds the softtabstop
    variable to make vim act like emacs by default.

    This patch (of 2):

    As Perl code tends to have 4 space indentation, but uses tabs for every 8
    spaces, make that consistent in the streamline_config.pl code. Replace
    all 8 spaces with a single tab.

    Link: https://lkml.kernel.org/r/20210322214032.133596267@goodmis.org
    Signed-off-by: Steven Rostedt (VMware)
    Cc: "John (Warthog9) Hawley"
    Cc: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Steven Rostedt (VMware)
     

29 Jun, 2021

4 commits

  • Pull documentation updates from Jonathan Corbet:
    "This was a reasonably active cycle for documentation; this includes:

    - Some kernel-doc cleanups. That script is still regex onslaught from
    hell, but it has gotten a little better.

    - Improvements to the checkpatch docs, which are also used by the
    tool itself.

    - A major update to the pathname lookup documentation.

    - Elimination of :doc: markup, since our automarkup magic can create
    references from filenames without all the extra noise.

    - The flurry of Chinese translation activity continues.

    Plus, of course, the usual collection of updates, typo fixes, and
    warning fixes"

    * tag 'docs-5.14' of git://git.lwn.net/linux: (115 commits)
    docs: path-lookup: use bare function() rather than literals
    docs: path-lookup: update symlink description
    docs: path-lookup: update get_link() ->follow_link description
    docs: path-lookup: update WALK_GET, WALK_PUT desc
    docs: path-lookup: no get_link()
    docs: path-lookup: update i_op->put_link and cookie description
    docs: path-lookup: i_op->follow_link replaced with i_op->get_link
    docs: path-lookup: Add macro name to symlink limit description
    docs: path-lookup: remove filename_mountpoint
    docs: path-lookup: update do_last() part
    docs: path-lookup: update path_mountpoint() part
    docs: path-lookup: update path_to_nameidata() part
    docs: path-lookup: update follow_managed() part
    docs: Makefile: Use CONFIG_SHELL not SHELL
    docs: Take a little noise out of the build process
    docs: x86: avoid using ReST :doc:`foo` markup
    docs: virt: kvm: s390-pv-boot.rst: avoid using ReST :doc:`foo` markup
    docs: userspace-api: landlock.rst: avoid using ReST :doc:`foo` markup
    docs: trace: ftrace.rst: avoid using ReST :doc:`foo` markup
    docs: trace: coresight: coresight.rst: avoid using ReST :doc:`foo` markup
    ...

    Linus Torvalds
     
  • Pull arm64 updates from Will Deacon:
    "There's a reasonable amount here and the juicy details are all below.

    It's worth noting that the MTE/KASAN changes strayed outside of our
    usual directories due to core mm changes and some associated changes
    to some other architectures; Andrew asked for us to carry these [1]
    rather that take them via the -mm tree.

    Summary:

    - Optimise SVE switching for CPUs with 128-bit implementations.

    - Fix output format from SVE selftest.

    - Add support for versions v1.2 and 1.3 of the SMC calling
    convention.

    - Allow Pointer Authentication to be configured independently for
    kernel and userspace.

    - PMU driver cleanups for managing IRQ affinity and exposing event
    attributes via sysfs.

    - KASAN optimisations for both hardware tagging (MTE) and out-of-line
    software tagging implementations.

    - Relax frame record alignment requirements to facilitate 8-byte
    alignment with KASAN and Clang.

    - Cleanup of page-table definitions and removal of unused memory
    types.

    - Reduction of ARCH_DMA_MINALIGN back to 64 bytes.

    - Refactoring of our instruction decoding routines and addition of
    some missing encodings.

    - Move entry code moved into C and hardened against harmful compiler
    instrumentation.

    - Update booting requirements for the FEAT_HCX feature, added to v8.7
    of the architecture.

    - Fix resume from idle when pNMI is being used.

    - Additional CPU sanity checks for MTE and preparatory changes for
    systems where not all of the CPUs support 32-bit EL0.

    - Update our kernel string routines to the latest Cortex Strings
    implementation.

    - Big cleanup of our cache maintenance routines, which were
    confusingly named and inconsistent in their implementations.

    - Tweak linker flags so that GDB can understand vmlinux when using
    RELR relocations.

    - Boot path cleanups to enable early initialisation of per-cpu
    operations needed by KCSAN.

    - Non-critical fixes and miscellaneous cleanup"

    * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (150 commits)
    arm64: tlb: fix the TTL value of tlb_get_level
    arm64: Restrict undef hook for cpufeature registers
    arm64/mm: Rename ARM64_SWAPPER_USES_SECTION_MAPS
    arm64: insn: avoid circular include dependency
    arm64: smp: Bump debugging information print down to KERN_DEBUG
    drivers/perf: fix the missed ida_simple_remove() in ddr_perf_probe()
    perf/arm-cmn: Fix invalid pointer when access dtc object sharing the same IRQ number
    arm64: suspend: Use cpuidle context helpers in cpu_suspend()
    PSCI: Use cpuidle context helpers in psci_cpu_suspend_enter()
    arm64: Convert cpu_do_idle() to using cpuidle context helpers
    arm64: Add cpuidle context save/restore helpers
    arm64: head: fix code comments in set_cpu_boot_mode_flag
    arm64: mm: drop unused __pa(__idmap_text_start)
    arm64: mm: fix the count comments in compute_indices
    arm64/mm: Fix ttbr0 values stored in struct thread_info for software-pan
    arm64: mm: Pass original fault address to handle_mm_fault()
    arm64/mm: Drop SECTION_[SHIFT|SIZE|MASK]
    arm64/mm: Use CONT_PMD_SHIFT for ARM64_MEMSTART_SHIFT
    arm64/mm: Drop SWAPPER_INIT_MAP_SIZE
    arm64: Conditionally configure PTR_AUTH key of the kernel.
    ...

    Linus Torvalds
     
  • Pull locking updates from Ingo Molnar:

    - Core locking & atomics:

    - Convert all architectures to ARCH_ATOMIC: move every architecture
    to ARCH_ATOMIC, then get rid of ARCH_ATOMIC and all the
    transitory facilities and #ifdefs.

    Much reduction in complexity from that series:

    63 files changed, 756 insertions(+), 4094 deletions(-)

    - Self-test enhancements

    - Futexes:

    - Add the new FUTEX_LOCK_PI2 ABI, which is a variant that doesn't
    set FLAGS_CLOCKRT (.e. uses CLOCK_MONOTONIC).

    [ The temptation to repurpose FUTEX_LOCK_PI's implicit setting of
    FLAGS_CLOCKRT & invert the flag's meaning to avoid having to
    introduce a new variant was resisted successfully. ]

    - Enhance futex self-tests

    - Lockdep:

    - Fix dependency path printouts

    - Optimize trace saving

    - Broaden & fix wait-context checks

    - Misc cleanups and fixes.

    * tag 'locking-core-2021-06-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (52 commits)
    locking/lockdep: Correct the description error for check_redundant()
    futex: Provide FUTEX_LOCK_PI2 to support clock selection
    futex: Prepare futex_lock_pi() for runtime clock selection
    lockdep/selftest: Remove wait-type RCU_CALLBACK tests
    lockdep/selftests: Fix selftests vs PROVE_RAW_LOCK_NESTING
    lockdep: Fix wait-type for empty stack
    locking/selftests: Add a selftest for check_irq_usage()
    lockding/lockdep: Avoid to find wrong lock dep path in check_irq_usage()
    locking/lockdep: Remove the unnecessary trace saving
    locking/lockdep: Fix the dep path printing for backwards BFS
    selftests: futex: Add futex compare requeue test
    selftests: futex: Add futex wait test
    seqlock: Remove trailing semicolon in macros
    locking/lockdep: Reduce LOCKDEP dependency list
    locking/lockdep,doc: Improve readability of the block matrix
    locking/atomics: atomic-instrumented: simplify ifdeffery
    locking/atomic: delete !ARCH_ATOMIC remnants
    locking/atomic: xtensa: move to ARCH_ATOMIC
    locking/atomic: sparc: move to ARCH_ATOMIC
    locking/atomic: sh: move to ARCH_ATOMIC
    ...

    Linus Torvalds
     
  • Linus Torvalds
     

28 Jun, 2021

1 commit

  • clang versions prior to the current development version of 13.0.0 cannot
    compile s390 after commit 3abbdfde5a65 ("s390/bitops: use register pair
    instead of register asm") and the s390 maintainers do not intend to work
    around this in the kernel. Codify this in scripts/min-tool-version.sh
    similar to arm64 with GCC 5.1.0 so that there are no reports of broken
    builds.

    [hca@linux.ibm.com: breaking compatibility with older clang compilers
    is intended to finally make use of a feature which allows the
    compiler to allocate even/odd register pairs. This is possible since
    a very long time with gcc, but only since llvm-project commit
    d058262b1471 ("[SystemZ] Support i128 inline asm operands.") with
    clang. Using that feature allows to get rid of error prone register
    asm statements, of which the above named kernel commit is only the
    first of a larger not yet complete series.]

    Reported-by: Naresh Kamboju
    Signed-off-by: Nathan Chancellor
    Acked-by: Nick Desaulniers
    Acked-by: Masahiro Yamada
    Link: https://lore.kernel.org/r/20210617193139.856957-1-nathan@kernel.org
    Signed-off-by: Heiko Carstens
    Signed-off-by: Vasily Gorbik

    Nathan Chancellor
     

24 Jun, 2021

1 commit


22 Jun, 2021

1 commit

  • Using kobj_to_dev() instead of container_of() is not universally
    accepted among maintainers as an improvement. The warning leads to
    repeated patch submissions that won't be accepted. Remove the script.

    Cc: Christoph Hellwig
    Cc: Jens Axboe
    Cc: Denis Efremov
    Cc: Julia Lawall
    Signed-off-by: Keith Busch
    Signed-off-by: Julia Lawall
    Acked-by: Jens Axboe
    Acked-by: Denis Efremov

    Keith Busch
     

18 Jun, 2021

1 commit

  • One should only use st_shndx when >SHN_UNDEF and = SHN_LORESERVE && st_shndx != SHN_XINDEX.

    Link: https://lore.kernel.org/lkml/20210607023839.26387-1-mark-pk.tsai@mediatek.com/
    Link: https://lkml.kernel.org/r/20210616154126.2794-1-mark-pk.tsai@mediatek.com

    Reported-by: Mark-PK Tsai
    Tested-by: Mark-PK Tsai
    Signed-off-by: Peter Zijlstra (Intel)
    [handle endianness of sym->st_shndx]
    Signed-off-by: Mark-PK Tsai
    Signed-off-by: Steven Rostedt (VMware)

    Peter Zijlstra
     

17 Jun, 2021

2 commits

  • To avoid unnecessary recompilations, mkcompile_h does not regenerate
    compile.h if just the timestamp changed.
    Though, if KBUILD_BUILD_TIMESTAMP is set, an explicit timestamp for the
    build was requested, in which case we should not ignore it.

    If a user follows the documentation for reproducible builds [1] and
    defines KBUILD_BUILD_TIMESTAMP as the git commit timestamp, a clean
    build will have the correct timestamp. A subsequent cherry-pick (or
    amend) changes the commit timestamp and if an incremental build is done
    with a different KBUILD_BUILD_TIMESTAMP now, that new value is not taken
    into consideration. But it should for reproducibility.

    Hence, whenever KBUILD_BUILD_TIMESTAMP is explicitly set, do not ignore
    UTS_VERSION when making a decision about whether the regenerated version
    of compile.h should be moved into place.

    [1] https://www.kernel.org/doc/html/latest/kbuild/reproducible-builds.html

    Signed-off-by: Matthias Maennich
    Signed-off-by: Masahiro Yamada

    Matthias Maennich
     
  • One common cause of modpost version generation failures is a failure to
    prototype exported assembly functions - the tooling requires this for
    exported functions even if they are not and should not be called from C
    code in order to do the version mangling for symbols. Unfortunately the
    error message is currently rather abstruse, simply saying that "version
    generation failed" and even diving into the code doesn't directly show
    what's going on since there's several steps between the problem and it
    being observed.

    Provide an explicit hint as to the likely cause of a version generation
    failure to help anyone who runs into this in future more readily diagnose
    and fix the problem.

    Signed-off-by: Mark Brown
    Signed-off-by: Masahiro Yamada

    Mark Brown
     

08 Jun, 2021

1 commit

  • GDB produces the following warning when debugging kernels built with
    CONFIG_RELR:

    BFD: /android0/linux-next/vmlinux: unknown type [0x13] section `.relr.dyn'

    when loading a kernel built with CONFIG_RELR into GDB. It can also
    prevent debugging symbols using such relocations.

    Peter sugguests:
    [That flag] means that lld will use dynamic tags and section type
    numbers in the OS-specific range rather than the generic range. The
    kernel itself doesn't care about these numbers; it determines the
    location of the RELR section using symbols defined by a linker script.

    Link: https://github.com/ClangBuiltLinux/linux/issues/1057
    Suggested-by: Peter Collingbourne
    Reviewed-by: Nathan Chancellor
    Signed-off-by: Nick Desaulniers
    Link: https://lore.kernel.org/r/20210522012626.2811297-1-ndesaulniers@google.com
    Signed-off-by: Will Deacon

    Nick Desaulniers
     

05 Jun, 2021

2 commits


02 Jun, 2021

2 commits

  • The pip packages are only needed when the distro-provided
    Sphinx version is not good enough.

    Don't recommend installing it if not needed.

    Signed-off-by: Mauro Carvalho Chehab
    Link: https://lore.kernel.org/r/04ce53b77b37f1e495c3abc39c2d3dc407895dc0.1621949137.git.mchehab+huawei@kernel.org
    Signed-off-by: Jonathan Corbet

    Mauro Carvalho Chehab
     
  • The sphinx-pre-install supports installing sphinx via a virtual
    environment using pip/pypi or directly from the distribution's
    package, when --no-virtualenv is used.

    However, even when --no-virtualenv, the current logic is
    still recomending to install a virtual env, due to a regression.

    It turns that the logic there is complex, as it depends on
    several different conditions.

    Split the code which recommends Sphinx on two separate
    functions, in order to clean up the code.

    Signed-off-by: Mauro Carvalho Chehab
    Link: https://lore.kernel.org/r/9dedaec201803017b7a7dc24a074f3a4f040b72a.1621949137.git.mchehab+huawei@kernel.org
    Signed-off-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

28 May, 2021

1 commit

  • The ccache tool can be used to speed up cross-compilation, by calling the
    compiler and binutils through ccache. For example, following should work:

    $ export ARCH=arm64 CROSS_COMPILE="ccache aarch64-linux-gnu-"

    $ make M=drivers/gpu/drm/rockchip/

    but pahole fails to extract the BTF info from DWARF, breaking the build:

    CC [M] drivers/gpu/drm/rockchip//rockchipdrm.mod.o
    LD [M] drivers/gpu/drm/rockchip//rockchipdrm.ko
    BTF [M] drivers/gpu/drm/rockchip//rockchipdrm.ko
    aarch64-linux-gnu-objcopy: invalid option -- 'J'
    Usage: aarch64-linux-gnu-objcopy [option(s)] in-file [out-file]
    Copies a binary file, possibly transforming it in the process
    ...
    make[1]: *** [scripts/Makefile.modpost:156: __modpost] Error 2
    make: *** [Makefile:1866: modules] Error 2

    this fails because OBJCOPY is set to "ccache aarch64-linux-gnu-copy" and
    later pahole is executed with the following command line:

    LLVM_OBJCOPY=$(OBJCOPY) $(PAHOLE) -J --btf_base vmlinux $@

    which gets expanded to:

    LLVM_OBJCOPY=ccache aarch64-linux-gnu-objcopy pahole -J ...

    instead of:

    LLVM_OBJCOPY="ccache aarch64-linux-gnu-objcopy" pahole -J ...

    Fixes: 5f9ae91f7c0d ("kbuild: Build kernel module BTFs if BTF is enabled and pahole supports it")
    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Andrii Nakryiko
    Acked-by: Andrii Nakryiko
    Acked-by: Arnaldo Carvalho de Melo
    Link: https://lore.kernel.org/bpf/20210526215228.3729875-1-javierm@redhat.com

    Javier Martinez Canillas
     

27 May, 2021

6 commits

  • By using outlined checks we can achieve a significant code size
    improvement by moving the tag-based ASAN checks into separate
    functions. Unlike the existing CONFIG_KASAN_OUTLINE mode these
    functions have a custom calling convention that preserves most
    registers and is specialized to the register containing the address
    and the type of access, and as a result we can eliminate the code
    size and performance overhead of a standard calling convention such
    as AAPCS for these functions.

    This change depends on a separate series of changes to Clang [1] to
    support outlined checks in the kernel, although the change works fine
    without them (we just don't get outlined checks). This is because the
    flag -mllvm -hwasan-inline-all-checks=0 has no effect until the Clang
    changes land. The flag was introduced in the Clang 9.0 timeframe as
    part of the support for outlined checks in userspace and because our
    minimum Clang version is 10.0 we can pass it unconditionally.

    Outlined checks require a new runtime function with a custom calling
    convention. Add this function to arch/arm64/lib.

    I measured the code size of defconfig + tag-based KASAN, as well
    as boot time (i.e. time to init launch) on a DragonBoard 845c with
    an Android arm64 GKI kernel. The results are below:

    code size boot time
    CONFIG_KASAN_INLINE=y before 92824064 6.18s
    CONFIG_KASAN_INLINE=y after 38822400 6.65s
    CONFIG_KASAN_OUTLINE=y 39215616 11.48s

    We can see straight away that specialized outlined checks beat the
    existing CONFIG_KASAN_OUTLINE=y on both code size and boot time
    for tag-based ASAN.

    As for the comparison between CONFIG_KASAN_INLINE=y before and after
    we saw similar performance numbers in userspace [2] and decided
    that since the performance overhead is minimal compared to the
    overhead of tag-based ASAN itself as well as compared to the code
    size improvements we would just replace the inlined checks with the
    specialized outlined checks without the option to select between them,
    and that is what I have implemented in this patch.

    Signed-off-by: Peter Collingbourne
    Acked-by: Andrey Konovalov
    Reviewed-by: Mark Rutland
    Tested-by: Mark Rutland
    Link: https://linux-review.googlesource.com/id/I1a30036c70ab3c3ee78d75ed9b87ef7cdc3fdb76
    Link: [1] https://reviews.llvm.org/D90426
    Link: [2] https://reviews.llvm.org/D56954
    Link: https://lore.kernel.org/r/20210526174927.2477847-3-pcc@google.com
    Signed-off-by: Will Deacon

    Peter Collingbourne
     
  • Reduce the indentation.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Greg Kroah-Hartman
    Reviewed-by: Nico Schottelius

    Masahiro Yamada
     
  • Both of if and else parts append exactly 12 hex chars, but in
    different ways.

    Factor out the else part because we need to support it without relying
    on git-describe. Remove the --abbrev=12 option since we do not use the
    hash from git-describe anyway.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Greg Kroah-Hartman
    Reviewed-by: Nico Schottelius

    Masahiro Yamada
     
  • This script stumbled on the read-only source tree over again:

    - a2bb90a08cb3 ("kbuild: fix delay in setlocalversion on readonly
    source")

    - cdf2bc632ebc ("scripts/setlocalversion on write-protected source
    tree")

    - 8ef14c2c41d9 ("Revert "scripts/setlocalversion: git: Make -dirty
    check more robust"")

    - ff64dd485730 ("scripts/setlocalversion: Improve -dirty check with
    git-status --no-optional-locks")

    Add comments to clarify that this script should never ever try to write
    to the source tree.

    'git describe --dirty' might look as a simple solution for appending
    the -dirty string, but we cannot use it because it creates the
    .git/index.lock file.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Greg Kroah-Hartman
    Reviewed-by: Nico Schottelius

    Masahiro Yamada
     
  • This reverts commit b052ce4c840e ("kbuild: fix false positive -dirty
    tag caused by make-kpkg").

    If I understand correctly, this problem occurred in very old versions
    of make-kpkg. When I tried a newer version, make-kpkg did not touch
    scripts/package/Makefile.

    Anyway, Debian uses 'make deb-pkg' instead of make-kpkg these days.

    Debian handbook [1] mentions it as "the good old days":

    "CULTURE The good old days of kernel-package

    Before the Linux build system gained the ability to build proper
    Debian packages, the recommended way to build such packages was to
    use make-kpkg from the kernel-package package."

    [1]: https://debian-handbook.info/browse/stable/sect.kernel-compilation.html

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Greg Kroah-Hartman
    Reviewed-by: Nico Schottelius

    Masahiro Yamada
     
  • The mercurial, svn, git-svn supports were added by the following commits:

    - 3dce174cfcba ("kbuild: support mercurial in setlocalversion")

    - ba3d05fb6369 ("kbuild: add svn revision information to setlocalversion")

    - ff80aa97c9b4 ("setlocalversion: add git-svn support")

    They did not explain why they are useful for the kernel source tree.
    Let's revert all of them, and see if somebody will complain about it.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Greg Kroah-Hartman
    Reviewed-by: Nico Schottelius

    Masahiro Yamada