25 Apr, 2021

17 commits

  • scripts/Makefile.modsign is a subset of scripts/Makefile.modinst,
    and duplicates the code. Let's merge them.

    By the way, you do not need to run 'make modules_sign' explicitly
    because modules are signed as a part of 'make modules_install' when
    CONFIG_MODULE_SIG_ALL=y. If CONFIG_MODULE_SIG_ALL=n, mod_sign_cmd is
    set to 'true', so 'make modules_sign' is not functional.

    In my understanding, the reason of still keeping this is to handle
    corner cases like commit 64178cb62c32 ("builddeb: fix stripped module
    signatures if CONFIG_DEBUG_INFO and CONFIG_MODULE_SIG_ALL are set").

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Both mod_strip_cmd and mod_compress_cmd are only used in
    scripts/Makefile.modinst, hence there is no good reason to define them
    in the top Makefile. Move the relevant code to scripts/Makefile.modinst.

    Also, show separate log messages for each of install, strip, sign, and
    compress.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • scripts/Makefile.modinst is ugly and weird in multiple ways; it
    specifies real files $(modules) as phony, makes directory manipulation
    needlessly too complicated.

    Clean up the Makefile code, and show the full path of installed modules
    in the log.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • This seems to be useful in sub-make as well. As a preparation of
    exporting it, rename extmod-prefix to extmod_prefix because exported
    variables cannot contain hyphens.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Nick Desaulniers

    Masahiro Yamada
     
  • If there are multiple modules with the same name in the same external
    module tree, there is ambiguity about which one will be loaded, and
    very likely something odd is happening.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • It is clearer to show the directory which depmod will work on.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • If you attempt to build or install modules ('make modules(_install)'
    with CONFIG_MODULES disabled, you will get a clear error message, but
    nothing for external module builds.

    Factor out the modules and modules_install rules into the common part,
    so you will get the same error message when you try to build external
    modules with CONFIG_MODULES=n.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • scripts/Makefile.modinst creates directories as needed.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • The external module build shows the following warning if Module.symvers
    is missing in the kernel tree.

    WARNING: Symbol version dump "Module.symvers" is missing.
    Modules may not have dependencies or modversions.

    I think this is an important heads-up because the resulting modules may
    not work as expected. This happens when you did not build the entire
    kernel tree, for example, you might have prepared the minimal setups
    for external modules by 'make defconfig && make modules_preapre'.

    A problem is that 'make modules' creates Module.symvers even without
    vmlinux. In this case, that warning is suppressed since Module.symvers
    already exists in spite of its incomplete content.

    The incomplete (i.e. invalid) Module.symvers should not be created.

    This commit changes the second pass of modpost to dump symbols into
    modules-only.symvers. The final Module.symvers is created by
    concatenating vmlinux.symvers and modules-only.symvers if both exist.

    Module.symvers is supposed to collect symbols from both vmlinux and
    modules. It might be a bit confusing, and I am not quite sure if it
    is an official interface, but presumably it is difficult to rename it
    because some tools (e.g. kmod) parse it.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Documentation/process/changes.rst defines the minimum assembler version
    (binutils version), but we have never checked it in the build time.

    Kbuild never invokes 'as' directly because all assembly files in the
    kernel tree are *.S, hence must be preprocessed. I do not expect
    raw assembly source files (*.s) would be added to the kernel tree.

    Therefore, we always use $(CC) as the assembler driver, and commit
    aa824e0c962b ("kbuild: remove AS variable") removed 'AS'. However,
    we are still interested in the version of the assembler acting behind.

    As usual, the --version option prints the version string.

    $ as --version | head -n 1
    GNU assembler (GNU Binutils for Ubuntu) 2.35.1

    But, we do not have $(AS). So, we can add the -Wa prefix so that
    $(CC) passes --version down to the backing assembler.

    $ gcc -Wa,--version | head -n 1
    gcc: fatal error: no input files
    compilation terminated.

    OK, we need to input something to satisfy gcc.

    $ gcc -Wa,--version -c -x assembler /dev/null -o /dev/null | head -n 1
    GNU assembler (GNU Binutils for Ubuntu) 2.35.1

    The combination of Clang and GNU assembler works in the same way:

    $ clang -no-integrated-as -Wa,--version -c -x assembler /dev/null -o /dev/null | head -n 1
    GNU assembler (GNU Binutils for Ubuntu) 2.35.1

    Clang with the integrated assembler fails like this:

    $ clang -integrated-as -Wa,--version -c -x assembler /dev/null -o /dev/null | head -n 1
    clang: error: unsupported argument '--version' to option 'Wa,'

    For the last case, checking the error message is fragile. If the
    proposal for -Wa,--version support [1] is accepted, this may not be
    even an error in the future.

    One easy way is to check if -integrated-as is present in the passed
    arguments. We did not pass -integrated-as to CLANG_FLAGS before, but
    we can make it explicit.

    Nathan pointed out -integrated-as is the default for all of the
    architectures/targets that the kernel cares about, but it goes
    along with "explicit is better than implicit" policy. [2]

    With all this in my mind, I implemented scripts/as-version.sh to
    check the assembler version in Kconfig time.

    $ scripts/as-version.sh gcc
    GNU 23501
    $ scripts/as-version.sh clang -no-integrated-as
    GNU 23501
    $ scripts/as-version.sh clang -integrated-as
    LLVM 0

    [1]: https://github.com/ClangBuiltLinux/linux/issues/1320
    [2]: https://lore.kernel.org/linux-kbuild/20210307044253.v3h47ucq6ng25iay@archlinux-ax161/

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Nathan Chancellor

    Masahiro Yamada
     
  • For simple text replacement, it is better to use a built-in function
    instead of sed if possible. You can save one process forking.

    I do not mean to replace all sed invocations because GNU Make itself
    does not support regular expression (unless you use guile).

    I just replaced simple ones.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • When building with LLVM_IAS=1, there is no point to specifying
    '--prefix=' because that flag is only used to find GNU cross tools,
    which will not be used indirectly when using the integrated assembler.
    All of the tools are invoked directly from PATH or a full path specified
    via the command line, which does not depend on the value of '--prefix='.

    Sharing commands to reproduce issues becomes a little bit easier without
    a '--prefix=' value because that '--prefix=' value is specific to a
    user's machine due to it being an absolute path.

    Some further notes from Fangrui Song:

    clang can spawn GNU as (if -f?no-integrated-as is specified) and GNU
    objcopy (-f?no-integrated-as and -gsplit-dwarf and -g[123]).
    objcopy is only used for GNU as assembled object files.
    With integrated assembler, the object file streamer creates .o and
    .dwo simultaneously.
    With GNU as, two objcopy commands are needed to extract .debug*.dwo to
    .dwo files && another command to remove .debug*.dwo sections.

    A small consequence of this change (to keep things simple) is that
    '--prefix=' will always be specified now, even with a native build, when
    it was not before. This should not be an issue due to the way that the
    Makefile searches for the prefix (based on elfedit's location). This
    ends up improving the experience for host builds because PATH is better
    respected and matches GCC's behavior more closely. See the below thread
    for more details:

    https://lore.kernel.org/r/20210205213651.GA16907@Ryzen-5-4500U.localdomain/

    Signed-off-by: Nathan Chancellor
    Signed-off-by: Masahiro Yamada

    Nathan Chancellor
     
  • This flag was originally added to allow clang to find the GNU cross
    tools in commit 785f11aa595b ("kbuild: Add better clang cross build
    support"). This flag was not enough to find the tools at times so
    '--prefix' was added to the list in commit ef8c4ed9db80 ("kbuild: allow
    to use GCC toolchain not in Clang search path") and improved upon in
    commit ca9b31f6bb9c ("Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang
    cross compilation"). Now that '--prefix' specifies a full path and
    prefix, '--gcc-toolchain' serves no purpose because the kernel builds
    with '-nostdinc' and '-nostdlib'.

    This has been verified with self compiled LLVM 10.0.1 and LLVM 13.0.0 as
    well as a distribution version of LLVM 11.1.0 without binutils in the
    LLVM toolchain locations.

    Link: https://reviews.llvm.org/D97902
    Signed-off-by: Nathan Chancellor
    Reviewed-by: Fangrui Song
    Reviewed-by: Nick Desaulniers
    Tested-by: Nick Desaulniers
    Tested-by: Sedat Dilek
    Signed-off-by: Masahiro Yamada

    Nathan Chancellor
     
  • The patch adding CONFIG_VMLINUX_MAP revealed a small defect in the
    build system: link-vmlinux.sh takes decisions based on CONFIG_*
    options, but changing one of those does not always lead to vmlinux
    being linked again.

    For most of the CONFIG_* knobs referenced previously, this has
    probably been hidden by those knobs also affecting some object file,
    hence indirectly also vmlinux.

    But CONFIG_VMLINUX_MAP is only handled inside link-vmlinux.sh, and
    changing CONFIG_VMLINUX_MAP=n to CONFIG_VMLINUX_MAP=y does not cause
    the build system to re-link (and hence have vmlinux.map
    emitted). Since that map file is mostly a debugging aid, this is
    merely a nuisance which is easily worked around by just deleting
    vmlinux and building again.

    But one could imagine other (possibly future) CONFIG options that
    actually do affect the vmlinux binary but which are not captured
    through some object file dependency.

    To fix this, make link-vmlinux.sh emit a .vmlinux.d file in the same
    format as the dependency files generated by gcc, and apply the fixdep
    logic to that. I've tested that this correctly works with both in-tree
    and out-of-tree builds.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Masahiro Yamada

    Rasmus Villemoes
     
  • Since commit 7ecaf069da52 ("kbuild: move headers_check rule to
    usr/include/Makefile"), 'make headers_check' is no-op.

    This stub target is remaining here in case some scripts still invoke it.
    In order to prompt people to remove stale code, show a noisy warning
    message if used. The stub will be really removed after the Linux 5.15
    release.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Since commit f2f02ebd8f38 ("kbuild: improve cc-option to clean up all
    temporary files"), running 'make kernelversion' in a read-only source
    tree emits a bunch of warnings:

    mkdir: cannot create directory '.tmp_12345': Permission denied

    No-build targets such as kernelversion, clean, help, etc. do not
    need to evaluate $(call cc-option,) or friends. Skip Makefile.compiler
    so $(call cc-option,) becomes no-op.

    This not only fixes the warnings, but also runs non-build targets much
    faster.

    Basically, all installation targets should also be non-build targets.
    Unfortunately, vdso_install requires the compiler because it builds
    vdso before installation. This is a problem that must be fixed by a
    separate patch.

    Reported-by: Israel Tsadok
    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • scripts/Kbuild.include is included everywhere, but macros such as
    cc-option are needed by build targets only.

    For example, when 'make clean' traverses the tree, it does not need
    to evaluate $(call cc-option,).

    Split cc-option, ld-option, etc. to scripts/Makefile.compiler, which
    is only included from the top Makefile and scripts/Makefile.build.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

15 Mar, 2021

2 commits

  • VPATH is used in Kbuild to make pattern rules search for prerequisites
    in both $(objtree) and $(srctree). Some of *.c, *.S files are not real
    sources, but generated by tools such as flex, bison, perl.

    In contrast, I doubt the benefit of --include-dir=$(abs_srctree) because
    it is always clear which Makefiles are real sources, and which are not.

    So, my hope is to add $(srctree)/ prefix to all check-in Makefiles,
    then remove --include-dir=$(abs_srctree) flag in the future.

    I am touching only some Kbuild core parts for now. Treewide fixes will
    be needed to achieve this goal.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Linus Torvalds
     

11 Mar, 2021

1 commit

  • Linus reported a build error due to the GCC plugin incompatibility
    when the compiler is upgraded. [1]

    GCC plugins are tied to a particular GCC version. So, they must be
    rebuilt when the compiler is upgraded.

    This seems to be a long-standing flaw since the initial support of
    GCC plugins.

    Extend commit 8b59cd81dc5e ("kbuild: ensure full rebuild when the
    compiler is updated"), so that GCC plugins are covered by the
    compiler upgrade detection.

    [1]: https://lore.kernel.org/lkml/CAHk-=wieoN5ttOy7SnsGwZv+Fni3R6m-Ut=oxih6bbZ28G+4dw@mail.gmail.com/

    Reported-by: Linus Torvalds
    Signed-off-by: Masahiro Yamada
    Reviewed-by: Kees Cook

    Masahiro Yamada
     

10 Mar, 2021

1 commit


06 Mar, 2021

1 commit


01 Mar, 2021

1 commit


28 Feb, 2021

2 commits

  • Commit 78d3bb4483ba ("kbuild: Fix for empty SUBLEVEL
    or PATCHLEVEL") fixed the build error for empty SUBLEVEL or PATCHLEVEL
    by prepending a zero.

    Commit 9b82f13e7ef3 ("kbuild: clamp SUBLEVEL to 255") re-introduced
    this issue.

    This time, we cannot take the same approach because we have C code:

    #define LINUX_VERSION_PATCHLEVEL $(PATCHLEVEL)
    #define LINUX_VERSION_SUBLEVEL $(SUBLEVEL)

    Replace empty SUBLEVEL/PATCHLEVEL with a zero.

    Fixes: 9b82f13e7ef3 ("kbuild: clamp SUBLEVEL to 255")
    Reported-by: Christian Zigotzky
    Signed-off-by: Masahiro Yamada
    Reviewed-and-tested-by: Sasha Levin

    Masahiro Yamada
     
  • 'make -s' should be really silent. However, 'make -s V=1' prints noisy
    log messages from some shell scripts.

    Of course, such a combination is odd, but the build system needs to do
    the right thing even if a user gives strange input.

    If -s is given, KBUILD_VERBOSE should be forced to 0.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

27 Feb, 2021

1 commit

  • 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

    Linus Torvalds
     

26 Feb, 2021

2 commits

  • Instead of 'make distclean', 'make clean' should remove build artifacts
    unneeded by external module builds. Obviously, you do not need to keep
    this directory.

    Fixes: dc5723b02e52 ("kbuild: add support for Clang LTO")
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Kees Cook
    Link: https://lore.kernel.org/r/20210225193912.3303604-1-masahiroy@kernel.org

    Masahiro Yamada
     
  • Pull Kbuild updates from Masahiro Yamada:

    - Fix false-positive build warnings for ARCH=ia64 builds

    - Optimize dictionary size for module compression with xz

    - Check the compiler and linker versions in Kconfig

    - Fix misuse of extra-y

    - Support DWARF v5 debug info

    - Clamp SUBLEVEL to 255 because stable releases 4.4.x and 4.9.x
    exceeded the limit

    - Add generic syscall{tbl,hdr}.sh for cleanups across arches

    - Minor cleanups of genksyms

    - Minor cleanups of Kconfig

    * tag 'kbuild-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (38 commits)
    initramfs: Remove redundant dependency of RD_ZSTD on BLK_DEV_INITRD
    kbuild: remove deprecated 'always' and 'hostprogs-y/m'
    kbuild: parse C= and M= before changing the working directory
    kbuild: reuse this-makefile to define abs_srctree
    kconfig: unify rule of config, menuconfig, nconfig, gconfig, xconfig
    kconfig: omit --oldaskconfig option for 'make config'
    kconfig: fix 'invalid option' for help option
    kconfig: remove dead code in conf_askvalue()
    kconfig: clean up nested if-conditionals in check_conf()
    kconfig: Remove duplicate call to sym_get_string_value()
    Makefile: Remove # characters from compiler string
    Makefile: reuse CC_VERSION_TEXT
    kbuild: check the minimum linker version in Kconfig
    kbuild: remove ld-version macro
    scripts: add generic syscallhdr.sh
    scripts: add generic syscalltbl.sh
    arch: syscalls: remove $(srctree)/ prefix from syscall tables
    arch: syscalls: add missing FORCE and fix 'targets' to make if_changed work
    gen_compile_commands: prune some directories
    kbuild: simplify access to the kernel's version
    ...

    Linus Torvalds
     

24 Feb, 2021

8 commits

  • If Kbuild recurses to the top Makefile (for example, 'make deb-pkg'),
    C= and M= are parsed over again, needlessly.

    Parse them before changing the working directory. After that,
    sub_make_done is set to 1, so they are parsed just once.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Move this-makefile up, and reuse it to define abs_srctree.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • When using AMD's Optimizing C/C++ Compiler (AOCC), the build fails due
    to a # character in the version string, which is interpreted as a
    comment:

    $ make CC=clang defconfig init/main.o
    include/config/auto.conf.cmd:1374: *** invalid syntax in conditional. Stop.

    $ sed -n 1374p include/config/auto.conf.cmd
    ifneq "$(CC_VERSION_TEXT)" "AMD clang version 11.0.0 (CLANG: AOCC_2.3.0-Build#85 2020_11_10) (based on LLVM Mirror.Version.11.0.0)"

    Remove all # characters in the version string so that the build does not
    fail unexpectedly.

    Link: https://github.com/ClangBuiltLinux/linux/issues/1298
    Reported-by: Michael Fuckner
    Signed-off-by: Nathan Chancellor
    Signed-off-by: Masahiro Yamada

    Nathan Chancellor
     
  • I noticed we're invoking $(CC) via $(shell) more than once to check the
    version. Let's reuse the first string captured in $CC_VERSION_TEXT.

    Signed-off-by: Nick Desaulniers
    [masahiro.yamada:
    CC_VERSION_TEXT is assigned by = instead of :=, so this $(shell ) is
    evaluated multiple times anyway. The number of $(CC) invocations will
    be still the same. Replacing 'grep' with the built-in $(findstring )
    will give real performance benefit.]
    Signed-off-by: Masahiro Yamada

    Nick Desaulniers
     
  • Pull more clang LTO updates from Kees Cook:
    "Clang LTO x86 enablement.

    Full disclosure: while this has _not_ been in linux-next (since it
    initially looked like the objtool dependencies weren't going to make
    v5.12), it has been under daily build and runtime testing by Sami for
    quite some time. These x86 portions have been discussed on lkml, with
    Peter, Josh, and others helping nail things down.

    The bulk of the changes are to get objtool working happily. The rest
    of the x86 enablement is very small.

    Summary:

    - Generate __mcount_loc in objtool (Peter Zijlstra)

    - Support running objtool against vmlinux.o (Sami Tolvanen)

    - Clang LTO enablement for x86 (Sami Tolvanen)"

    Link: https://lore.kernel.org/lkml/20201013003203.4168817-26-samitolvanen@google.com/
    Link: https://lore.kernel.org/lkml/cover.1611263461.git.jpoimboe@redhat.com/

    * tag 'clang-lto-v5.12-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    kbuild: lto: force rebuilds when switching CONFIG_LTO
    x86, build: allow LTO to be selected
    x86, cpu: disable LTO for cpu.c
    x86, vdso: disable LTO only for vDSO
    kbuild: lto: postpone objtool
    objtool: Split noinstr validation from --vmlinux
    x86, build: use objtool mcount
    tracing: add support for objtool mcount
    objtool: Don't autodetect vmlinux.o
    objtool: Fix __mcount_loc generation with Clang's assembler
    objtool: Add a pass for generating __mcount_loc

    Linus Torvalds
     
  • When doing non-clean builds and switching between CONFIG_LTO=n and
    CONFIG_LTO=y, the build system (correctly) didn't notice that assembly
    and LTO-excluded C object files were rewritten in place by objtool (to
    add the .orc_unwind* sections), since their build command lines were the
    same between CONFIG_LTO=y and CONFIG_LTO=n. The objtool step would fail:

    vmlinux.o: warning: objtool: file already has .orc_unwind section, skipping
    make: *** [Makefile:1194: vmlinux] Error 255

    Avoid this by making sure the build will see a difference between an LTO
    and non-LTO build (by including "-fno-lto" in KBUILD_*FLAGS). This will
    get ignored when CC_FLAGS_LTO is present, and will not be included at
    all when CONFIG_LTO=n.

    Signed-off-by: Sami Tolvanen
    Signed-off-by: Kees Cook

    Sami Tolvanen
     
  • This change adds build support for using objtool to generate
    __mcount_loc sections.

    Signed-off-by: Sami Tolvanen

    Sami Tolvanen
     
  • Pull clang LTO updates from Kees Cook:
    "Clang Link Time Optimization.

    This is built on the work done preparing for LTO by arm64 folks,
    tracing folks, etc. This includes the core changes as well as the
    remaining pieces for arm64 (LTO has been the default build method on
    Android for about 3 years now, as it is the prerequisite for the
    Control Flow Integrity protections).

    While x86 LTO enablement is done, it depends on some pending objtool
    clean-ups. It's possible that I'll send a "part 2" pull request for
    LTO that includes x86 support.

    For merge log posterity, and as detailed in commit dc5723b02e52
    ("kbuild: add support for Clang LTO"), here is the lt;dr to do an LTO
    build:

    make LLVM=1 LLVM_IAS=1 defconfig
    scripts/config -e LTO_CLANG_THIN
    make LLVM=1 LLVM_IAS=1

    (To do a cross-compile of arm64, add "CROSS_COMPILE=aarch64-linux-gnu-"
    and "ARCH=arm64" to the "make" command lines.)

    Summary:

    - Clang LTO build infrastructure and arm64-specific enablement (Sami
    Tolvanen)

    - Recursive build CC_FLAGS_LTO fix (Alexander Lobakin)"

    * tag 'clang-lto-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    kbuild: prevent CC_FLAGS_LTO self-bloating on recursive rebuilds
    arm64: allow LTO to be selected
    arm64: disable recordmcount with DYNAMIC_FTRACE_WITH_REGS
    arm64: vdso: disable LTO
    drivers/misc/lkdtm: disable LTO for rodata.o
    efi/libstub: disable LTO
    scripts/mod: disable LTO for empty.c
    modpost: lto: strip .lto from module names
    PCI: Fix PREL32 relocations for LTO
    init: lto: fix PREL32 relocations
    init: lto: ensure initcall ordering
    kbuild: lto: add a default list of used symbols
    kbuild: lto: merge module sections
    kbuild: lto: limit inlining
    kbuild: lto: fix module versioning
    kbuild: add support for Clang LTO
    tracing: move function tracer options to Kconfig

    Linus Torvalds
     

23 Feb, 2021

1 commit

  • Pull devicetree updates from Rob Herring:

    - Sync dtc to upstream version v1.6.0-51-g183df9e9c2b9 and build host
    fdtoverlay

    - Add kbuild support to build DT overlays (%.dtbo)

    - Drop NULLifying match table in of_match_device().

    In preparation for this, there are several driver cleanups to use
    (of_)?device_get_match_data().

    - Drop pointless wrappers from DT struct device API

    - Convert USB binding schemas to use graph schema and remove old plain
    text graph binding doc

    - Convert spi-nor and v3d GPU bindings to DT schema

    - Tree wide schema fixes for if/then schemas, array size constraints,
    and undocumented compatible strings in examples

    - Handle 'no-map' correctly for already reserved memblock regions

    * tag 'devicetree-for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (35 commits)
    driver core: platform: Drop of_device_node_put() wrapper
    of: Remove of_dev_{get,put}()
    dt-bindings: usb: Change descibe to describe in usbmisc-imx.txt
    dt-bindings: can: rcar_canfd: Group tuples in pin control properties
    dt-bindings: power: renesas,apmu: Group tuples in cpus properties
    dt-bindings: mtd: spi-nor: Convert to DT schema format
    dt-bindings: Use portable sort for version cmp
    dt-bindings: ethernet-controller: fix fixed-link specification
    dt-bindings: irqchip: Add node name to PRUSS INTC
    dt-bindings: interconnect: Fix the expected number of cells
    dt-bindings: Fix errors in 'if' schemas
    dt-bindings: iommu: renesas,ipmmu-vmsa: Make 'power-domains' conditionally required
    dt-bindings: Fix undocumented compatible strings in examples
    kbuild: Add support to build overlays (%.dtbo)
    scripts: dtc: Remove the unused fdtdump.c file
    scripts: dtc: Build fdtoverlay tool
    scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9
    scripts: dtc: Fetch fdtoverlay.c from external DTC project
    dt-bindings: thermal: sun8i: Fix misplaced schema keyword in compatible strings
    dt-bindings: iio: dac: Fix AD5686 references
    ...

    Linus Torvalds
     

21 Feb, 2021

1 commit

  • Pull networking updates from David Miller:
    "Here is what we have this merge window:

    1) Support SW steering for mlx5 Connect-X6Dx, from Yevgeny Kliteynik.

    2) Add RSS multi group support to octeontx2-pf driver, from Geetha
    Sowjanya.

    3) Add support for KS8851 PHY. From Marek Vasut.

    4) Add support for GarfieldPeak bluetooth controller from Kiran K.

    5) Add support for half-duplex tcan4x5x can controllers.

    6) Add batch skb rx processing to bcrm63xx_enet, from Sieng Piaw
    Liew.

    7) Rework RX port offload infrastructure, particularly wrt, UDP
    tunneling, from Jakub Kicinski.

    8) Add BCM72116 PHY support, from Florian Fainelli.

    9) Remove Dsa specific notifiers, they are unnecessary. From Vladimir
    Oltean.

    10) Add support for picosecond rx delay in dwmac-meson8b chips. From
    Martin Blumenstingl.

    11) Support TSO on xfrm interfaces from Eyal Birger.

    12) Add support for MP_PRIO to mptcp stack, from Geliang Tang.

    13) Support BCM4908 integrated switch, from Rafał Miłecki.

    14) Support for directly accessing kernel module variables via module
    BTF info, from Andrii Naryiko.

    15) Add DASH (esktop and mobile Architecture for System Hardware)
    support to r8169 driver, from Heiner Kallweit.

    16) Add rx vlan filtering to dpaa2-eth, from Ionut-robert Aron.

    17) Add support for 100 base0x SFP devices, from Bjarni Jonasson.

    18) Support link aggregation in DSA, from Tobias Waldekranz.

    19) Support for bitwidse atomics in bpf, from Brendan Jackman.

    20) SmartEEE support in at803x driver, from Russell King.

    21) Add support for flow based tunneling to GTP, from Pravin B Shelar.

    22) Allow arbitrary number of interconnrcts in ipa, from Alex Elder.

    23) TLS RX offload for bonding, from Tariq Toukan.

    24) RX decap offklload support in mac80211, from Felix Fietkou.

    25) devlink health saupport in octeontx2-af, from George Cherian.

    26) Add TTL attr to SCM_TIMESTAMP_OPT_STATS, from Yousuk Seung

    27) Delegated actionss support in mptcp, from Paolo Abeni.

    28) Support receive timestamping when doin zerocopy tcp receive. From
    Arjun Ray.

    29) HTB offload support for mlx5, from Maxim Mikityanskiy.

    30) UDP GRO forwarding, from Maxim Mikityanskiy.

    31) TAPRIO offloading in dsa hellcreek driver, from Kurt Kanzenbach.

    32) Weighted random twos choice algorithm for ipvs, from Darby Payne.

    33) Fix netdev registration deadlock, from Johannes Berg.

    34) Various conversions to new tasklet api, from EmilRenner Berthing.

    35) Bulk skb allocations in veth, from Lorenzo Bianconi.

    36) New ethtool interface for lane setting, from Danielle Ratson.

    37) Offload failiure notifications for routes, from Amit Cohen.

    38) BCM4908 support, from Rafał Miłecki.

    39) Support several new iwlwifi chips, from Ihab Zhaika.

    40) Flow drector support for ipv6 in i40e, from Przemyslaw Patynowski.

    41) Support for mhi prrotocols, from Loic Poulain.

    42) Optimize bpf program stats.

    43) Implement RFC6056, for better port randomization, from Eric
    Dumazet.

    44) hsr tag offloading support from George McCollister.

    45) Netpoll support in qede, from Bhaskar Upadhaya.

    46) 2005/400g speed support in bonding 3ad mode, from Nikolay
    Aleksandrov.

    47) Netlink event support in mptcp, from Florian Westphal.

    48) Better skbuff caching, from Alexander Lobakin.

    49) MRP (Media Redundancy Protocol) offloading in DSA and a few
    drivers, from Horatiu Vultur.

    50) mqprio saupport in mvneta, from Maxime Chevallier.

    51) Remove of_phy_attach, no longer needed, from Florian Fainelli"

    * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (1766 commits)
    octeontx2-pf: Fix otx2_get_fecparam()
    cteontx2-pf: cn10k: Prevent harmless double shift bugs
    net: stmmac: Add PCI bus info to ethtool driver query output
    ptp: ptp_clockmatrix: clean-up - parenthesis around a == b are unnecessary
    ptp: ptp_clockmatrix: Simplify code - remove unnecessary `err` variable.
    ptp: ptp_clockmatrix: Coding style - tighten vertical spacing.
    ptp: ptp_clockmatrix: Clean-up dev_*() messages.
    ptp: ptp_clockmatrix: Remove unused header declarations.
    ptp: ptp_clockmatrix: Add alignment of 1 PPS to idtcm_perout_enable.
    ptp: ptp_clockmatrix: Add wait_for_sys_apll_dpll_lock.
    net: stmmac: dwmac-sun8i: Add a shutdown callback
    net: stmmac: dwmac-sun8i: Minor probe function cleanup
    net: stmmac: dwmac-sun8i: Use reset_control_reset
    net: stmmac: dwmac-sun8i: Remove unnecessary PHY power check
    net: stmmac: dwmac-sun8i: Return void from PHY unpower
    r8169: use macro pm_ptr
    net: mdio: Remove of_phy_attach()
    net: mscc: ocelot: select PACKING in the Kconfig
    net: re-solve some conflicts after net -> net-next merge
    net: dsa: tag_rtl4_a: Support also egress tags
    ...

    Linus Torvalds
     

