30 Dec, 2020

2 commits

  • [ Upstream commit 092fde0f863b72b67c4d6dc03844f5658fc00a35 ]

    Fix a possible hang in xdpsock that can occur when using multiple
    threads. In this case, one or more of the threads might get stuck in
    the while-loop in tx_only after the user has signaled the main thread
    to stop execution. In this case, no more Tx packets will be sent, so a
    thread might get stuck in the aforementioned while-loop. Fix this by
    introducing a test inside the while-loop to check if the benchmark has
    been terminated. If so, return from the function.

    Fixes: cd9e72b6f210 ("samples/bpf: xdpsock: Add option to specify batch size")
    Signed-off-by: Magnus Karlsson
    Signed-off-by: Daniel Borkmann
    Link: https://lore.kernel.org/bpf/20201210163407.22066-1-magnus.karlsson@gmail.com
    Signed-off-by: Sasha Levin

    Magnus Karlsson
     
  • [ Upstream commit 0afe0a998c40085a6342e1aeb4c510cccba46caf ]

    Currently, lwt_len_hist's map lwt_len_hist_map is uses pinning, and the
    map isn't cleared on test end. This leds to reuse of that map for
    each test, which prevents the results of the test from being accurate.

    This commit fixes the problem by removing of pinned map from bpffs.
    Also, this commit add the executable permission to shell script
    files.

    Fixes: f74599f7c5309 ("bpf: Add tests and samples for LWT-BPF")
    Signed-off-by: Daniel T. Lee
    Signed-off-by: Andrii Nakryiko
    Link: https://lore.kernel.org/bpf/20201124090310.24374-7-danieltimlee@gmail.com
    Signed-off-by: Sasha Levin

    Daniel T. Lee
     

02 Dec, 2020

1 commit

  • Pull tracing fixes from Steven Rostedt:

    - Use correct timestamp variable for ring buffer write stamp update

    - Fix up before stamp and write stamp when crossing ring buffer sub
    buffers

    - Keep a zero delta in ring buffer in slow path if cmpxchg fails

    - Fix trace_printk static buffer for archs that care

    - Fix ftrace record accounting for ftrace ops with trampolines

    - Fix DYNAMIC_FTRACE_WITH_DIRECT_CALLS dependency

    - Remove WARN_ON in hwlat tracer that triggers on something that is OK

    - Make "my_tramp" trampoline in ftrace direct sample code global

    - Fixes in the bootconfig tool for better alignment management

    * tag 'trace-v5.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    ring-buffer: Always check to put back before stamp when crossing pages
    ftrace: Fix DYNAMIC_FTRACE_WITH_DIRECT_CALLS dependency
    ftrace: Fix updating FTRACE_FL_TRAMP
    tracing: Fix alignment of static buffer
    tracing: Remove WARN_ON in start_thread()
    samples/ftrace: Mark my_tramp[12]? global
    ring-buffer: Set the right timestamp in the slow path of __rb_reserve_next()
    ring-buffer: Update write stamp with the correct ts
    docs: bootconfig: Update file format on initrd image
    tools/bootconfig: Align the bootconfig applied initrd image size to 4
    tools/bootconfig: Fix to check the write failure correctly
    tools/bootconfig: Fix errno reference after printf()

    Linus Torvalds
     

01 Dec, 2020

1 commit

  • my_tramp[12]? are declared as global functions in C, but they are not
    marked global in the inline assembly definition. This mismatch confuses
    Clang's Control-Flow Integrity checking. Fix the definitions by adding
    .globl.

    Link: https://lkml.kernel.org/r/20201113183414.1446671-1-samitolvanen@google.com

    Fixes: 9d907f1ae80b8 ("ftrace/samples: Add a sample module that implements modify_ftrace_direct()")
    Reviewed-by: Kees Cook
    Signed-off-by: Sami Tolvanen
    Signed-off-by: Steven Rostedt (VMware)

    Sami Tolvanen
     

07 Nov, 2020

