17 Dec, 2020

3 commits

  • With CONFIG_MODVERSIONS, version information is linked into each
    compilation unit that exports symbols. With LTO, we cannot use this
    method as all C code is compiled into LLVM bitcode instead. This
    change collects symbol versions into .symversions files and merges
    them in link-vmlinux.sh where they are all linked into vmlinux.o at
    the same time.

    Bug: 145210207
    Change-Id: Icd8fd0c760891eff7a0ed12ce48b4db2a85fc2ad
    Link: https://lore.kernel.org/lkml/20201211184633.3213045-1-samitolvanen@google.com/
    Signed-off-by: Sami Tolvanen
    Reviewed-by: Kees Cook

    Sami Tolvanen
     
  • This change adds build system support for Clang's Link Time
    Optimization (LTO). With -flto, instead of ELF object files, Clang
    produces LLVM bitcode, which is compiled into native code at link
    time, allowing the final binary to be optimized globally. For more
    details, see:

    https://llvm.org/docs/LinkTimeOptimization.html

    The Kconfig option CONFIG_LTO_CLANG is implemented as a choice,
    which defaults to LTO being disabled. To use LTO, the architecture
    must select ARCH_SUPPORTS_LTO_CLANG and support:

    - compiling with Clang,
    - compiling all assembly code with Clang's integrated assembler,
    - and linking with LLD.

    While using CONFIG_LTO_CLANG_FULL results in the best runtime
    performance, the compilation is not scalable in time or
    memory. CONFIG_LTO_CLANG_THIN enables ThinLTO, which allows
    parallel optimization and faster incremental builds. ThinLTO is
    used by default if the architecture also selects
    ARCH_SUPPORTS_LTO_CLANG_THIN:

    https://clang.llvm.org/docs/ThinLTO.html

    To enable LTO, LLVM tools must be used to handle bitcode files, by
    passing LLVM=1 and LLVM_IAS=1 options to make:

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

    To prepare for LTO support with other compilers, common parts are
    gated behind the CONFIG_LTO option, and LTO can be disabled for
    specific files by filtering out CC_FLAGS_LTO.

    Bug: 145210207
    Change-Id: I85eb4523ea787e4f9884e12ed6301f876d0d888e
    Link: https://lore.kernel.org/lkml/20201211184633.3213045-1-samitolvanen@google.com/
    Signed-off-by: Sami Tolvanen
    Reviewed-by: Kees Cook

    Sami Tolvanen
     
  • Move function tracer options to Kconfig to make it easier to add
    new methods for generating __mcount_loc, and to make the options
    available also when building kernel modules.

    Note that FTRACE_MCOUNT_USE_* options are updated on rebuild and
    therefore, work even if the .config was generated in a different
    environment.

    Bug: 145210207
    Change-Id: I6fc38abde50b602788148cb236aba1261affa896
    Link: https://lore.kernel.org/lkml/20201211184633.3213045-1-samitolvanen@google.com/
    Signed-off-by: Sami Tolvanen
    Acked-by: Steven Rostedt (VMware)

    Sami Tolvanen
     

15 Dec, 2020

2 commits


14 Dec, 2020

2 commits


09 Dec, 2020

1 commit


07 Dec, 2020

2 commits

  • Linus Torvalds
     
  • …t/masahiroy/linux-kbuild

    Pull Kbuild fixes from Masahiro Yamada:

    - Move -Wcast-align to W=3, which tends to be false-positive and there
    is no tree-wide solution.

    - Pass -fmacro-prefix-map to KBUILD_CPPFLAGS because it is a
    preprocessor option and makes sense for .S files as well.

    - Disable -gdwarf-2 for Clang's integrated assembler to avoid warnings.

    - Disable --orphan-handling=warn for LLD 10.0.1 to avoid warnings.

    - Fix undesirable line breaks in *.mod files.

    * tag 'kbuild-fixes-v5.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    kbuild: avoid split lines in .mod files
    kbuild: Disable CONFIG_LD_ORPHAN_WARN for ld.lld 10.0.1
    kbuild: Hoist '--orphan-handling' into Kconfig
    Kbuild: do not emit debug info for assembly with LLVM_IAS=1
    kbuild: use -fmacro-prefix-map for .S sources
    Makefile.extrawarn: move -Wcast-align to W=3

    Linus Torvalds
     

