Skip to content
  1. Sep 04, 2023
    • Linus Torvalds's avatar
      Merge tag 'phy-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy · db906f0c
      Linus Torvalds authored
      Pull phy updates from Vinod Koul:
       "As usual a couple of new drivers, a bunch of new device support and
        few updates to existing drivers
      
        New Support:
         - Starfive dphy rx, JH7110 usb and pcie support
         - Rockchip rv1126 inno-dsi phy, rk3588 usb and pcie support
         - Qualcomm sa8775p PCIe support, M31 USB PHY driver
         - Samsung Exynos850 usb support
      
        Updates:
         - Mediatek dsi driver clock updates
         - Qualcomm sm8150 combo phy with reworking of qmp pcie driver
         - Xilinx zynqmp runtime PM support"
      
      * tag 'phy-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (83 commits)
        phy: exynos5-usbdrd: Add Exynos850 support
        phy: exynos5-usbdrd: Add 26MHz ref clk support
        phy: exynos5-usbdrd: Make it possible to pass custom phy ops
        dt-bindings: phy: samsung,usb3-drd-phy: Add Exynos850 support
        phy: qcom-qmp-combo: fix clock probing
        phy: qcom-qmp-pcie: support SM8150 PCIe QMP PHYs
        phy: qcom-qmp-pcie: populate offsets configuration
        phy: qcom-qmp-pcie: simplify clock handling
        phy: qcom-qmp-pcie: keep offset tables sorted
        phy: qcom-qmp-pcie: drop ln_shrd from v5_20 config
        dt-bindings: phy: qcom,qmp-pcie: describe SM8150 PCIe PHYs
        dt-bindings: phy: migrate QMP PCIe PHY bindings to qcom,sc8280xp-qmp-pcie-phy.yaml
        phy: fsl-imx8mq-usb: add dev_err_probe if getting vbus failed
        phy: qcom: Introduce M31 USB PHY driver
        dt-bindings: phy: qcom,m31: Document qcom,m31 USB phy
        phy: rockchip: inno-dsidphy: Add rv1126 support
        dt-bindings: phy: rockchip-inno-dsidphy: Document rv1126
        dt-bindings: phy: mediatek,tphy: allow simple nodename pattern
        phy: amlogic: meson-g12a-usb2: fix Wvoid-pointer-to-enum-cast warning
        phy: marvell pxa-usb: fix Wvoid-pointer-to-enum-cast warning
        ...
      db906f0c
    • Linus Torvalds's avatar
      Merge tag 'soundwire-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire · 6e32dfcc
      Linus Torvalds authored
      Pull soundwire updates from Vinod Koul:
       "Device numbering and intel driver changes are main features:
      
         - Core support for soundwire device number allocation
      
         - intel driver updates for adding hw_params for DAI ops, hybrid
           number allocation and power managemnt callback updates
      
         - DT header include changes for subsystem"
      
      * tag 'soundwire-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
        soundwire: intel_ace2x: add DAI hw_params/prepare/hw_free callbacks
        soundwire: intel_auxdevice: add hybrid IDA-based device_number allocation
        soundwire: bus: add callbacks for device_number allocation
        soundwire: extend parameters of new_peripheral_assigned() callback
        soundWire: intel_auxdevice: resume 'sdw-master' on startup and system resume
        soundwire: intel_auxdevice: enable pm_runtime earlier on startup
        soundwire: Explicitly include correct DT includes
      6e32dfcc
    • Linus Torvalds's avatar
      Merge tag 'mtd/for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux · bac8a20f
      Linus Torvalds authored
      Pull MTD updates from Miquel Raynal:
       "Core MTD changes:
         - Use refcount to prevent corruption
         - Call external _get and _put in right order
         - Fix use-after-free in mtd release
         - Explicitly include correct DT includes
         - Clean refcounting with MTD_PARTITIONED_MASTER
         - mtdblock: make warning messages ratelimited
         - dt-bindings: Add SEAMA partition bindings
      
        Device driver changes:
         - Use devm helper functions
         - Fix questionable cast, remove pointless ones.
         - error handling fixes
         - add support for new chip versions
         - update DT bindings
         - misc cleanups - fix typos, whitespace, indentation"
      
      * tag 'mtd/for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (105 commits)
        dt-bindings: mtd: amlogic,meson-nand: drop unneeded quotes
        mtd: spear_smi: Use helper function devm_clk_get_enabled()
        mtd: rawnand: orion: Use helper function devm_clk_get_optional_enabled()
        mtd: rawnand: vf610_nfc: Use helper function devm_clk_get_enabled()
        mtd: rawnand: sunxi: Use helper function devm_clk_get_enabled()
        mtd: rawnand: stm32_fmc2: Use helper function devm_clk_get_enabled()
        mtd: rawnand: mtk: Use helper function devm_clk_get_enabled()
        mtd: rawnand: mpc5121: Use helper function devm_clk_get_enabled()
        mtd: rawnand: lpc32xx_slc: Use helper function devm_clk_get_enabled()
        mtd: rawnand: intel: Use helper function devm_clk_get_enabled()
        mtd: rawnand: fsmc: Use helper function devm_clk_get_enabled()
        mtd: rawnand: arasan: Use helper function devm_clk_get_enabled()
        mtd: rawnand: qcom: Add read/read_start ops in exec_op path
        mtd: rawnand: qcom: Clear buf_count and buf_start in raw read
        mtd: maps: fix -Wvoid-pointer-to-enum-cast warning
        mtd: rawnand: fix -Wvoid-pointer-to-enum-cast warning
        mtd: rawnand: fsmc: handle clk prepare error in fsmc_nand_resume()
        mtd: rawnand: Propagate error and simplify ternary operators for brcmstb_nand_wait_for_completion()
        mtd: rawnand: qcom: Sort includes alphabetically
        mtd: rawnand: qcom: Do not override the error no of submit_descs()
        ...
      bac8a20f
  2. Sep 03, 2023
    • Linus Torvalds's avatar
      Merge tag 'f2fs-for-6-6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs · 92901222
      Linus Torvalds authored
      Pull f2fs updates from Jaegeuk Kim:
       "In this cycle, we don't have a highlighted feature enhancement, but
        mostly have fixed issues mainly in two parts: 1) zoned block device,
        and 2) compression support.
      
        For zoned block device, we've tried to improve the power-off recovery
        flow as much as possible. For compression, we found some corner cases
        caused by wrong compression policy and logics. Other than them, there
        were some reverts and stat corrections.
      
        Bug fixes:
         - use finish zone command when closing a zone
         - check zone type before sending async reset zone command
         - fix to assign compress_level for lz4 correctly
         - fix error path of f2fs_submit_page_read()
         - don't {,de}compress non-full cluster
         - send small discard commands during checkpoint back
         - flush inode if atomic file is aborted
         - correct to account gc/cp stats
      
        And, there are minor bug fixes, avoiding false lockdep warning, and
        clean-ups"
      
      * tag 'f2fs-for-6-6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (25 commits)
        f2fs: use finish zone command when closing a zone
        f2fs: compress: fix to assign compress_level for lz4 correctly
        f2fs: fix error path of f2fs_submit_page_read()
        f2fs: clean up error handling in sanity_check_{compress_,}inode()
        f2fs: avoid false alarm of circular locking
        Revert "f2fs: do not issue small discard commands during checkpoint"
        f2fs: doc: fix description of max_small_discards
        f2fs: should update REQ_TIME for direct write
        f2fs: fix to account cp stats correctly
        f2fs: fix to account gc stats correctly
        f2fs: remove unneeded check condition in __f2fs_setxattr()
        f2fs: fix to update i_ctime in __f2fs_setxattr()
        Revert "f2fs: fix to do sanity check on extent cache correctly"
        f2fs: increase usage of folio_next_index() helper
        f2fs: Only lfs mode is allowed with zoned block device feature
        f2fs: check zone type before sending async reset zone command
        f2fs: compress: don't {,de}compress non-full cluster
        f2fs: allow f2fs_ioc_{,de}compress_file to be interrupted
        f2fs: don't reopen the main block device in f2fs_scan_devices
        f2fs: fix to avoid mmap vs set_compress_option case
        ...
      92901222
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · b89b0293
      Linus Torvalds authored
      Pull SCSI updates from James Bottomley:
       "Updates to the usual drivers (ufs, lpfc, qla2xxx, mpi3mr, libsas) and
        the usual minor updates and bug fixes but no significant core changes"
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (116 commits)
        scsi: storvsc: Handle additional SRB status values
        scsi: libsas: Delete sas_ata_task.retry_count
        scsi: libsas: Delete sas_ata_task.stp_affil_pol
        scsi: libsas: Delete sas_ata_task.set_affil_pol
        scsi: libsas: Delete sas_ssp_task.task_prio
        scsi: libsas: Delete sas_ssp_task.enable_first_burst
        scsi: libsas: Delete sas_ssp_task.retry_count
        scsi: libsas: Delete struct scsi_core
        scsi: libsas: Delete enum sas_phy_type
        scsi: libsas: Delete enum sas_class
        scsi: libsas: Delete sas_ha_struct.lldd_module
        scsi: target: Fix write perf due to unneeded throttling
        scsi: lpfc: Do not abuse UUID APIs and LPFC_COMPRESS_VMID_SIZE
        scsi: pm8001: Remove unused declarations
        scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock
        scsi: elx: sli4: Remove code duplication
        scsi: bfa: Replace one-element array with flexible-array member in struct fc_rscn_pl_s
        scsi: qla2xxx: Remove unused declarations
        scsi: pmcraid: Use pci_dev_id() to simplify the code
        scsi: pm80xx: Set RETFIS when requested by libsas
        ...
      b89b0293
    • Linus Torvalds's avatar
      Merge tag 'probes-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace · b70100f2
      Linus Torvalds authored
      Pull probes updates from Masami Hiramatsu:
      
       - kprobes: use struct_size() for variable size kretprobe_instance data
         structure.
      
       - eprobe: Simplify trace_eprobe list iteration.
      
       - probe events: Data structure field access support on BTF argument.
      
           - Update BTF argument support on the functions in the kernel
             loadable modules (only loaded modules are supported).
      
           - Move generic BTF access function (search function prototype and
             get function parameters) to a separated file.
      
           - Add a function to search a member of data structure in BTF.
      
           - Support accessing BTF data structure member from probe args by
             C-like arrow('->') and dot('.') operators. e.g.
                't sched_switch next=next->pid vruntime=next->se.vruntime'
      
           - Support accessing BTF data structure member from $retval. e.g.
                'f getname_flags%return +0($retval->name):string'
      
           - Add string type checking if BTF type info is available. This will
             reject if user specify ":string" type for non "char pointer"
             type.
      
           - Automatically assume the fprobe event as a function return event
             if $retval is used.
      
       - selftests/ftrace: Add BTF data field access test cases.
      
       - Documentation: Update fprobe event example with BTF data field.
      
      * tag 'probes-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        Documentation: tracing: Update fprobe event example with BTF field
        selftests/ftrace: Add BTF fields access testcases
        tracing/fprobe-event: Assume fprobe is a return event by $retval
        tracing/probes: Add string type check with BTF
        tracing/probes: Support BTF field access from $retval
        tracing/probes: Support BTF based data structure field access
        tracing/probes: Add a function to search a member of a struct/union
        tracing/probes: Move finding func-proto API and getting func-param API to trace_btf
        tracing/probes: Support BTF argument on module functions
        tracing/eprobe: Iterate trace_eprobe directly
        kernel: kprobes: Use struct_size()
      b70100f2
    • Linus Torvalds's avatar
      Merge tag 'trace-v6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace · e021c5f1
      Linus Torvalds authored
      Pull more tracing updates from Steven Rostedt:
       "Tracing fixes and clean ups:
      
         - Replace strlcpy() with strscpy()
      
         - Initialize the pipe cpumask to zero on allocation
      
         - Use within_module() instead of open coding it
      
         - Remove extra space in hwlat_detectory/mode output
      
         - Use LIST_HEAD() instead of open coding it
      
         - A bunch of clean ups and fixes for the cpumask filter
      
         - Set local da_mon_##name to static
      
         - Fix race in snapshot buffer between cpu write and swap"
      
      * tag 'trace-v6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        tracing/filters: Fix coding style issues
        tracing/filters: Change parse_pred() cpulist ternary into an if block
        tracing/filters: Fix double-free of struct filter_pred.mask
        tracing/filters: Fix error-handling of cpulist parsing buffer
        tracing: Zero the pipe cpumask on alloc to avoid spurious -EBUSY
        ftrace: Use LIST_HEAD to initialize clear_hash
        ftrace: Use within_module to check rec->ip within specified module.
        tracing: Replace strlcpy with strscpy in trace/events/task.h
        tracing: Fix race issue between cpu buffer write and swap
        tracing: Remove extra space at the end of hwlat_detector/mode
        rv: Set variable 'da_mon_##name' to static
      e021c5f1
    • Linus Torvalds's avatar
      Merge tag 'pstore-v6.6-rc1-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 82c5561b
      Linus Torvalds authored
      Pull pstore fix from Kees Cook:
      
       - Adjust sizes of buffers just avoid uncompress failures (Ard
         Biesheuvel)
      
      * tag 'pstore-v6.6-rc1-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        pstore: Base compression input buffer size on estimated compressed size
      82c5561b
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2023-09-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · fdde6187
      Linus Torvalds authored
      Pull x86 selftest fix from Ingo Molnar:
       "Fix the __NR_map_shadow_stack syscall-renumbering fallout in the x86
        self-test code.
      
        [ Arguably the existing code was unnecessarily fragile, and tooling
          should have picked up the new syscall number, and a wider fix is
          being worked on - but meanwhile, let's not have the old syscall
          number in the kernel tree. ]"
      
      * tag 'x86-urgent-2023-09-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        selftests/x86: Update map_shadow_stack syscall nr
      fdde6187
    • Linus Torvalds's avatar
      Merge tag 'timers-urgent-2023-09-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a6216978
      Linus Torvalds authored
      Pull timer fix from Ingo Molnar:
       "Fix false positive 'softirq work is pending' messages on -rt kernels,
        caused by a buggy factoring-out of existing code"
      
      * tag 'timers-urgent-2023-09-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        tick/rcu: Fix false positive "softirq work is pending" messages
      a6216978
  3. Sep 02, 2023
    • Linus Torvalds's avatar
      Merge tag 'smp-urgent-2023-09-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 23dfeae8
      Linus Torvalds authored
      Pull CPU hotplug fix from Ingo Molnar:
       "Fix a CPU hotplug related deadlock between the task which initiates
        and controls a CPU hot-unplug operation vs. the CFS bandwidth timer"
      
      * tag 'smp-urgent-2023-09-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        cpu/hotplug: Prevent self deadlock on CPU hot-unplug
      23dfeae8
    • Linus Torvalds's avatar
      Merge tag 'sched-urgent-2023-09-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c39cbc5b
      Linus Torvalds authored
      Pull scheduler fixes from Ingo Molnar:
       "Miscellaneous scheduler fixes: a reporting fix, a static symbol fix,
        and a kernel-doc fix"
      
      * tag 'sched-urgent-2023-09-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/core: Report correct state for TASK_IDLE | TASK_FREEZABLE
        sched/fair: Make update_entity_lag() static
        sched/core: Add kernel-doc for set_cpus_allowed_ptr()
      c39cbc5b
    • Hugh Dickins's avatar
      mm/pagewalk: fix bootstopping regression from extra pte_unmap() · ee40d543
      Hugh Dickins authored
      Mikhail reports early-6.6-based Fedora Rawhide not booting: "rcu_preempt
      detected expedited stalls", minutes wait, and then hung_task splat while
      kworker trying to synchronize_rcu_expedited().  Nothing logged to disk.
      
      He bisected to my 6.6 a349d72f
      
       ("mm/pgtable: add rcu_read_lock() and
      rcu_read_unlock()s"): but the one to blame is my 6.5 commit to fix the
      espfix "bad pmd" warnings when booting x86_64 with CONFIG_EFI_PGT_DUMP=y.
      
      Gaah, that added an "addr >= TASK_SIZE" check to avoid pte_offset_map(),
      but failed to add the equivalent check when choosing to pte_unmap().
      
      It's not a problem on 6.5 (for different reasons, it's harmless on both
      64-bit and 32-bit), but becomes a bootstopper on 6.6 with the unbalanced
      rcu_read_unlock() - RCU has a WARN_ON_ONCE for that, but it would have
      scrolled off Mikhail's console too quickly.
      
      Reported-by: default avatarMikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
      Closes: https://lore.kernel.org/linux-mm/CABXGCsNi8Tiv5zUPNXr6UJw6qV1VdaBEfGqEAMkkXE3QPvZuAQ@mail.gmail.com/
      Fixes: 8b1cb4a2 ("mm/pagewalk: fix EFI_PGT_DUMP of espfix area")
      Fixes: a349d72f
      
       ("mm/pgtable: add rcu_read_lock() and rcu_read_unlock()s")
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Tested-by: default avatarMikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ee40d543
    • Linus Torvalds's avatar
      cgroup: fix build when CGROUP_SCHED is not enabled · 76be05d4
      Linus Torvalds authored
      Sudip Mukherjee reports that the mips sb1250_swarm_defconfig build fails
      with the current kernel.  It isn't actually MIPS-specific, it's just
      that that defconfig does not have CGROUP_SCHED enabled like most configs
      do, and as such shows this error:
      
        kernel/cgroup/cgroup.c: In function 'cgroup_local_stat_show':
        kernel/cgroup/cgroup.c:3699:15: error: implicit declaration of function 'cgroup_tryget_css'; did you mean 'cgroup_tryget'? [-Werror=implicit-function-declaration]
         3699 |         css = cgroup_tryget_css(cgrp, ss);
              |               ^~~~~~~~~~~~~~~~~
              |               cgroup_tryget
        kernel/cgroup/cgroup.c:3699:13: warning: assignment to 'struct cgroup_subsys_state *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
         3699 |         css = cgroup_tryget_css(cgrp, ss);
              |             ^
      
      because cgroup_tryget_css() only exists when CGROUP_SCHED is enabled,
      and the cgroup_local_stat_show() function should similarly be guarded by
      that config option.
      
      Move things around a bit to fix this all.
      
      Fixes: d1d4ff5d
      
       ("cgroup: put cgroup_tryget_css() inside CONFIG_CGROUP_SCHED")
      Reported-by: default avatarSudip Mukherjee <sudipm.mukherjee@gmail.com>
      Cc: Miaohe Lin <linmiaohe@huawei.com>
      Cc: Tejun Heo <tj@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      76be05d4
    • Sudip Mukherjee's avatar
      fbdev/g364fb: fix build failure with mips · 8df0f84c
      Sudip Mukherjee authored
      Fix the typo which resulted in the driver using FB_DEFAULT_IOMEM_HELPERS
      instead of FB_DEFAULT_IOMEM_OPS as the fbdev I/O helpers.
      
      Fixes: 50112608
      
       ("fbdev/g364fb: Use fbdev I/O helpers")
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarSudip Mukherjee <sudipm.mukherjee@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8df0f84c
    • James Bottomley's avatar
      Merge branch 'fixes' into misc · e03843a0
      James Bottomley authored
      e03843a0
    • Valentin Schneider's avatar
      tracing/filters: Fix coding style issues · cbb557ba
      Valentin Schneider authored
      Recent commits have introduced some coding style issues, fix those up.
      
      Link: https://lkml.kernel.org/r/20230901151039.125186-5-vschneid@redhat.com
      
      
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarValentin Schneider <vschneid@redhat.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      cbb557ba
    • Valentin Schneider's avatar
      tracing/filters: Change parse_pred() cpulist ternary into an if block · 2900bcbe
      Valentin Schneider authored
      Review comments noted that an if block would be clearer than a ternary, so
      swap it out.
      
      No change in behaviour intended
      
      Link: https://lkml.kernel.org/r/20230901151039.125186-4-vschneid@redhat.com
      
      
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarValentin Schneider <vschneid@redhat.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      2900bcbe
    • Valentin Schneider's avatar
      tracing/filters: Fix double-free of struct filter_pred.mask · 1caf7adb
      Valentin Schneider authored
      When a cpulist filter is found to contain a single CPU, that CPU is saved
      as a scalar and the backing cpumask storage is freed.
      
      Also NULL the mask to avoid a double-free once we get down to
      free_predicate().
      
      Link: https://lkml.kernel.org/r/20230901151039.125186-3-vschneid@redhat.com
      
      
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Reported-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarValentin Schneider <vschneid@redhat.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      1caf7adb
    • Valentin Schneider's avatar
      tracing/filters: Fix error-handling of cpulist parsing buffer · 9af40584
      Valentin Schneider authored
      parse_pred() allocates a string buffer to parse the user-provided cpulist,
      but doesn't check the allocation result nor does it free the buffer once it
      is no longer needed.
      
      Add an allocation check, and free the buffer as soon as it is no longer
      needed.
      
      Link: https://lkml.kernel.org/r/20230901151039.125186-2-vschneid@redhat.com
      
      
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Reported-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Reported-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: default avatarValentin Schneider <vschneid@redhat.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      9af40584
    • Brian Foster's avatar
      tracing: Zero the pipe cpumask on alloc to avoid spurious -EBUSY · 3d07fa1d
      Brian Foster authored
      The pipe cpumask used to serialize opens between the main and percpu
      trace pipes is not zeroed or initialized. This can result in
      spurious -EBUSY returns if underlying memory is not fully zeroed.
      This has been observed by immediate failure to read the main
      trace_pipe file on an otherwise newly booted and idle system:
      
       # cat /sys/kernel/debug/tracing/trace_pipe
       cat: /sys/kernel/debug/tracing/trace_pipe: Device or resource busy
      
      Zero the allocation of pipe_cpumask to avoid the problem.
      
      Link: https://lore.kernel.org/linux-trace-kernel/20230831125500.986862-1-bfoster@redhat.com
      
      Cc: stable@vger.kernel.org
      Fixes: c2489bb7
      
       ("tracing: Introduce pipe_cpumask to avoid race on trace_pipes")
      Reviewed-by: default avatarZheng Yejian <zhengyejian1@huawei.com>
      Reviewed-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      3d07fa1d
    • Ruan Jinjie's avatar
      ftrace: Use LIST_HEAD to initialize clear_hash · 2a30dbcb
      Ruan Jinjie authored
      Use LIST_HEAD() to initialize clear_hash instead of open-coding it.
      
      Link: https://lore.kernel.org/linux-trace-kernel/20230809071551.913041-1-ruanjinjie@huawei.com
      
      
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarRuan Jinjie <ruanjinjie@huawei.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      2a30dbcb
    • Levi Yun's avatar
      ftrace: Use within_module to check rec->ip within specified module. · 13511489
      Levi Yun authored
      within_module_core && within_module_init condition is same to
      within module but it's more readable.
      
      Use within_module instead of former condition to check rec->ip
      within specified module area or not.
      
      Link: https://lore.kernel.org/linux-trace-kernel/20230803205236.32201-1-ppbuk5246@gmail.com
      
      
      
      Signed-off-by: default avatarLevi Yun <ppbuk5246@gmail.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      13511489
    • Azeem Shaikh's avatar
      tracing: Replace strlcpy with strscpy in trace/events/task.h · 2933d3cd
      Azeem Shaikh authored
      strlcpy() reads the entire source buffer first.
      This read may exceed the destination size limit.
      This is both inefficient and can lead to linear read
      overflows if a source string is not NUL-terminated [1].
      In an effort to remove strlcpy() completely [2], replace
      strlcpy() here with strscpy().
      
      No return values were used, so direct replacement is safe.
      
      [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
      [2] https://github.com/KSPP/linux/issues/89
      
      Link: https://lore.kernel.org/linux-trace-kernel/20230831194212.1529941-1-azeemshaikh38@gmail.com
      
      
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarAzeem Shaikh <azeemshaikh38@gmail.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      2933d3cd
    • Zheng Yejian's avatar
      tracing: Fix race issue between cpu buffer write and swap · 3163f635
      Zheng Yejian authored
      Warning happened in rb_end_commit() at code:
      	if (RB_WARN_ON(cpu_buffer, !local_read(&cpu_buffer->committing)))
      
        WARNING: CPU: 0 PID: 139 at kernel/trace/ring_buffer.c:3142
      	rb_commit+0x402/0x4a0
        Call Trace:
         ring_buffer_unlock_commit+0x42/0x250
         trace_buffer_unlock_commit_regs+0x3b/0x250
         trace_event_buffer_commit+0xe5/0x440
         trace_event_buffer_reserve+0x11c/0x150
         trace_event_raw_event_sched_switch+0x23c/0x2c0
         __traceiter_sched_switch+0x59/0x80
         __schedule+0x72b/0x1580
         schedule+0x92/0x120
         worker_thread+0xa0/0x6f0
      
      It is because the race between writing event into cpu buffer and swapping
      cpu buffer through file per_cpu/cpu0/snapshot:
      
        Write on CPU 0             Swap buffer by per_cpu/cpu0/snapshot on CPU 1
        --------                   --------
                                   tracing_snapshot_write()
                                     [...]
      
        ring_buffer_lock_reserve()
          cpu_buffer = buffer->buffers[cpu]; // 1. Suppose find 'cpu_buffer_a';
          [...]
          rb_reserve_next_event()
            [...]
      
                                     ring_buffer_swap_cpu()
                                       if (local_read(&cpu_buffer_a->committing))
                                           goto out_dec;
                                       if (local_read(&cpu_buffer_b->committing))
                                           goto out_dec;
                                       buffer_a->buffers[cpu] = cpu_buffer_b;
                                       buffer_b->buffers[cpu] = cpu_buffer_a;
                                       // 2. cpu_buffer has swapped here.
      
            rb_start_commit(cpu_buffer);
            if (unlikely(READ_ONCE(cpu_buffer->buffer)
                != buffer)) { // 3. This check passed due to 'cpu_buffer->buffer'
              [...]           //    has not changed here.
              return NULL;
            }
                                       cpu_buffer_b->buffer = buffer_a;
                                       cpu_buffer_a->buffer = buffer_b;
                                       [...]
      
            // 4. Reserve event from 'cpu_buffer_a'.
      
        ring_buffer_unlock_commit()
          [...]
          cpu_buffer = buffer->buffers[cpu]; // 5. Now find 'cpu_buffer_b' !!!
          rb_commit(cpu_buffer)
            rb_end_commit()  // 6. WARN for the wrong 'committing' state !!!
      
      Based on above analysis, we can easily reproduce by following testcase:
        ``` bash
        #!/bin/bash
      
        dmesg -n 7
        sysctl -w kernel.panic_on_warn=1
        TR=/sys/kernel/tracing
        echo 7 > ${TR}/buffer_size_kb
        echo "sched:sched_switch" > ${TR}/set_event
        while [ true ]; do
                echo 1 > ${TR}/per_cpu/cpu0/snapshot
        done &
        while [ true ]; do
                echo 1 > ${TR}/per_cpu/cpu0/snapshot
        done &
        while [ true ]; do
                echo 1 > ${TR}/per_cpu/cpu0/snapshot
        done &
        ```
      
      To fix it, IIUC, we can use smp_call_function_single() to do the swap on
      the target cpu where the buffer is located, so that above race would be
      avoided.
      
      Link: https://lore.kernel.org/linux-trace-kernel/20230831132739.4070878-1-zhengyejian1@huawei.com
      
      Cc: <mhiramat@kernel.org>
      Fixes: f1affcaa
      
       ("tracing: Add snapshot in the per_cpu trace directories")
      Signed-off-by: default avatarZheng Yejian <zhengyejian1@huawei.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      3163f635
    • Mikhail Kobuk's avatar
      tracing: Remove extra space at the end of hwlat_detector/mode · 2cf0dee9
      Mikhail Kobuk authored
      Space is printed after each mode value including the last one:
      $ echo \"$(sudo cat /sys/kernel/tracing/hwlat_detector/mode)\"
      "none [round-robin] per-cpu "
      
      Found by Linux Verification Center (linuxtesting.org) with SVACE.
      
      Link: https://lore.kernel.org/linux-trace-kernel/20230825103432.7750-1-m.kobuk@ispras.ru
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Fixes: 8fa826b7
      
       ("trace/hwlat: Implement the mode config option")
      Signed-off-by: default avatarMikhail Kobuk <m.kobuk@ispras.ru>
      Reviewed-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
      Acked-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      2cf0dee9
    • Yu Liao's avatar
      rv: Set variable 'da_mon_##name' to static · 0e19543b
      Yu Liao authored
      gcc with W=1 reports
      kernel/trace/rv/monitors/wip/wip.c:20:1: sparse: sparse: symbol 'da_mon_wip' was not declared. Should it be static?
      
      The per-cpu variable 'da_mon_##name' is only used in its defining file, so
      it should be static.
      
      Link: https://lore.kernel.org/linux-trace-kernel/20230823020051.3184953-1-liaoyu15@huawei.com
      
      
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: https://lore.kernel.org/oe-kbuild-all/202307280030.7EjUG9gR-lkp@intel.com/
      
      
      Signed-off-by: default avatarYu Liao <liaoyu15@huawei.com>
      Acked-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      0e19543b
    • Linus Torvalds's avatar
      Merge tag 'iommu-updates-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 0468be89
      Linus Torvalds authored
      Pull iommu updates from Joerg Roedel:
       "Core changes:
      
         - Consolidate probe_device path
      
         - Make the PCI-SAC IOVA allocation trick PCI-only
      
        AMD IOMMU:
      
         - Consolidate PPR log handling
      
         - Interrupt handling improvements
      
         - Refcount fixes for amd_iommu_v2 driver
      
        Intel VT-d driver:
      
         - Enable idxd device DMA with pasid through iommu dma ops
      
         - Lift RESV_DIRECT check from VT-d driver to core
      
         - Miscellaneous cleanups and fixes
      
        ARM-SMMU drivers:
      
         - Device-tree binding updates:
            - Add additional compatible strings for Qualcomm SoCs
            - Allow ASIDs to be configured in the DT to work around Qualcomm's
              broken hypervisor
            - Fix clocks for Qualcomm's MSM8998 SoC
      
         - SMMUv2:
            - Support for Qualcomm's legacy firmware implementation featured
              on at least MSM8956 and MSM8976
            - Match compatible strings for Qualcomm SM6350 and SM6375 SoC
              variants
      
         - SMMUv3:
            - Use 'ida' instead of a bitmap for VMID allocation
      
         - Rockchip IOMMU:
            - Lift page-table allocation restrictions on newer hardware
      
         - Mediatek IOMMU:
            - Add MT8188 IOMMU Support
      
         - Renesas IOMMU:
            - Allow PCIe devices
      
        .. and the usual set of cleanups an smaller fixes"
      
      * tag 'iommu-updates-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (64 commits)
        iommu: Explicitly include correct DT includes
        iommu/amd: Remove unused declarations
        iommu/arm-smmu-qcom: Add SM6375 SMMUv2
        iommu/arm-smmu-qcom: Add SM6350 DPU compatible
        iommu/arm-smmu-qcom: Add SM6375 DPU compatible
        iommu/arm-smmu-qcom: Sort the compatible list alphabetically
        dt-bindings: arm-smmu: Fix MSM8998 clocks description
        iommu/vt-d: Remove unused extern declaration dmar_parse_dev_scope()
        iommu/vt-d: Fix to convert mm pfn to dma pfn
        iommu/vt-d: Fix to flush cache of PASID directory table
        iommu/vt-d: Remove rmrr check in domain attaching device path
        iommu: Prevent RESV_DIRECT devices from blocking domains
        dmaengine/idxd: Re-enable kernel workqueue under DMA API
        iommu/vt-d: Add set_dev_pasid callback for dma domain
        iommu/vt-d: Prepare for set_dev_pasid callback
        iommu/vt-d: Make prq draining code generic
        iommu/vt-d: Remove pasid_mutex
        iommu/vt-d: Add domain_flush_pasid_iotlb()
        iommu: Move global PASID allocation from SVA to core
        iommu: Generalize PASID 0 for normal DMA w/o PASID
        ...
      0468be89
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · f7e97ce2
      Linus Torvalds authored
      Pull rdma updates from Jason Gunthorpe:
       "Many small changes across the subystem, some highlights:
      
         - Usual driver cleanups in qedr, siw, erdma, hfi1, mlx4/5, irdma,
           mthca, hns, and bnxt_re
      
         - siw now works over tunnel and other netdevs with a MAC address by
           removing assumptions about a MAC/GID from the connection manager
      
         - "Doorbell Pacing" for bnxt_re - this is a best effort scheme to
           allow userspace to slow down the doorbell rings if the HW gets full
      
         - irdma egress VLAN priority, better QP/WQ sizing
      
         - rxe bug fixes in queue draining and srq resizing
      
         - Support more ethernet speed options in the core layer
      
         - DMABUF support for bnxt_re
      
         - Multi-stage MTT support for erdma to allow much bigger MR
           registrations
      
         - A irdma fix with a CVE that came in too late to go to -rc, missing
           bounds checking for 0 length MRs"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (87 commits)
        IB/hfi1: Reduce printing of errors during driver shut down
        RDMA/hfi1: Move user SDMA system memory pinning code to its own file
        RDMA/hfi1: Use list_for_each_entry() helper
        RDMA/mlx5: Fix trailing */ formatting in block comment
        RDMA/rxe: Fix redundant break statement in switch-case.
        RDMA/efa: Fix wrong resources deallocation order
        RDMA/siw: Call llist_reverse_order in siw_run_sq
        RDMA/siw: Correct wrong debug message
        RDMA/siw: Balance the reference of cep->kref in the error path
        Revert "IB/isert: Fix incorrect release of isert connection"
        RDMA/bnxt_re: Fix kernel doc errors
        RDMA/irdma: Prevent zero-length STAG registration
        RDMA/erdma: Implement hierarchical MTT
        RDMA/erdma: Refactor the storage structure of MTT entries
        RDMA/erdma: Renaming variable names and field names of struct erdma_mem
        RDMA/hns: Support hns HW stats
        RDMA/hns: Dump whole QP/CQ/MR resource in raw
        RDMA/irdma: Add missing kernel-doc in irdma_setup_umode_qp()
        RDMA/mlx4: Copy union directly
        RDMA/irdma: Drop unused kernel push code
        ...
      f7e97ce2
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2023-09-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2fcbb038
      Linus Torvalds authored
      Pull x86 fixes from Dave Hansen:
       "The most important fix here adds a missing CPU model to the recent
        Gather Data Sampling (GDS) mitigation list to ensure that mitigations
        are available on that CPU.
      
        There are also a pair of warning fixes, and closure of a covert
        channel that pops up when protection keys are disabled.
      
        Summary:
         - Mark all Skylake CPUs as vulnerable to GDS
         - Fix PKRU covert channel
         - Fix -Wmissing-variable-declarations warning for ia32_xyz_class
         - Fix kernel-doc annotation warning"
      
      * tag 'x86-urgent-2023-09-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/fpu/xstate: Fix PKRU covert channel
        x86/irq/i8259: Fix kernel-doc annotation warning
        x86/speculation: Mark all Skylake CPUs as vulnerable to GDS
        x86/audit: Fix -Wmissing-variable-declarations warning for ia32_xyz_class
      2fcbb038
    • Linus Torvalds's avatar
      Merge tag 'trace-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace · 34232fcf
      Linus Torvalds authored
      Pull tracing updates from Steven Rostedt:
       "User visible changes:
      
         - Added a way to easier filter with cpumasks:
      
             # echo 'cpumask & CPUS{17-42}' > /sys/kernel/tracing/events/ipi_send_cpumask/filter
      
         - Show actual size of ring buffer after modifying the ring buffer
           size via buffer_size_kb.
      
           Currently it just returns what was written, but the actual size
           rounds up to the sub buffer size. Show that real size instead.
      
        Major changes:
      
         - Added "eventfs". This is the code that handles the inodes and
           dentries of tracefs/events directory. As there are thousands of
           events, and each event has several inodes and dentries that
           currently exist even when tracing is never used, they take up
           precious memory. Instead, eventfs will allocate the inodes and
           dentries in a JIT way (similar to what procfs does). There is now
           metadata that handles the events and subdirectories, and will
           create the inodes and dentries when they are used.
      
           Note, I also have patches that remove the subdirectory meta data,
           but will wait till the next merge window before applying them. It's
           a little more complex, and I want to make sure the dynamic code
           works properly before adding more complexity, making it easier to
           revert if need be.
      
        Minor changes:
      
         - Optimization to user event list traversal
      
         - Remove intermediate permission of tracefs files (note the
           intermediate permission removes all access to the files so it is
           not a security concern, but just a clean up)
      
         - Add the complex fix to FORTIFY_SOURCE to the kernel stack event
           logic
      
         - Other minor cleanups"
      
      * tag 'trace-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: (29 commits)
        tracefs: Remove kerneldoc from struct eventfs_file
        tracefs: Avoid changing i_mode to a temp value
        tracing/user_events: Optimize safe list traversals
        ftrace: Remove empty declaration ftrace_enable_daemon() and ftrace_disable_daemon()
        tracing: Remove unused function declarations
        tracing/filters: Document cpumask filtering
        tracing/filters: Further optimise scalar vs cpumask comparison
        tracing/filters: Optimise CPU vs cpumask filtering when the user mask is a single CPU
        tracing/filters: Optimise scalar vs cpumask filtering when the user mask is a single CPU
        tracing/filters: Optimise cpumask vs cpumask filtering when user mask is a single CPU
        tracing/filters: Enable filtering the CPU common field by a cpumask
        tracing/filters: Enable filtering a scalar field by a cpumask
        tracing/filters: Enable filtering a cpumask field by another cpumask
        tracing/filters: Dynamically allocate filter_pred.regex
        test: ftrace: Fix kprobe test for eventfs
        eventfs: Move tracing/events to eventfs
        eventfs: Implement removal of meta data from eventfs
        eventfs: Implement functions to create files and dirs when accessed
        eventfs: Implement eventfs lookup, read, open functions
        eventfs: Implement eventfs file add functions
        ...
      34232fcf
    • Linus Torvalds's avatar
      Merge tag 'wq-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq · bd30fe6a
      Linus Torvalds authored
      Pull workqueue updates from Tejun Heo:
      
       - Unbound workqueues now support more flexible affinity scopes.
      
         The default behavior is to soft-affine according to last level cache
         boundaries. A work item queued from a given LLC is executed by a
         worker running on the same LLC but the worker may be moved across
         cache boundaries as the scheduler sees fit. On machines which
         multiple L3 caches, which are becoming more popular along with
         chiplet designs, this improves cache locality while not harming work
         conservation too much.
      
         Unbound workqueues are now also a lot more flexible in terms of
         execution affinity. Differeing levels of affinity scopes are
         supported and both the default and per-workqueue affinity settings
         can be modified dynamically. This should help working around amny of
         sub-optimal behaviors observed recently with asymmetric ARM CPUs.
      
         This involved signficant restructuring of workqueue code. Nothing was
         reported yet but there's some risk of subtle regressions. Should keep
         an eye out.
      
       - Rescuer workers now has more identifiable comms.
      
       - workqueue.unbound_cpus added so that CPUs which can be used by
         workqueue can be constrained early during boot.
      
       - Now that all the in-tree users have been flushed out, trigger warning
         if system-wide workqueues are flushed.
      
      * tag 'wq-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: (31 commits)
        workqueue: fix data race with the pwq->stats[] increment
        workqueue: Rename rescuer kworker
        workqueue: Make default affinity_scope dynamically updatable
        workqueue: Add "Affinity Scopes and Performance" section to documentation
        workqueue: Implement non-strict affinity scope for unbound workqueues
        workqueue: Add workqueue_attrs->__pod_cpumask
        workqueue: Factor out need_more_worker() check and worker wake-up
        workqueue: Factor out work to worker assignment and collision handling
        workqueue: Add multiple affinity scopes and interface to select them
        workqueue: Modularize wq_pod_type initialization
        workqueue: Add tools/workqueue/wq_dump.py which prints out workqueue configuration
        workqueue: Generalize unbound CPU pods
        workqueue: Factor out clearing of workqueue-only attrs fields
        workqueue: Factor out actual cpumask calculation to reduce subtlety in wq_update_pod()
        workqueue: Initialize unbound CPU pods later in the boot
        workqueue: Move wq_pod_init() below workqueue_init()
        workqueue: Rename NUMA related names to use pod instead
        workqueue: Rename workqueue_attrs->no_numa to ->ordered
        workqueue: Make unbound workqueues to use per-cpu pool_workqueues
        workqueue: Call wq_update_unbound_numa() on all CPUs in NUMA node on CPU hotplug
        ...
      bd30fe6a
    • Linus Torvalds's avatar
      Merge tag 'cgroup-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup · 7716f383
      Linus Torvalds authored
      Pull cgroup updates from Tejun Heo:
      
       - Per-cpu cpu usage stats are now tracked
      
         This currently isn't printed out in the cgroupfs interface and can
         only be accessed through e.g. BPF. Should decide on a not-too-ugly
         way to show per-cpu stats in cgroupfs
      
       - cpuset received some cleanups and prepatory patches for the pending
         cpus.exclusive patchset which will allow cpuset partitions to be
         created below non-partition parents, which should ease the management
         of partition cpusets
      
       - A lot of code and documentation cleanup patches
      
       - tools/testing/selftests/cgroup/test_cpuset.c added
      
      * tag 'cgroup-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: (32 commits)
        cgroup: Avoid -Wstringop-overflow warnings
        cgroup:namespace: Remove unused cgroup_namespaces_init()
        cgroup/rstat: Record the cumulative per-cpu time of cgroup and its descendants
        cgroup: clean up if condition in cgroup_pidlist_start()
        cgroup: fix obsolete function name in cgroup_destroy_locked()
        Documentation: cgroup-v2.rst: Correct number of stats entries
        cgroup: fix obsolete function name above css_free_rwork_fn()
        cgroup/cpuset: fix kernel-doc
        cgroup: clean up printk()
        cgroup: fix obsolete comment above cgroup_create()
        docs: cgroup-v1: fix typo
        docs: cgroup-v1: correct the term of Page Cache organization in inode
        cgroup/misc: Store atomic64_t reads to u64
        cgroup/misc: Change counters to be explicit 64bit types
        cgroup/misc: update struct members descriptions
        cgroup: remove cgrp->kn check in css_populate_dir()
        cgroup: fix obsolete function name
        cgroup: use cached local variable parent in for loop
        cgroup: remove obsolete comment above struct cgroupstats
        cgroup: put cgroup_tryget_css() inside CONFIG_CGROUP_SCHED
        ...
      7716f383
    • Linus Torvalds's avatar
      Merge tag 'percpu-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu · e987af45
      Linus Torvalds authored
      Pull percpu updates from Dennis Zhou:
       "One bigger change to percpu_counter's api allowing for init and
        destroy of multiple counters via percpu_counter_init_many() and
        percpu_counter_destroy_many(). This is used to help begin remediating
        a performance regression with percpu rss stats.
      
        Additionally, it seems larger core count machines are feeling the
        burden of the single threaded allocation of percpu. Mateusz is
        thinking about it and I will spend some time on it too.
      
        percpu:
      
         - A couple cleanups by Baoquan He and Bibo Mao. The only behavior
           change is to start printing messages if we're under the warn limit
           for failed atomic allocations.
      
        percpu_counter:
      
         - Shakeel introduced percpu counters into mm_struct which caused
           percpu allocations be on the hot path [1]. Originally I spent some
           time trying to improve the percpu allocator, but instead preferred
           what Mateusz Guzik proposed grouping at the allocation site,
           percpu_counter_init_many(). This allows a single percpu allocation
           to be shared by the counters. I like this approach because it
           creates a shared lifetime by the allocations. Additionally, I
           believe many inits have higher level synchronization requirements,
           like percpu_counter does against HOTPLUG_CPU. Therefore we can
           group these optimizations together"
      
      Link: https://lore.kernel.org/linux-mm/20221024052841.3291983-1-shakeelb@google.com/ [1]
      
      * tag 'percpu-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu:
        kernel/fork: group allocation/free of per-cpu counters for mm struct
        pcpcntr: add group allocation/free
        mm/percpu.c: print error message too if atomic alloc failed
        mm/percpu.c: optimize the code in pcpu_setup_first_chunk() a little bit
        mm/percpu.c: remove redundant check
        mm/percpu: Remove some local variables in pcpu_populate_pte
      e987af45
    • Linus Torvalds's avatar
      Merge tag 'v6.6-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 0fe2b86c
      Linus Torvalds authored
      Pull crypto fix from Herbert Xu:
       "This fixes a random config build failure on powerpc"
      
      * tag 'v6.6-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: powerpc/chacha20,poly1305-p10 - Add dependency on VSX
      0fe2b86c
    • Rick Edgecombe's avatar
      selftests/x86: Update map_shadow_stack syscall nr · 6ea7bb00
      Rick Edgecombe authored
      
      
      Shadow stack's selftest utilizes the map_shadow_stack syscall. The
      syscall is new with the feature, but the selftests cannot automatically
      find the headers for the kernel source tree they are located in. This
      resulted in the shadow stack test failing to build until the brand new
      headers were installed.
      
      To avoid this, a copy of the new uapi defines needed by the test were
      included in the selftest (see link for discussion). When shadow stack was
      merged the syscall number was changed, but the copy in the selftest was
      not updated.
      
      So update the copy of the syscall number define used when the required
      headers are not installed, to have the final syscall number from the
      merge.
      
      Signed-off-by: default avatarRick Edgecombe <rick.p.edgecombe@intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Link: https://lore.kernel.org/lkml/Y%2FijdXoTAATt0+Ct@zn.tnic/
      Link: https://lore.kernel.org/r/20230901181652.2583861-1-rick.p.edgecombe@intel.com
      
      
      Reviewed-by: default avatarSohil Mehta <sohil.mehta@intel.com>
      Fixes: df57721f ("Merge tag 'x86_shstk_for_6.6-rc1' of [...]")
      6ea7bb00
    • Linus Torvalds's avatar
      Merge tag 'for-linus-2023083101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · 29aa98d0
      Linus Torvalds authored
      Pull HID updates from Benjamin Tissoires:
      
       - devm fixes for problems that caused use-after-free reports (Rahul
         Rameshbabu)
      
       - Some extensive HID docs (Marco Morandini)
      
       - Constification of struct class (Ivan Orlov and Greg Kroah-Hartman)
      
       - Google Stadia Force Feedback support (Fabio Baltieri)
      
       - Various fixes and new device ID support
      
      * tag 'for-linus-2023083101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (42 commits)
        HID: logitech-hidpp: rework one more time the retries attempts
        HID: nvidia-shield: Reference hid_device devm allocation of input_dev name
        HID: multitouch: Correct devm device reference for hidinput input_dev name
        HID: uclogic: Correct devm device reference for hidinput input_dev name
        HID: logitech-dj: Fix error handling in logi_dj_recv_switch_to_dj_mode()
        HID: i2c-hid: elan: Add ili9882t timing
        dt-bindings: input: i2c-hid: Introduce Ilitek ili9882t
        HID: apple: Add "Hailuck" to the list of non-apple keyboards
        HID: steelseries: arctis_1_battery_request[] should be static
        MAINTAINERS: update my email address
        HID: logitech-hidpp: Add support for Logitech MX Anywhere 3 mouse
        HID: wacom: struct name cleanup
        HID: wacom: remove unnecessary 'connected' variable from EKR
        HID: wacom: remove the battery when the EKR is off
        HID: nvidia-shield: Update Thunderstrike LED instance name to use id
        HID: nvidia-shield: Add battery support for Thunderstrike
        HID: nvidia-shield: Remove led_classdev_unregister in thunderstrike_create
        HID: hid-google-stadiaff: add support for Stadia force feedback
        HID: logitech-dj: Add support for a new lightspeed receiver iteration
        HID: logitech-hidpp: Add support for the Pro X Superlight
        ...
      29aa98d0
    • Linus Torvalds's avatar
      Merge tag 'media/v6.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · 307d5903
      Linus Torvalds authored
      Pull media updates from Mauro Carvalho Chehab:
      
       - new i2c drivers: ds90ub913, ds90ub953, ds90ub960, dw9719, ds90ub913
      
       - new Intel IVSC MEI drivers
      
       - some Mediatek platform drivers were moved to a common location
      
       - Intel atomisp2 driver is now working with the main ov2680 driver. Due
         to that, the atomisp2 ov2680 staging one was removed
      
       - the bttv driver was finally converted to videobuf2 framework. This
         was the last one upstream using videobuf version 1 core. We'll likely
         remove the old videobuf framework on 6.7
      
       - lots of improvements at atomisp driver: it now works with normal I2C
         sensors. Several compile-mode dependecies to select between ISP2400
         and ISP2401 are now solved in runtime
      
       - a new ipu-bridge logic was added to work with IVSC MEI drivers
      
       - venus driver gained better support for new VPU versions
      
       - the v4l core async framework has gained lots of improvements and
         cleanups
      
       - lots of other cleanups, improvements and driver fixes
      
      * tag 'media/v6.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (358 commits)
        media: ivsc: Add ACPI dependency
        media: bttv: convert to vb2
        media: bttv: use audio defaults for winfast2000
        media: bttv: refactor bttv_set_dma()
        media: bttv: move vbi_skip/vbi_count out of buffer
        media: bttv: remove crop info from bttv_buffer
        media: bttv: remove tvnorm field from bttv_buffer
        media: bttv: remove format field from bttv_buffer
        media: bttv: move do_crop flag out of bttv_fh
        media: bttv: copy vbi_fmt from bttv_fh
        media: bttv: copy vid fmt/width/height from fh
        media: bttv: radio use v4l2_fh instead of bttv_fh
        media: bttv: replace BUG with WARN_ON
        media: bttv: use video_drvdata to get bttv
        media: i2c: rdacm21: Fix uninitialized value
        media: coda: Remove duplicated include
        media: vivid: fix the racy dev->radio_tx_rds_owner
        media: i2c: ccs: Check rules is non-NULL
        media: i2c: ds90ub960: Fix PLL config for 1200 MHz CSI rate
        media: i2c: ds90ub953: Fix use of uninitialized variables
        ...
      307d5903
    • Linus Torvalds's avatar
      Merge tag 'fbdev-for-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev · b84acc11
      Linus Torvalds authored
      Pull fbdev updates from Helge Deller:
      
       - Drop the mx3fb driver
      
       - Use list_for_each_entry() helper in fbcore code
      
       - Shorten neofb product names for fb-fix id field
      
       - reduce memory usage in ssd1307fb
      
      * tag 'fbdev-for-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
        fbdev: Update fbdev source file paths
        fbdev: ssd1307fb: Use bool for ssd1307fb_deviceinfo flags
        fbdev: neofb: Shorten Neomagic product name in info struct
        fbdev: mx3fb: Remove the driver
        fbdev/core: Use list_for_each_entry() helper
      b84acc11
    • Linus Torvalds's avatar
      Merge tag 'char-misc-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 1c9f8dff
      Linus Torvalds authored
      Pull char/misc driver updates from Greg KH:
       "Here is the big set of char/misc and other small driver subsystem
        changes for 6.6-rc1.
      
        Stuff all over the place here, lots of driver updates and changes and
        new additions. Short summary is:
      
         - new IIO drivers and updates
      
         - Interconnect driver updates
      
         - fpga driver updates and additions
      
         - fsi driver updates
      
         - mei driver updates
      
         - coresight driver updates
      
         - nvmem driver updates
      
         - counter driver updates
      
         - lots of smaller misc and char driver updates and additions
      
        All of these have been in linux-next for a long time with no reported
        problems"
      
      * tag 'char-misc-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (267 commits)
        nvmem: core: Notify when a new layout is registered
        nvmem: core: Do not open-code existing functions
        nvmem: core: Return NULL when no nvmem layout is found
        nvmem: core: Create all cells before adding the nvmem device
        nvmem: u-boot-env:: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
        nvmem: sec-qfprom: Add Qualcomm secure QFPROM support
        dt-bindings: nvmem: sec-qfprom: Add bindings for secure qfprom
        dt-bindings: nvmem: Add compatible for QCM2290
        nvmem: Kconfig: Fix typo "drive" -> "driver"
        nvmem: Explicitly include correct DT includes
        nvmem: add new NXP QorIQ eFuse driver
        dt-bindings: nvmem: Add t1023-sfp efuse support
        dt-bindings: nvmem: qfprom: Add compatible for MSM8226
        nvmem: uniphier: Use devm_platform_get_and_ioremap_resource()
        nvmem: qfprom: do some cleanup
        nvmem: stm32-romem: Use devm_platform_get_and_ioremap_resource()
        nvmem: rockchip-efuse: Use devm_platform_get_and_ioremap_resource()
        nvmem: meson-mx-efuse: Convert to devm_platform_ioremap_resource()
        nvmem: lpc18xx_otp: Convert to devm_platform_ioremap_resource()
        nvmem: brcm_nvram: Use devm_platform_get_and_ioremap_resource()
        ...
      1c9f8dff