1 commit

  • Alexei Starovoitov says:

    ====================
    pull-request: bpf 2020-11-06

    1) Pre-allocated per-cpu hashmap needs to zero-fill reused element, from David.

    2) Tighten bpf_lsm function check, from KP.

    3) Fix bpftool attaching to flow dissector, from Lorenz.

    4) Use -fno-gcse for the whole kernel/bpf/core.c instead of function attribute, from Ard.

    * git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
    bpf: Update verification logic for LSM programs
    bpf: Zero-fill re-used per-cpu map element
    bpf: BPF_PRELOAD depends on BPF_SYSCALL
    tools/bpftool: Fix attaching flow dissector
    libbpf: Fix possible use after free in xsk_socket__delete
    libbpf: Fix null dereference in xsk_socket__delete
    libbpf, hashmap: Fix undefined behavior in hash_bits
    bpf: Don't rely on GCC __attribute__((optimize)) to disable GCSE
    tools, bpftool: Remove two unused variables.
    tools, bpftool: Avoid array index warnings.
    xsk: Fix possible memory leak at socket close
    bpf: Add struct bpf_redir_neigh forward declaration to BPF helper defs
    samples/bpf: Set rlimit for memlock to infinity in all samples
    bpf: Fix -Wshadow warnings
    selftest/bpf: Fix profiler test using CO-RE relocation for enums
    ====================

    Link: https://lore.kernel.org/r/20201106221759.24143-1-alexei.starovoitov@gmail.com
    Signed-off-by: Jakub Kicinski

    Jakub Kicinski
     

29 Oct, 2020

1 commit

  • This patch removes the MIC drivers from the kernel tree
    since the corresponding devices have been discontinued.

    Removing the dma and char-misc changes in one patch and
    merging via the char-misc tree is best to avoid any
    potential build breakage.

    Cc: Nikhil Rao
    Reviewed-by: Ashutosh Dixit
    Signed-off-by: Sudeep Dutt
    Acked-By: Vinod Koul
    Reviewed-by: Sherry Sun
    Link: https://lore.kernel.org/r/8c1443136563de34699d2c084df478181c205db4.1603854416.git.sudeep.dutt@intel.com
    Signed-off-by: Greg Kroah-Hartman

    Sudeep Dutt
     

28 Oct, 2020

1 commit

  • The memlock rlimit is a notorious source of failure for BPF programs. Most
    of the samples just set it to infinity, but a few used a lower limit. The
    problem with unconditionally setting a lower limit is that this will also
    override the limit if the system-wide setting is *higher* than the limit
    being set, which can lead to failures on systems that lock a lot of memory,
    but set 'ulimit -l' to unlimited before running a sample.

    One fix for this is to only conditionally set the limit if the current
    limit is lower, but it is simpler to just unify all the samples and have
    them all set the limit to infinity.

    Signed-off-by: Toke Høiland-Jørgensen
    Signed-off-by: Daniel Borkmann
    Acked-by: Andrii Nakryiko
    Acked-by: Jesper Dangaard Brouer
    Link: https://lore.kernel.org/bpf/20201026233623.91728-1-toke@redhat.com

    Toke Høiland-Jørgensen
     

22 Oct, 2020

1 commit

  • Yaniv reported a compilation error after pulling latest libbpf:

    [...]
    ../libbpf/src/root/usr/include/bpf/bpf_helpers.h:99:10: error:
    unknown register name 'r0' in asm
    : "r0", "r1", "r2", "r3", "r4", "r5");
    [...]

    The issue got triggered given Yaniv was compiling tracing programs with native
    target (e.g. x86) instead of BPF target, hence no BTF generated vmlinux.h nor
    CO-RE used, and later llc with -march=bpf was invoked to compile from LLVM IR
    to BPF object file. Given that clang was expecting x86 inline asm and not BPF
    one the error complained that these regs don't exist on the former.

    Guard bpf_tail_call_static() with defined(__bpf__) where BPF inline asm is valid
    to use. BPF tracing programs on more modern kernels use BPF target anyway and
    thus the bpf_tail_call_static() function will be available for them. BPF inline
    asm is supported since clang 7 (clang
    Signed-off-by: Daniel Borkmann
    Acked-by: Andrii Nakryiko
    Acked-by: Yonghong Song
    Tested-by: Yaniv Agman
    Link: https://lore.kernel.org/bpf/CAMy7=ZUk08w5Gc2Z-EKi4JFtuUCaZYmE4yzhJjrExXpYKR4L8w@mail.gmail.com
    Link: https://lore.kernel.org/bpf/20201021203257.26223-1-daniel@iogearbox.net

    Daniel Borkmann
     

16 Oct, 2020

4 commits

  • 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
     
  • Pull configfs updates from Christoph Hellwig:
    "Various cleanups for the configfs samples (Bartosz Golaszewski)"

    * tag 'configfs-5.10' of git://git.infradead.org/users/hch/configfs:
    samples: configfs: prefer pr_err() over bare printk(KERN_ERR
    samples: configfs: don't use spaces before tabs
    samples: configfs: consolidate local variables of the same type
    samples: configfs: don't reinitialize variables which are already zeroed
    samples: configfs: replace simple_strtoul() with kstrtoint()
    samples: configfs: fix alignment in item struct
    samples: configfs: drop unnecessary ternary operators
    samples: configfs: remove redundant newlines
    MAINTAINERS: add the sample directory to the configfs entry

    Linus Torvalds
     
  • Pull drm updates from Dave Airlie:
    "Not a major amount of change, the i915 trees got split into display
    and gt trees to better facilitate higher level review, and there's a
    major refactoring of i915 GEM locking to use more core kernel concepts
    (like ww-mutexes). msm gets per-process pagetables, older AMD SI cards
    get DC support, nouveau got a bump in displayport support with common
    code extraction from i915.

    Outside of drm this contains a couple of patches for hexint
    moduleparams which you've acked, and a virtio common code tree that
    you should also get via it's regular path.

    New driver:
    - Cadence MHDP8546 DisplayPort bridge driver

    core:
    - cross-driver scatterlist cleanups
    - devm_drm conversions
    - remove drm_dev_init
    - devm_drm_dev_alloc conversion

    ttm:
    - lots of refactoring and cleanups

    bridges:
    - chained bridge support in more drivers

    panel:
    - misc new panels

    scheduler:
    - cleanup priority levels

    displayport:
    - refactor i915 code into helpers for nouveau

    i915:
    - split into display and GT trees
    - WW locking refactoring in GEM
    - execbuf2 extension mechanism
    - syncobj timeline support
    - GEN 12 HOBL display powersaving
    - Rocket Lake display additions
    - Disable FBC on Tigerlake
    - Tigerlake Type-C + DP improvements
    - Hotplug interrupt refactoring

    amdgpu:
    - Sienna Cichlid updates
    - Navy Flounder updates
    - DCE6 (SI) support for DC
    - Plane rotation enabled
    - TMZ state info ioctl
    - PCIe DPC recovery support
    - DC interrupt handling refactor
    - OLED panel fixes

    amdkfd:
    - add SMI events for thermal throttling
    - SMI interface events ioctl update
    - process eviction counters

    radeon:
    - move to dma_ for allocations
    - expose sclk via sysfs

    msm:
    - DSI support for sm8150/sm8250
    - per-process GPU pagetable support
    - Displayport support

    mediatek:
    - move HDMI phy driver to PHY
    - convert mtk-dpi to bridge API
    - disable mt2701 tmds

    tegra:
    - bridge support

    exynos:
    - misc cleanups

    vc4:
    - dual display cleanups

    ast:
    - cleanups

    gma500:
    - conversion to GPIOd API

    hisilicon:
    - misc reworks

    ingenic:
    - clock handling and format improvements

    mcde:
    - DSI support

    mgag200:
    - desktop g200 support

    mxsfb:
    - i.MX7 + i.MX8M
    - alpha plane support

    panfrost:
    - devfreq support
    - amlogic SoC support

    ps8640:
    - EDID from eDP retrieval

    tidss:
    - AM65xx YUV workaround

    virtio:
    - virtio-gpu exported resources

    rcar-du:
    - R8A7742, R8A774E1 and R8A77961 support
    - YUV planar format fixes
    - non-visible plane handling
    - VSP device reference count fix
    - Kconfig fix to avoid displaying disabled options in .config"

    * tag 'drm-next-2020-10-15' of git://anongit.freedesktop.org/drm/drm: (1494 commits)
    drm/ingenic: Fix bad revert
    drm/amdgpu: Fix invalid number of character '{' in amdgpu_acpi_init
    drm/amdgpu: Remove warning for virtual_display
    drm/amdgpu: kfd_initialized can be static
    drm/amd/pm: setup APU dpm clock table in SMU HW initialization
    drm/amdgpu: prevent spurious warning
    drm/amdgpu/swsmu: fix ARC build errors
    drm/amd/display: Fix OPTC_DATA_FORMAT programming
    drm/amd/display: Don't allow pstate if no support in blank
    drm/panfrost: increase readl_relaxed_poll_timeout values
    MAINTAINERS: Update entry for st7703 driver after the rename
    Revert "gpu/drm: ingenic: Add option to mmap GEM buffers cached"
    drm/amd/display: HDMI remote sink need mode validation for Linux
    drm/amd/display: Change to correct unit on audio rate
    drm/amd/display: Avoid set zero in the requested clk
    drm/amdgpu: align frag_end to covered address space
    drm/amdgpu: fix NULL pointer dereference for Renoir
    drm/vmwgfx: fix regression in thp code due to ttm init refactor.
    drm/amdgpu/swsmu: add interrupt work handler for smu11 parts
    drm/amdgpu/swsmu: add interrupt work function
    ...

    Linus Torvalds
     
  • Pull char/misc driver updates from Greg KH:
    "Here is the big set of char, misc, and other assorted driver subsystem
    patches for 5.10-rc1.

    There's a lot of different things in here, all over the drivers/
    directory. Some summaries:

    - soundwire driver updates

    - habanalabs driver updates

    - extcon driver updates

    - nitro_enclaves new driver

    - fsl-mc driver and core updates

    - mhi core and bus updates

    - nvmem driver updates

    - eeprom driver updates

    - binder driver updates and fixes

    - vbox minor bugfixes

    - fsi driver updates

    - w1 driver updates

    - coresight driver updates

    - interconnect driver updates

    - misc driver updates

    - other minor driver updates

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

    * tag 'char-misc-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (396 commits)
    binder: fix UAF when releasing todo list
    docs: w1: w1_therm: Fix broken xref, mistakes, clarify text
    misc: Kconfig: fix a HISI_HIKEY_USB dependency
    LSM: Fix type of id parameter in kernel_post_load_data prototype
    misc: Kconfig: add a new dependency for HISI_HIKEY_USB
    firmware_loader: fix a kernel-doc markup
    w1: w1_therm: make w1_poll_completion static
    binder: simplify the return expression of binder_mmap
    test_firmware: Test partial read support
    firmware: Add request_partial_firmware_into_buf()
    firmware: Store opt_flags in fw_priv
    fs/kernel_file_read: Add "offset" arg for partial reads
    IMA: Add support for file reads without contents
    LSM: Add "contents" flag to kernel_read_file hook
    module: Call security_kernel_post_load_data()
    firmware_loader: Use security_post_load_data()
    LSM: Introduce kernel_post_load_data() hook
    fs/kernel_read_file: Add file_size output argument
    fs/kernel_read_file: Switch buffer size arg to size_t
    fs/kernel_read_file: Remove redundant size argument
    ...

    Linus Torvalds
     

15 Oct, 2020

1 commit

  • Pull kernel_clone() updates from Christian Brauner:
    "During the v5.9 merge window we reworked the process creation
    codepaths across multiple architectures. After this work we were only
    left with the _do_fork() helper based on the struct kernel_clone_args
    calling convention. As was pointed out _do_fork() isn't valid
    kernelese especially for a helper that isn't just static.

    This series removes the _do_fork() helper and introduces the new
    kernel_clone() helper. The process creation cleanup didn't change the
    name to something more reasonable mainly because _do_fork() was used
    in quite a few places. So sending this as a separate series seemed the
    better strategy.

    I originally intended to send this early in the v5.9 development cycle
    after the merge window had closed but given that this was touching
    quite a few places I decided to defer this until the v5.10 merge
    window"

    * tag 'kernel-clone-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
    sched: remove _do_fork()
    tracing: switch to kernel_clone()
    kgdbts: switch to kernel_clone()
    kprobes: switch to kernel_clone()
    x86: switch to kernel_clone()
    sparc: switch to kernel_clone()
    nios2: switch to kernel_clone()
    m68k: switch to kernel_clone()
    ia64: switch to kernel_clone()
    h8300: switch to kernel_clone()
    fork: introduce kernel_clone()

    Linus Torvalds
     

14 Oct, 2020

1 commit

  • kmemleak-test.c is just a kmemleak test module, which also can not be used
    as a built-in kernel module. Thus, i think it may should not be in mm
    dir, and move the kmemleak-test.c to samples/kmemleak/kmemleak-test.c.
    Fix the spelling of built-in by the way.

    Signed-off-by: Hui Su
    Signed-off-by: Andrew Morton
    Cc: Catalin Marinas
    Cc: Jonathan Corbet
    Cc: Mauro Carvalho Chehab
    Cc: David S. Miller
    Cc: Rob Herring
    Cc: Masahiro Yamada
    Cc: Sam Ravnborg
    Cc: Josh Poimboeuf
    Cc: Steven Rostedt (VMware)
    Cc: Miguel Ojeda
    Cc: Divya Indi
    Cc: Tomas Winkler
    Cc: David Howells
    Link: https://lkml.kernel.org/r/20200925183729.GA172837@rlk
    Signed-off-by: Linus Torvalds

    Hui Su
     

13 Oct, 2020

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "As hoped, things calmed down for docs this cycle; fewer changes and
    almost no conflicts at all. This includes:

    - A reworked and expanded user-mode Linux document

    - Some simplifications and improvements for submitting-patches.rst

    - An emergency fix for (some) problems with Sphinx 3.x

    - Some welcome automarkup improvements to automatically generate
    cross-references to struct definitions and other documents

    - The usual collection of translation updates, typo fixes, etc"

    * tag 'docs-5.10' of git://git.lwn.net/linux: (81 commits)
    gpiolib: Update indentation in driver.rst for code excerpts
    Documentation/admin-guide: tainted-kernels: Fix typo occured
    Documentation: better locations for sysfs-pci, sysfs-tagging
    docs: programming-languages: refresh blurb on clang support
    Documentation: kvm: fix a typo
    Documentation: Chinese translation of Documentation/arm64/amu.rst
    doc: zh_CN: index files in arm64 subdirectory
    mailmap: add entry for
    doc: seq_file: clarify role of *pos in ->next()
    docs: trace: ring-buffer-design.rst: use the new SPDX tag
    Documentation: kernel-parameters: clarify "module." parameters
    Fix references to nommu-mmap.rst
    docs: rewrite admin-guide/sysctl/abi.rst
    docs: fb: Remove vesafb scrollback boot option
    docs: fb: Remove sstfb scrollback boot option
    docs: fb: Remove matroxfb scrollback boot option
    docs: fb: Remove framebuffer scrollback boot option
    docs: replace the old User Mode Linux HowTo with a new one
    Documentation/admin-guide: blockdev/ramdisk: remove use of "rdev"
    Documentation/admin-guide: README & svga: remove use of "rdev"
    ...

    Linus Torvalds
     

12 Oct, 2020

3 commits

  • Most of the samples were converted to use the new BTF-defined MAP as
    they moved to libbpf, but some of the samples were missing.

    Instead of using the previous BPF MAP definition, this commit refactors
    xdp_monitor and xdp_sample_pkts_kern MAP definition with the new
    BTF-defined MAP format.

    Also, this commit removes the max_entries attribute at PERF_EVENT_ARRAY
    map type. The libbpf's bpf_object__create_map() will automatically
    set max_entries to the maximum configured number of CPUs on the host.

    Signed-off-by: Daniel T. Lee
    Signed-off-by: Alexei Starovoitov
    Acked-by: Andrii Nakryiko
    Link: https://lore.kernel.org/bpf/20201010181734.1109-4-danieltimlee@gmail.com

    Daniel T. Lee
     
  • >From commit d7a18ea7e8b6 ("libbpf: Add generic bpf_program__attach()"),
    for some BPF programs, it is now possible to attach BPF programs
    with __attach() instead of explicitly calling __attach_().

    This commit refactors the __attach_tracepoint() with libbpf's generic
    __attach() method. In addition, this refactors the logic of setting
    the map FD to simplify the code. Also, the missing removal of
    bpf_load.o in Makefile has been fixed.

    Signed-off-by: Daniel T. Lee
    Signed-off-by: Alexei Starovoitov
    Acked-by: Andrii Nakryiko
    Link: https://lore.kernel.org/bpf/20201010181734.1109-3-danieltimlee@gmail.com

    Daniel T. Lee
     
  • To avoid confusion caused by the increasing fragmentation of the BPF
    Loader program, this commit would like to change to the libbpf loader
    instead of using the bpf_load.

    Thanks to libbpf's bpf_link interface, managing the tracepoint BPF
    program is much easier. bpf_program__attach_tracepoint manages the
    enable of tracepoint event and attach of BPF programs to it with a
    single interface bpf_link, so there is no need to manage event_fd and
    prog_fd separately.

    This commit refactors xdp_monitor with using this libbpf API, and the
    bpf_load is removed and migrated to libbpf.

    Signed-off-by: Daniel T. Lee
    Signed-off-by: Alexei Starovoitov
    Acked-by: Andrii Nakryiko
    Link: https://lore.kernel.org/bpf/20201010181734.1109-2-danieltimlee@gmail.com

    Daniel T. Lee
     

07 Oct, 2020

13 commits

  • pr_*() printing helpers are preferred over using bare printk().

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Christoph Hellwig

    Bartosz Golaszewski
     
  • The copyright notice alarms checkpatch.pl of usin spaces before tabs.
    Fix this.

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Christoph Hellwig

    Bartosz Golaszewski
     
  • Move local variables of the same type into a single line for better
    readability.

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Christoph Hellwig

    Bartosz Golaszewski
     
  • The structure containing the storeme field is allocated using kzalloc().
    There's no need to set it to 0 again.

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Christoph Hellwig

    Bartosz Golaszewski
     
  • simple_strtoul() is deprecated. Use kstrtoint().

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Christoph Hellwig

    Bartosz Golaszewski
     
  • Aling the assignment of a static structure's field to be consistent with
    all other instances.

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Christoph Hellwig

    Bartosz Golaszewski
     
  • Checking pointers for NULL value before passing them to container_of()
    is pointless because even if we return NULL from the ternary operator,
    none of the users checks the returned value but they instead dereference
    it unconditionally. AFAICT this cannot really happen either. Simplify
    the code by removing the ternary operators from to_childless() et al.

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Christoph Hellwig

    Bartosz Golaszewski
     
  • There's no need for suplemental newlines in the source file - especially
    since the examples are well divided with comments already.

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Christoph Hellwig

    Bartosz Golaszewski
     
  • Add an option to count the number of interrupts generated per second and
    total number of interrupts during the lifetime of the application for a
    given interface. This information is extracted from /proc/interrupts. Since
    there is no naming convention across drivers, the user must provide the
    string which is specific to their interface in the /proc/interrupts file on
    the command line.

    Usage:

    ./xdpsock ... -I

    eg. for queue 0 of i40e device eth0:

    ./xdpsock ... -I i40e-eth0-TxRx-0

    Signed-off-by: Ciara Loftus
    Signed-off-by: Alexei Starovoitov
    Link: https://lore.kernel.org/bpf/20201002133612.31536-3-ciara.loftus@intel.com

    Ciara Loftus
     
  • Categorise and record syscalls issued in the xdpsock sample app. The
    categories recorded are:

    rx_empty_polls: polls when the rx ring is empty
    fill_fail_polls: polls when failed to get addr from fill ring
    copy_tx_sendtos: sendtos issued for tx when copy mode enabled
    tx_wakeup_sendtos: sendtos issued when tx ring needs waking up
    opt_polls: polls issued since the '-p' flag is set

    Print the stats using '-a' on the xdpsock command line.

    Signed-off-by: Ciara Loftus
    Signed-off-by: Alexei Starovoitov
    Acked-by: Yonghong Song
    Link: https://lore.kernel.org/bpf/20201002133612.31536-2-ciara.loftus@intel.com

    Ciara Loftus
     
  • New statistics will be added in future commits. In preparation for this,
    let's split out the existing statistics into their own struct.

    Signed-off-by: Ciara Loftus
    Signed-off-by: Alexei Starovoitov
    Acked-by: Yonghong Song
    Link: https://lore.kernel.org/bpf/20201002133612.31536-1-ciara.loftus@intel.com

    Ciara Loftus
     
  • Compiling samples/bpf hits an error related to fallthrough marking.
    ...
    CC samples/bpf/hbm.o
    samples/bpf/hbm.c: In function ‘main’:
    samples/bpf/hbm.c:486:4: error: ‘fallthrough’ undeclared (first use in this function)
    fallthrough;
    ^~~~~~~~~~~

    The "fallthrough" is not defined under tools/include directory.
    Rather, it is "__fallthrough" is defined in linux/compiler.h.
    Including "linux/compiler.h" and using "__fallthrough" fixed the issue.

    Signed-off-by: Yonghong Song
    Signed-off-by: Alexei Starovoitov
    Link: https://lore.kernel.org/bpf/20201006043427.1891805-1-yhs@fb.com

    Yonghong Song
     
  • With latest llvm trunk, bpf programs under samples/bpf
    directory, if using CORE, may experience the following
    errors:

    LLVM ERROR: Cannot select: intrinsic %llvm.preserve.struct.access.index
    PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
    Stack dump:
    0. Program arguments: llc -march=bpf -filetype=obj -o samples/bpf/test_probe_write_user_kern.o
    1. Running pass 'Function Pass Manager' on module ''.
    2. Running pass 'BPF DAG->DAG Pattern Instruction Selection' on function '@bpf_prog1'
    #0 0x000000000183c26c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
    (/data/users/yhs/work/llvm-project/llvm/build.cur/install/bin/llc+0x183c26c)
    ...
    #7 0x00000000017c375e (/data/users/yhs/work/llvm-project/llvm/build.cur/install/bin/llc+0x17c375e)
    #8 0x00000000016a75c5 llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*)
    (/data/users/yhs/work/llvm-project/llvm/build.cur/install/bin/llc+0x16a75c5)
    #9 0x00000000016ab4f8 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*,
    unsigned int) (/data/users/yhs/work/llvm-project/llvm/build.cur/install/bin/llc+0x16ab4f8)
    ...
    Aborted (core dumped) | llc -march=bpf -filetype=obj -o samples/bpf/test_probe_write_user_kern.o

    The reason is due to llvm change https://reviews.llvm.org/D87153
    where the CORE relocation global generation is moved from the beginning
    of target dependent optimization (llc) to the beginning
    of target independent optimization (opt).

    Since samples/bpf programs did not use vmlinux.h and its clang compilation
    uses native architecture, we need to adjust arch triple at opt level
    to do CORE relocation global generation properly. Otherwise, the above
    error will appear.

    This patch fixed the issue by introduce opt and llvm-dis to compilation chain,
    which will do proper CORE relocation global generation as well as O2 level
    optimization. Tested with llvm10, llvm11 and trunk/llvm12.

    Signed-off-by: Yonghong Song
    Signed-off-by: Alexei Starovoitov
    Acked-by: Andrii Nakryiko
    Link: https://lore.kernel.org/bpf/20201006043427.1891742-1-yhs@fb.com

    Yonghong Song
     

02 Oct, 2020

2 commits

  • Since struct _mic_vring_info and vring are allocated together and follow
    vring, if the vring_size() is not four bytes aligned, which will cause
    the start address of struct _mic_vring_info is not four byte aligned.
    For example, when vring entries is 128, the vring_size() will be 5126
    bytes. The _mic_vring_info struct layout in ddr looks like:
    0x90002400: 00000000 00390000 EE010000 0000C0FF
    Here 0x39 is the avail_idx member, and 0xC0FFEE01 is the magic member.

    When EP use ioread32(magic) to reads the magic in RC's share memory, it
    will cause kernel panic on ARM64 platform due to the cross-byte io read.
    Here read magic in user space use le32toh(vr0->info->magic) will meet
    the same issue.
    So add round_up(x,4) for vring_size, then the struct _mic_vring_info
    will store in this way:
    0x90002400: 00000000 00000000 00000039 C0FFEE01
    Which will avoid kernel panic when read magic in struct _mic_vring_info.

    Signed-off-by: Sherry Sun
    Signed-off-by: Joakim Zhang
    Link: https://lore.kernel.org/r/20200929091106.24624-4-sherry.sun@nxp.com
    Signed-off-by: Greg Kroah-Hartman

    Sherry Sun
     
  • If enable DEBUG, will meet the following errors when build mpssd, so fix
    them here. Only one error is listed here, other errors are similar.

    mpssd.c: In function ‘virtio_net’:
    mpssd.c:615:21: error: incompatible type for argument 2 of ‘disp_iovec’
    disp_iovec(mic, copy, __func__, __LINE__);
    ^~~~
    mpssd.c:361:1: note: expected ‘struct mic_copy_desc *’ but argument is of type ‘struct mic_copy_desc’
    disp_iovec(struct mic_info *mic, struct mic_copy_desc *copy,
    ^~~~~~~~~~

    Signed-off-by: Sherry Sun
    Link: https://lore.kernel.org/r/20200925071831.8025-2-sherry.sun@nxp.com
    Signed-off-by: Greg Kroah-Hartman

    Sherry Sun
     

01 Oct, 2020

1 commit


24 Sep, 2020

1 commit

  • Alexei Starovoitov says:

    ====================
    pull-request: bpf-next 2020-09-23

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

    We've added 95 non-merge commits during the last 22 day(s) which contain
    a total of 124 files changed, 4211 insertions(+), 2040 deletions(-).

    The main changes are:

    1) Full multi function support in libbpf, from Andrii.

    2) Refactoring of function argument checks, from Lorenz.

    3) Make bpf_tail_call compatible with functions (subprograms), from Maciej.

    4) Program metadata support, from YiFei.

    5) bpf iterator optimizations, from Yonghong.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