01 Dec, 2020

1 commit

  • Currently, '--orphan-handling=warn' is spread out across four different
    architectures in their respective Makefiles, which makes it a little
    unruly to deal with in case it needs to be disabled for a specific
    linker version (in this case, ld.lld 10.0.1).

    To make it easier to control this, hoist this warning into Kconfig and
    the main Makefile so that disabling it is simpler, as the warning will
    only be enabled in a couple places (main Makefile and a couple of
    compressed boot folders that blow away LDFLAGS_vmlinx) and making it
    conditional is easier due to Kconfig syntax. One small additional
    benefit of this is saving a call to ld-option on incremental builds
    because we will have already evaluated it for CONFIG_LD_ORPHAN_WARN.

    To keep the list of supported architectures the same, introduce
    CONFIG_ARCH_WANT_LD_ORPHAN_WARN, which an architecture can select to
    gain this automatically after all of the sections are specified and size
    asserted. A special thanks to Kees Cook for the help text on this
    config.

    Link: https://github.com/ClangBuiltLinux/linux/issues/1187
    Acked-by: Kees Cook
    Acked-by: Michael Ellerman (powerpc)
    Reviewed-by: Nick Desaulniers
    Tested-by: Nick Desaulniers
    Signed-off-by: Nathan Chancellor
    Signed-off-by: Masahiro Yamada

    Nathan Chancellor
     

30 Nov, 2020

3 commits


29 Nov, 2020

1 commit


25 Nov, 2020