18 Feb, 2021

1 commit

  • CC_FLAGS_LTO gets initialized only via +=, never with := or =.
    When building with CONFIG_TRIM_UNUSED_KSYMS, Kbuild may perform
    several kernel rebuilds to satisfy symbol dependencies. In this
    case, value of CC_FLAGS_LTO is concatenated each time, which
    triggers a full rebuild.
    Initialize it with := to fix this.

    Fixes: dc5723b02e52 ("kbuild: add support for Clang LTO")
    Signed-off-by: Alexander Lobakin
    Signed-off-by: Kees Cook
    Link: https://lore.kernel.org/r/20210121184544.659998-1-alobakin@pm.me

    Alexander Lobakin
     

17 Feb, 2021

1 commit

  • Daniel Borkmann says:

    ====================
    pull-request: bpf-next 2021-02-16

    The following pull-request contains BPF updates for your *net-next* tree.

    There's a small merge conflict between 7eeba1706eba ("tcp: Add receive timestamp
    support for receive zerocopy.") from net-next tree and 9cacf81f8161 ("bpf: Remove
    extra lock_sock for TCP_ZEROCOPY_RECEIVE") from bpf-next tree. Resolve as follows:

    [...]
    lock_sock(sk);
    err = tcp_zerocopy_receive(sk, &zc, &tss);
    err = BPF_CGROUP_RUN_PROG_GETSOCKOPT_KERN(sk, level, optname,
    &zc, &len, err);
    release_sock(sk);
    [...]

    We've added 116 non-merge commits during the last 27 day(s) which contain
    a total of 156 files changed, 5662 insertions(+), 1489 deletions(-).

    The main changes are:

    1) Adds support of pointers to types with known size among global function
    args to overcome the limit on max # of allowed args, from Dmitrii Banshchikov.

    2) Add bpf_iter for task_vma which can be used to generate information similar
    to /proc/pid/maps, from Song Liu.

    3) Enable bpf_{g,s}etsockopt() from all sock_addr related program hooks. Allow
    rewriting bind user ports from BPF side below the ip_unprivileged_port_start
    range, both from Stanislav Fomichev.

    4) Prevent recursion on fentry/fexit & sleepable programs and allow map-in-map
    as well as per-cpu maps for the latter, from Alexei Starovoitov.

    5) Add selftest script to run BPF CI locally. Also enable BPF ringbuffer
    for sleepable programs, both from KP Singh.

    6) Extend verifier to enable variable offset read/write access to the BPF
    program stack, from Andrei Matei.

    7) Improve tc & XDP MTU handling and add a new bpf_check_mtu() helper to
    query device MTU from programs, from Jesper Dangaard Brouer.

    8) Allow bpf_get_socket_cookie() helper also be called from [sleepable] BPF
    tracing programs, from Florent Revest.

    9) Extend x86 JIT to pad JMPs with NOPs for helping image to converge when
    otherwise too many passes are required, from Gary Lin.

    10) Verifier fixes on atomics with BPF_FETCH as well as function-by-function
    verification both related to zero-extension handling, from Ilya Leoshkevich.

    11) Better kernel build integration of resolve_btfids tool, from Jiri Olsa.

    12) Batch of AF_XDP selftest cleanups and small performance improvement
    for libbpf's xsk map redirect for newer kernels, from Björn Töpel.

    13) Follow-up BPF doc and verifier improvements around atomics with
    BPF_FETCH, from Brendan Jackman.

    14) Permit zero-sized data sections e.g. if ELF .rodata section contains
    read-only data from local variables, from Yonghong Song.

    15) veth driver skb bulk-allocation for ndo_xdp_xmit, from Lorenzo Bianconi.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller