1. 23 Jun, 2023 2 commits
    • Damien Le Moal's avatar
      PCI: endpoint: Automatically create a function specific attributes group · 70b3740f
      Damien Le Moal authored
      A PCI endpoint function driver can define function specific attributes
      under its function configfs directory using the add_cfs() endpoint driver
      operation. This is done by tying up the mkdir operation for the function
      configfs directory to a call to the add_cfs() operation.  However, there
      are no checks preventing the user from repeatedly creating function
      specific attribute directories with different names, resulting in the same
      endpoint specific attributes group being added multiple times, which also
      result in an invalid reference counting for the attribute groups. E.g.,
      using the pci-epf-ntb function driver as an example, the user creates the
      function as follows:
      
        $ modprobe pci-epf-ntb
        $ cd /sys/kernel/config/pci_ep/functions/pci_epf_ntb
        $ mkdir func0
        $ tree func0
        func0/
        |-- baseclass_code
        |-- cache_line_size
        |-- ...
        `-- vendorid
      
        $ mkdir func0/attrs
        $ tree func0
        func0/
        |-- attrs
        |   |-- db_count
        |   |-- mw1
        |   |-- mw2
        |   |-- mw3
        |   |-- mw4
        |   |-- num_mws
        |   `-- spad_count
        |-- baseclass_code
        |-- cache_line_size
        |-- ...
        `-- vendorid
      
      At this point, the function can be started by linking the EP controller.
      However, if the user mistakenly creates again a directory:
      
        $ mkdir func0/attrs2
        $ tree func0
        func0/
        |-- attrs
        |   |-- db_count
        |   |-- mw1
        |   |-- mw2
        |   |-- mw3
        |   |-- mw4
        |   |-- num_mws
        |   `-- spad_count
        |-- attrs2
        |   |-- db_count
        |   |-- mw1
        |   |-- mw2
        |   |-- mw3
        |   |-- mw4
        |   |-- num_mws
        |   `-- spad_count
        |-- baseclass_code
        |-- cache_line_size
        |-- ...
        `-- vendorid
      
      The endpoint function specific attributes are duplicated and cause a crash
      when the endpoint function device is torn down:
      
        refcount_t: addition on 0; use-after-free.
        WARNING: CPU: 2 PID: 834 at lib/refcount.c:25 refcount_warn_saturate+0xc8/0x144
        CPU: 2 PID: 834 Comm: rmdir Not tainted 6.3.0-rc1 #1
        Hardware name: Pine64 RockPro64 v2.1 (DT)
        pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
        ...
        Call trace:
        refcount_warn_saturate+0xc8/0x144
        config_item_get+0x7c/0x80
        configfs_rmdir+0x17c/0x30c
        vfs_rmdir+0x8c/0x204
        do_rmdir+0x158/0x184
        __arm64_sys_unlinkat+0x64/0x80
        invoke_syscall+0x48/0x114
        ...
      
      Fix this by modifying pci_epf_cfs_work() to execute the new function
      pci_ep_cfs_add_type_group() which itself calls pci_epf_type_add_cfs() to
      obtain the function specific attribute group and the group name (directory
      name) from the endpoint function driver. If the function driver defines an
      attribute group, pci_ep_cfs_add_type_group() then proceeds to register this
      group using configfs_register_group(), thus automatically exposing the
      function type specific configfs attributes to the user. E.g.:
      
        $ modprobe pci-epf-ntb
        $ cd /sys/kernel/config/pci_ep/functions/pci_epf_ntb
        $ mkdir func0
        $ tree func0
        func0/
        |-- baseclass_code
        |-- cache_line_size
        |-- ...
        |-- pci_epf_ntb.0
        |   |-- db_count
        |   |-- mw1
        |   |-- mw2
        |   |-- mw3
        |   |-- mw4
        |   |-- num_mws
        |   `-- spad_count
        |-- primary
        |-- ...
        `-- vendorid
      
      With this change, there is no need for the user to create or delete
      directories in the endpoint function attributes directory. The
      pci_epf_type_group_ops group operations are thus removed.
      
      Also update the documentation for the pci-epf-ntb and pci-epf-vntb function
      drivers to reflect this change, removing the explanations showing the need
      to manually create the sub-directory for the function specific attributes.
      
      Link: https://lore.kernel.org/r/20230415023542.77601-2-dlemoal@kernel.org
      
      Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
      Signed-off-by: default avatarLorenzo Pieralisi <lpieralisi@kernel.org>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarManivannan Sadhasivam <mani@kernel.org>
      70b3740f
    • Shunsuke Mie's avatar
      PCI: endpoint: Fix a Kconfig prompt of vNTB driver · 37587673
      Shunsuke Mie authored
      vNTB driver and NTB driver have same Kconfig prompt. Changed to make it
      distinguishable.
      
      Link: https://lore.kernel.org/r/20230202103832.2038286-1-mie@igel.co.jp
      Fixes: e35f56bb
      
       ("PCI: endpoint: Support NTB transfer between RC and EP")
      Signed-off-by: default avatarShunsuke Mie <mie@igel.co.jp>
      Signed-off-by: default avatarLorenzo Pieralisi <lpieralisi@kernel.org>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarManivannan Sadhasivam <mani@kernel.org>
      37587673
  2. 07 May, 2023 8 commits
    • Linus Torvalds's avatar
      Linux 6.4-rc1 · ac9a7868
      Linus Torvalds authored
      ac9a7868
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-for-v6.4-3-2023-05-06' of... · f085df1b
      Linus Torvalds authored
      Merge tag 'perf-tools-for-v6.4-3-2023-05-06' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tool updates from Arnaldo Carvalho de Melo:
       "Third version of perf tool updates, with the build problems with with
        using a 'vmlinux.h' generated from the main build fixed, and the bpf
        skeleton build disabled by default.
      
        Build:
      
         - Require libtraceevent to build, one can disable it using
           NO_LIBTRACEEVENT=1.
      
           It is required for tools like 'perf sched', 'perf kvm', 'perf
           trace', etc.
      
           libtraceevent is available in most distros so installing
           'libtraceevent-devel' should be a one-time event to continue
           building perf as usual.
      
           Using NO_LIBTRACEEVENT=1 produces tooling that is functional and
           sufficient for lots of users not interested in those libtraceevent
           dependent features.
      
         - Allow Python support in 'perf script' when libtraceevent isn't
           linked, as not all features requires it, for instance Intel PT does
           not use tracepoints.
      
       ...
      f085df1b
    • Linus Torvalds's avatar
      Merge tag 'core-debugobjects-2023-05-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 17784de6
      Linus Torvalds authored
      Pull debugobjects fix from Thomas Gleixner:
       "A single fix for debugobjects:
      
        The recent fix to ensure atomicity of lookup and allocation
        inadvertently broke the pool refill mechanism, so that debugobject
        OOMs now in certain situations. The reason is that the functions which
        got updated no longer invoke debug_objecs_init(), which is now the
        only place to care about refilling the tracking object pool.
      
        Restore the original behaviour by adding explicit refill opportunities
        to those places"
      
      * tag 'core-debugobjects-2023-05-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        debugobject: Ensure pool refill (again)
      17784de6
    • Linus Torvalds's avatar
      Merge tag 'v6.4-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 6f69c981
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
      
       - A long-standing bug in crypto_engine
      
       - A buggy but harmless check in the sun8i-ss driver
      
       - A regression in the CRYPTO_USER interface
      
      * tag 'v6.4-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: api - Fix CRYPTO_USER checks for report function
        crypto: engine - fix crypto_queue backlog handling
        crypto: sun8i-ss - Fix a test in sun8i_ss_setup_ivs()
      6f69c981
    • Linus Torvalds's avatar
      Merge tag '6.4-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 · 63342b1d
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "smb3 client fixes, mostly DFS or reconnect related:
      
         - Two DFS connection sharing fixes
      
         - DFS refresh fix
      
         - Reconnect fix
      
         - Two potential use after free fixes
      
         - Also print prefix patch in mount debug msg
      
         - Two small cleanup fixes"
      
      * tag '6.4-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: Remove unneeded semicolon
        cifs: fix sharing of DFS connections
        cifs: avoid potential races when handling multiple dfs tcons
        cifs: protect access of TCP_Server_Info::{origin,leaf}_fullpath
        cifs: fix potential race when tree connecting ipc
        cifs: fix potential use-after-free bugs in TCP_Server_Info::hostname
        cifs: print smb3_fs_context::source when mounting
        cifs: protect session status check in smb2_reconnect()
        SMB3.1.1: correct definition for app_instance_id create contexts
      63342b1d
    • Linus Torvalds's avatar
      Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · d6b8a8c4
      Linus Torvalds authored
      Pull clk fixes from Stephen Boyd:
       "A couple more patches that would be good to get into -rc1:
      
         - Revert an i.MX patch that's causing video failures because division
           math goes sideways
      
         - Fix a clang + W=1 build isue where FIELD_PREP() is taking a 32-bit
           variable instead of the usual u64 type
      
         - Fix a Kconfig bug in the StarFive JH7110 clk config that selects a
           reset controller when it can't be selected"
      
      * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: starfive: Fix RESET_STARFIVE_JH7110 can't be selected in a specified case
        clk: sp7021: Adjust width of _m in HWM_FIELD_PREP()
        Revert "clk: imx: composite-8m: Add support to determine_rate"
      d6b8a8c4
    • Linus Torvalds's avatar
      Merge tag 'mailbox-v6.4' of git://git.linaro.org/landing-teams/working/fujitsu/integration · 1c1094e4
      Linus Torvalds authored
      Pull mailbox updates from Jassi Brar:
      
       - mailbox api: allow direct registration to a channel and convert omap
         and pcc to use mbox_bind_client
      
       - omap and hi6220 : use of_property_read_bool
      
       - test: fix double-free and use spinlock header
      
       - rockchip and bcm-pdc: drop of_match_ptr
      
       - mpfs: change config symbol
      
       - mediatek gce: support MT6795
      
       - qcom apcs: consolidate of_device_id and support IPQ9574
      
      * tag 'mailbox-v6.4' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
        dt-bindings: mailbox: qcom: add compatible for IPQ9574 SoC
        mailbox: qcom-apcs-ipc: do not grow the of_device_id
        dt-bindings: mailbox: qcom,apcs-kpss-global: use fallbacks for few variants
        dt-bindings: mailbox: mediatek,gce-mailbox: Add support for MT6795
        mailbox: mpfs: convert SOC_MICROCHIP_POLARFIRE to ARCH_MICROCHIP_POLARFIRE
        mailbox: bcm-pdc: drop of_match_ptr for ID table
        mailbox: rockchip: drop of_match_pt...
      1c1094e4
    • Linus Torvalds's avatar
      Merge tag 'for-6.4/io_uring-2023-05-07' of git://git.kernel.dk/linux · 03e5cb7b
      Linus Torvalds authored
      Pull more io_uring updates from Jens Axboe:
       "Nothing major in here, just two different parts:
      
         - A small series from Breno that enables passing the full SQE down
           for ->uring_cmd().
      
           This is a prerequisite for enabling full network socket operations.
           Queued up a bit late because of some stylistic concerns that got
           resolved, would be nice to have this in 6.4-rc1 so the dependent
           work will be easier to handle for 6.5.
      
         - Fix for the huge page coalescing, which was a regression introduced
           in the 6.3 kernel release (Tobias)"
      
      * tag 'for-6.4/io_uring-2023-05-07' of git://git.kernel.dk/linux:
        io_uring: Remove unnecessary BUILD_BUG_ON
        io_uring: Pass whole sqe to commands
        io_uring: Create a helper to return the SQE size
        io_uring/rsrc: check for nonconsecutive pages
      03e5cb7b
  3. 06 May, 2023 30 commits