2 commits

  • Clang's integrated assembler produces the warning for assembly files:

    warning: DWARF2 only supports one section per compilation unit

    If -Wa,-gdwarf-* is unspecified, then debug info is not emitted for
    assembly sources (it is still emitted for C sources). This will be
    re-enabled for newer DWARF versions in a follow up patch.

    Enables defconfig+CONFIG_DEBUG_INFO to build cleanly with
    LLVM=1 LLVM_IAS=1 for x86_64 and arm64.

    Cc:
    Link: https://github.com/ClangBuiltLinux/linux/issues/716
    Reported-by: Dmitry Golovin
    Reported-by: Nathan Chancellor
    Suggested-by: Dmitry Golovin
    Suggested-by: Nathan Chancellor
    Suggested-by: Sedat Dilek
    Reviewed-by: Fangrui Song
    Reviewed-by: Nathan Chancellor
    Signed-off-by: Nick Desaulniers
    Signed-off-by: Masahiro Yamada

    Nick Desaulniers
     
  • Follow-up to commit a73619a845d5 ("kbuild: use -fmacro-prefix-map to
    make __FILE__ a relative path"). Assembler sources also use __FILE__
    macro so this flag should be also applied to those sources.

    Signed-off-by: Denys Zagorui
    Signed-off-by: Masahiro Yamada

    Denys Zagorui
     

23 Nov, 2020

2 commits


16 Nov, 2020

2 commits


11 Nov, 2020

2 commits

  • Clang's integrated assembler produces the warning for assembly files:

    warning: DWARF2 only supports one section per compilation unit

    If -Wa,-gdwarf-* is unspecified, then debug info is not emitted for
    assembly sources (it is still emitted for C sources). This will be
    re-enabled for newer DWARF versions in a follow up patch.

    Enables defconfig+CONFIG_DEBUG_INFO to build cleanly with
    LLVM=1 LLVM_IAS=1 for x86_64 and arm64.

    Reported-by: Dmitry Golovin
    Reported-by: Nathan Chancellor
    Suggested-by: Dmitry Golovin
    Suggested-by: Nathan Chancellor
    Suggested-by: Sedat Dilek
    Signed-off-by: Nick Desaulniers
    Reviewed-by: Fangrui Song
    Reviewed-by: Nathan Chancellor
    Cc:
    Link: https://github.com/ClangBuiltLinux/linux/issues/716

    Bug: 141693040
    Link: https://lore.kernel.org/lkml/20201109183528.1391885-1-ndesaulniers@google.com/
    Signed-off-by: Nick Desaulniers
    Change-Id: I55c8ad79dfeaae478c8de52d484e76fb2e37c194

    Nick Desaulniers
     
  • This reverts commit e145f7b10374662f03889c2dea0fdc14df7f1371.

    AOSP's distribution of GNU binutils always had a curious target triple
    prefix on the binaries. Now that GNU binutils is deprecated for Android
    Common Kernels, we can now remove this out of tree workaround. Now
    building Android kernels with LLVM matches upstream (see
    Documentation/kbuild/llvm.rst).

    Bug: 118439987
    Bug: 120440614
    Bug: 141693040
    Signed-off-by: Nick Desaulniers
    Change-Id: Iecaa3264a440f795f2f3a44bdf74fe28ad4ed1cc

    Nick Desaulniers
     

09 Nov, 2020

2 commits


02 Nov, 2020

3 commits


29 Oct, 2020

1 commit


27 Oct, 2020

1 commit


26 Oct, 2020

2 commits


25 Oct, 2020

1 commit


23 Oct, 2020

1 commit

  • Pull Kbuild updates from Masahiro Yamada:

    - Support 'make compile_commands.json' to generate the compilation
    database more easily, avoiding stale entries

    - Support 'make clang-analyzer' and 'make clang-tidy' for static checks
    using clang-tidy

    - Preprocess scripts/modules.lds.S to allow CONFIG options in the
    module linker script

    - Drop cc-option tests from compiler flags supported by our minimal
    GCC/Clang versions

    - Use always 12-digits commit hash for CONFIG_LOCALVERSION_AUTO=y

    - Use sha1 build id for both BFD linker and LLD

    - Improve deb-pkg for reproducible builds and rootless builds

    - Remove stale, useless scripts/namespace.pl

    - Turn -Wreturn-type warning into error

    - Fix build error of deb-pkg when CONFIG_MODULES=n

    - Replace 'hostname' command with more portable 'uname -n'

    - Various Makefile cleanups

    * tag 'kbuild-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (34 commits)
    kbuild: Use uname for LINUX_COMPILE_HOST detection
    kbuild: Only add -fno-var-tracking-assignments for old GCC versions
    kbuild: remove leftover comment for filechk utility
    treewide: remove DISABLE_LTO
    kbuild: deb-pkg: clean up package name variables
    kbuild: deb-pkg: do not build linux-headers package if CONFIG_MODULES=n
    kbuild: enforce -Werror=return-type
    scripts: remove namespace.pl
    builddeb: Add support for all required debian/rules targets
    builddeb: Enable rootless builds
    builddeb: Pass -n to gzip for reproducible packages
    kbuild: split the build log of kallsyms
    kbuild: explicitly specify the build id style
    scripts/setlocalversion: make git describe output more reliable
    kbuild: remove cc-option test of -Werror=date-time
    kbuild: remove cc-option test of -fno-stack-check
    kbuild: remove cc-option test of -fno-strict-overflow
    kbuild: move CFLAGS_{KASAN,UBSAN,KCSAN} exports to relevant Makefiles
    kbuild: remove redundant CONFIG_KASAN check from scripts/Makefile.kasan
    kbuild: do not create built-in objects for external module builds
    ...

    Linus Torvalds
     

20 Oct, 2020

1 commit

  • Some old GCC versions between 4.5.0 and 4.9.1 might miscompile code
    with -fvar-tracking-assingments (which is enabled by default with -g -O2).
    Commit 2062afb4f804 ("Fix gcc-4.9.0 miscompilation of load_balance()
    in scheduler") added -fno-var-tracking-assignments unconditionally to
    work around this. But newer versions of GCC no longer have this bug, so
    only add it for versions of GCC before 5.0. This allows various tools
    such as a perf probe or gdb debuggers or systemtap to resolve variable
    locations using dwarf locations in more code.

    Signed-off-by: Mark Wielaard
    Acked-by: Ian Rogers
    Reviewed-by: Andi Kleen
    Signed-off-by: Masahiro Yamada

    Mark Wielaard
     

16 Oct, 2020

1 commit

  • Pull networking updates from Jakub Kicinski:

    - Add redirect_neigh() BPF packet redirect helper, allowing to limit
    stack traversal in common container configs and improving TCP
    back-pressure.

    Daniel reports ~10Gbps => ~15Gbps single stream TCP performance gain.

    - Expand netlink policy support and improve policy export to user
    space. (Ge)netlink core performs request validation according to
    declared policies. Expand the expressiveness of those policies
    (min/max length and bitmasks). Allow dumping policies for particular
    commands. This is used for feature discovery by user space (instead
    of kernel version parsing or trial and error).

    - Support IGMPv3/MLDv2 multicast listener discovery protocols in
    bridge.

    - Allow more than 255 IPv4 multicast interfaces.

    - Add support for Type of Service (ToS) reflection in SYN/SYN-ACK
    packets of TCPv6.

    - In Multi-patch TCP (MPTCP) support concurrent transmission of data on
    multiple subflows in a load balancing scenario. Enhance advertising
    addresses via the RM_ADDR/ADD_ADDR options.

    - Support SMC-Dv2 version of SMC, which enables multi-subnet
    deployments.

    - Allow more calls to same peer in RxRPC.

    - Support two new Controller Area Network (CAN) protocols - CAN-FD and
    ISO 15765-2:2016.

    - Add xfrm/IPsec compat layer, solving the 32bit user space on 64bit
    kernel problem.

    - Add TC actions for implementing MPLS L2 VPNs.

    - Improve nexthop code - e.g. handle various corner cases when nexthop
    objects are removed from groups better, skip unnecessary
    notifications and make it easier to offload nexthops into HW by
    converting to a blocking notifier.

    - Support adding and consuming TCP header options by BPF programs,
    opening the doors for easy experimental and deployment-specific TCP
    option use.

    - Reorganize TCP congestion control (CC) initialization to simplify
    life of TCP CC implemented in BPF.

    - Add support for shipping BPF programs with the kernel and loading
    them early on boot via the User Mode Driver mechanism, hence reusing
    all the user space infra we have.

    - Support sleepable BPF programs, initially targeting LSM and tracing.

    - Add bpf_d_path() helper for returning full path for given 'struct
    path'.

    - Make bpf_tail_call compatible with bpf-to-bpf calls.

    - Allow BPF programs to call map_update_elem on sockmaps.

    - Add BPF Type Format (BTF) support for type and enum discovery, as
    well as support for using BTF within the kernel itself (current use
    is for pretty printing structures).

    - Support listing and getting information about bpf_links via the bpf
    syscall.

    - Enhance kernel interfaces around NIC firmware update. Allow
    specifying overwrite mask to control if settings etc. are reset
    during update; report expected max time operation may take to users;
    support firmware activation without machine reboot incl. limits of
    how much impact reset may have (e.g. dropping link or not).

    - Extend ethtool configuration interface to report IEEE-standard
    counters, to limit the need for per-vendor logic in user space.

    - Adopt or extend devlink use for debug, monitoring, fw update in many
    drivers (dsa loop, ice, ionic, sja1105, qed, mlxsw, mv88e6xxx,
    dpaa2-eth).

    - In mlxsw expose critical and emergency SFP module temperature alarms.
    Refactor port buffer handling to make the defaults more suitable and
    support setting these values explicitly via the DCBNL interface.

    - Add XDP support for Intel's igb driver.

    - Support offloading TC flower classification and filtering rules to
    mscc_ocelot switches.

    - Add PTP support for Marvell Octeontx2 and PP2.2 hardware, as well as
    fixed interval period pulse generator and one-step timestamping in
    dpaa-eth.

    - Add support for various auth offloads in WiFi APs, e.g. SAE (WPA3)
    offload.

    - Add Lynx PHY/PCS MDIO module, and convert various drivers which have
    this HW to use it. Convert mvpp2 to split PCS.

    - Support Marvell Prestera 98DX3255 24-port switch ASICs, as well as
    7-port Mediatek MT7531 IP.

    - Add initial support for QCA6390 and IPQ6018 in ath11k WiFi driver,
    and wcn3680 support in wcn36xx.

    - Improve performance for packets which don't require much offloads on
    recent Mellanox NICs by 20% by making multiple packets share a
    descriptor entry.

    - Move chelsio inline crypto drivers (for TLS and IPsec) from the
    crypto subtree to drivers/net. Move MDIO drivers out of the phy
    directory.

    - Clean up a lot of W=1 warnings, reportedly the actively developed
    subsections of networking drivers should now build W=1 warning free.

    - Make sure drivers don't use in_interrupt() to dynamically adapt their
    code. Convert tasklets to use new tasklet_setup API (sadly this
    conversion is not yet complete).

    * tag 'net-next-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (2583 commits)
    Revert "bpfilter: Fix build error with CONFIG_BPFILTER_UMH"
    net, sockmap: Don't call bpf_prog_put() on NULL pointer
    bpf, selftest: Fix flaky tcp_hdr_options test when adding addr to lo
    bpf, sockmap: Add locking annotations to iterator
    netfilter: nftables: allow re-computing sctp CRC-32C in 'payload' statements
    net: fix pos incrementment in ipv6_route_seq_next
    net/smc: fix invalid return code in smcd_new_buf_create()
    net/smc: fix valid DMBE buffer sizes
    net/smc: fix use-after-free of delayed events
    bpfilter: Fix build error with CONFIG_BPFILTER_UMH
    cxgb4/ch_ipsec: Replace the module name to ch_ipsec from chcr
    net: sched: Fix suspicious RCU usage while accessing tcf_tunnel_info
    bpf: Fix register equivalence tracking.
    rxrpc: Fix loss of final ack on shutdown
    rxrpc: Fix bundle counting for exclusive connections
    netfilter: restore NF_INET_NUMHOOKS
    ibmveth: Identify ingress large send packets.
    ibmveth: Switch order of ibmveth_helper calls.
    cxgb4: handle 4-tuple PEDIT to NAT mode translation
    selftests: Add VRF route leaking tests
    ...

    Linus Torvalds
     

14 Oct, 2020

1 commit

  • This reverts commit 87e0d4f0f37fb0c8c4aeeac46fff5e957738df79.

    -fno-merge-all-constants has been the default since clang-6; the minimum
    supported version of clang in the kernel is clang-10 (10.0.1).

    Suggested-by: Nathan Chancellor
    Signed-off-by: Nick Desaulniers
    Signed-off-by: Andrew Morton
    Tested-by: Sedat Dilek
    Reviewed-by: Fangrui Song
    Reviewed-by: Nathan Chancellor
    Reviewed-by: Sedat Dilek
    Reviewed-by: Kees Cook
    Cc: Andrey Konovalov
    Cc: Marco Elver
    Cc: Miguel Ojeda
    Cc: Alexei Starovoitov
    Cc: Daniel Borkmann
    Cc: Masahiro Yamada
    Cc: Vincenzo Frascino
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/20200902225911.209899-3-ndesaulniers@google.com
    Link: https://reviews.llvm.org/rL329300.
    Link: https://github.com/ClangBuiltLinux/linux/issues/9
    Signed-off-by: Linus Torvalds

    Nick Desaulniers
     

12 Oct, 2020

3 commits