22 Sep, 2020

1 commit

  • Add a user space sample for the usage of the ioctl interface provided by
    the Nitro Enclaves driver.

    Changelog

    v9 -> v10

    * Update commit message to include the changelog before the SoB tag(s).

    v8 -> v9

    * No changes.

    v7 -> v8

    * Track NE custom error codes for invalid page size, invalid flags and
    enclave CID.
    * Update the heartbeat logic to have a listener fd first, then start the
    enclave and then accept connection to get the heartbeat.
    * Update the reference link to the hugetlb documentation.

    v6 -> v7

    * Track POLLNVAL as poll event in addition to POLLHUP.

    v5 -> v6

    * Remove "rc" mentioning when printing errno string.
    * Remove the ioctl to query API version.
    * Include usage info for NUMA-aware hugetlb configuration.
    * Update documentation to kernel-doc format.
    * Add logic for enclave image loading.

    v4 -> v5

    * Print enclave vCPU ids when they are created.
    * Update logic to map the modified vCPU ioctl call.
    * Add check for the path to the enclave image to be less than PATH_MAX.
    * Update the ioctl calls error checking logic to match the NE specific
    error codes.

    v3 -> v4

    * Update usage details to match the updates in v4.
    * Update NE ioctl interface usage.

    v2 -> v3

    * Remove the include directory to use the uapi from the kernel.
    * Remove the GPL additional wording as SPDX-License-Identifier is
    already in place.

    v1 -> v2

    * New in v2.

    Reviewed-by: Alexander Graf
    Signed-off-by: Alexandru Vasile
    Signed-off-by: Andra Paraschiv
    Link: https://lore.kernel.org/r/20200921121732.44291-17-andraprs@amazon.com
    Signed-off-by: Greg Kroah-Hartman

    Andra Paraschiv
     

19 Sep, 2020

1 commit

  • s390 uses socketcall multiplexer instead of individual socket syscalls.
    Therefore, "kprobe/" SYSCALL(sys_connect) does not trigger and
    test_map_in_map fails. Fix by using "kprobe/__sys_connect" instead.

    Signed-off-by: Ilya Leoshkevich
    Signed-off-by: Daniel Borkmann
    Acked-by: Andrii Nakryiko
    Link: https://lore.kernel.org/bpf/20200915115519.3769807-1-iii@linux.ibm.com

    Ilya Leoshkevich
     

17 Sep, 2020

1 commit


15 Sep, 2020

2 commits

  • Add a quiet option (-Q) that disables the statistics print outs of
    xdpsock. This is good to have when measuring 0% loss rate performance
    as it will be quite terrible if the application uses printfs.

    Signed-off-by: Magnus Karlsson
    Signed-off-by: Alexei Starovoitov
    Link: https://lore.kernel.org/bpf/1599726666-8431-4-git-send-email-magnus.karlsson@gmail.com

    Magnus Karlsson
     
  • Fix a possible deadlock in the l2fwd application in xdpsock that can
    occur when there is no space in the Tx ring. There are two ways to get
    the kernel to consume entries in the Tx ring: calling sendto() to make
    it send packets and freeing entries from the completion ring, as the
    kernel will not send a packet if there is no space for it to add a
    completion entry in the completion ring. The Tx loop in l2fwd only
    used to call sendto(). This patches adds cleaning the completion ring
    in that loop.

    Signed-off-by: Magnus Karlsson
    Signed-off-by: Alexei Starovoitov
    Link: https://lore.kernel.org/bpf/1599726666-8431-3-git-send-email-magnus.karlsson@gmail.com

    Magnus Karlsson