Date: Fri, 2 Aug 2024 15:08:04 +1000 From: Dave Airlie To: Linus Torvalds , Daniel Vetter Cc: dri-devel , LKML Subject: [git pull] drm fixes for 6.11-rc2 Hi Linus, Regular weekly fixes. This is a bit larger than usual but doesn't seem too crazy. Most of it is vmwgfx changes that fix a bunch of issues with wayland userspaces with dma-buf/external buffers and modesetting fixes. Otherwise it's kinda spread out, v3d fixes some new ioctls, nouveau has regression revert and fixes, amdgpu, i915 and ast have some small fixes, and some core fixes spread about. Let me know if any problems, Thanks, Dave. drm-fixes-2024-08-02: drm fixes for 6.11-rc2 client: - fix error code atomic: - allow damage clips with async flips - allow explicit sync with async flips kselftests: - fix dmabuf-heaps test panic: - fix schedule_work in panic paths panel: - fix OrangePi Neo orientation gpuvm: - fix missing dependency amdgpu: - SMU 14.x update - Fix contiguous VRAM handling for IB parsing - GFX 12 fix - Regression fix for old APUs i915: - Static analysis fix for int overflow - Fix for HDCP2_STREAM_STATUS macro and removal of PWR_CLK_STATE for gen12 nouveau: - revert busy wait change that caused a resume regression - fix buffer placement fault on dynamic pm s/r - fix refcount underflow ast: - fix black screen on resume - wake during connector status detect v3d: - fix issues with perf/timestamp ioctls vmwgfx: - fix deadlock in dma-buf fence polling - fix screen surface refcounting - fix dumb buffer handling - fix support for external buffers - fix overlay with screen targets - trigger modeset on screen moves The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b= : Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: https://gitlab.freedesktop.org/drm/kernel.git tags/drm-fixes-2024-08-02 for you to fetch changes up to 27ce65f65258cf2f2855162cbeef59659a81fac4: Revert "nouveau: rip out busy fence waits" (2024-08-02 14:38:28 +1000) ---------------------------------------------------------------- drm fixes for 6.11-rc2 client: - fix error code atomic: - allow damage clips with async flips - allow explicit sync with async flips kselftests: - fix dmabuf-heaps test panic: - fix schedule_work in panic paths panel: - fix OrangePi Neo orientation gpuvm: - fix missing dependency amdgpu: - SMU 14.x update - Fix contiguous VRAM handling for IB parsing - GFX 12 fix - Regression fix for old APUs i915: - Static analysis fix for int overflow - Fix for HDCP2_STREAM_STATUS macro and removal of PWR_CLK_STATE for gen12 nouveau: - revert busy wait change that caused a resume regression - fix buffer placement fault on dynamic pm s/r - fix refcount underflow ast: - fix black screen on resume - wake during connector status detect v3d: - fix issues with perf/timestamp ioctls vmwgfx: - fix deadlock in dma-buf fence polling - fix screen surface refcounting - fix dumb buffer handling - fix support for external buffers - fix overlay with screen targets - trigger modeset on screen moves ---------------------------------------------------------------- Alex Deucher (1): drm/amdgpu: Fix APU handling in amdgpu_pm_load_smu_firmware() Andr=C3=A9 Almeida (2): drm/atomic: Allow userspace to use explicit sync with atomic async fl= ips drm/atomic: Allow userspace to use damage clips with async flips Christian K=C3=B6nig (1): drm/amdgpu: fix contiguous handling for IB parsing v2 Dan Carpenter (1): drm/client: Fix error code in drm_client_buffer_vmap_local() Danilo Krummrich (2): drm/gpuvm: fix missing dependency to DRM_EXEC drm/nouveau: prime: fix refcount underflow Dave Airlie (5): nouveau: set placement to original placement on uvmm validate. Merge tag 'amd-drm-fixes-6.11-2024-07-27' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes Merge tag 'drm-intel-fixes-2024-08-01' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-fixes Merge tag 'drm-misc-fixes-2024-08-01' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes Revert "nouveau: rip out busy fence waits" Dmitry Osipenko (1): drm/virtio: Fix type of dma-fence context variable Ian Forbes (2): drm/vmwgfx: Fix overlay when using Screen Targets drm/vmwgfx: Trigger a modeset when the screen moves Jammy Huang (1): drm/ast: Fix black screen after resume Kenneth Feng (1): drm/amdgpu/pm: support gpu_metrics sysfs interface for smu v14.0.2/3 Maxime Ripard (2): Merge drm/drm-fixes into drm-misc-fixes Merge drm-misc/drm-misc-next-fixes into drm-misc-fixes Michael Chen (1): drm/amdgpu: increase mes log buffer size for gfx12 Nikita Zhandarovich (1): drm/i915: Fix possible int overflow in skl_ddi_calculate_wrpll() Philip Mueller (1): drm: panel-orientation-quirks: Add quirk for OrangePi Neo Qiuxu Zhuo (1): drm/fb-helper: Don't schedule_work() to flush frame buffer during pan= ic() Suraj Kandpal (1): drm/i915/hdcp: Fix HDCP2_STREAM_STATUS macro Thomas Zimmermann (1): drm/ast: astdp: Wake up during connector status detection Tvrtko Ursulin (5): drm/v3d: Prevent out of bounds access in performance query extensions drm/v3d: Fix potential memory leak in the timestamp extension drm/v3d: Fix potential memory leak in the performance extension drm/v3d: Validate passed in drm syncobj handles in the timestamp exte= nsion drm/v3d: Validate passed in drm syncobj handles in the performance extension Umesh Nerlige Ramappa (1): i915/perf: Remove code to update PWR_CLK_STATE for gen12 Zack Rusin (4): drm/vmwgfx: Fix a deadlock in dma buf fence polling drm/vmwgfx: Make sure the screen surface is ref counted drm/vmwgfx: Fix handling of dumb buffers drm/vmwgfx: Add basic support for external buffers Zenghui Yu (1): kselftests: dmabuf-heaps: Ensure the driver name is null-terminated drivers/gpu/drm/Kconfig | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 16 +- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 6 +- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 + drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 8 +- drivers/gpu/drm/amd/include/mes_v11_api_def.h | 3 + drivers/gpu/drm/amd/include/mes_v12_api_def.h | 3 + drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 3 +- .../gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 86 +++- drivers/gpu/drm/ast/ast_dp.c | 7 + drivers/gpu/drm/ast/ast_drv.c | 5 + drivers/gpu/drm/ast/ast_drv.h | 1 + drivers/gpu/drm/ast/ast_mode.c | 29 +- drivers/gpu/drm/drm_atomic_uapi.c | 5 +- drivers/gpu/drm/drm_client.c | 2 +- drivers/gpu/drm/drm_fb_helper.c | 11 + drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 + drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 6 +- drivers/gpu/drm/i915/display/intel_hdcp_regs.h | 2 +- drivers/gpu/drm/i915/i915_perf.c | 33 -- drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +- drivers/gpu/drm/nouveau/nouveau_chan.c | 2 +- drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 +- drivers/gpu/drm/nouveau/nouveau_fence.c | 30 +- drivers/gpu/drm/nouveau/nouveau_fence.h | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- drivers/gpu/drm/nouveau/nouveau_prime.c | 3 +- drivers/gpu/drm/nouveau/nouveau_uvmm.c | 1 + drivers/gpu/drm/v3d/v3d_drv.h | 4 + drivers/gpu/drm/v3d/v3d_sched.c | 44 +- drivers/gpu/drm/v3d/v3d_submit.c | 121 +++-- drivers/gpu/drm/virtio/virtgpu_submit.c | 2 +- drivers/gpu/drm/vmwgfx/vmw_surface_cache.h | 10 +- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 127 +++--- drivers/gpu/drm/vmwgfx/vmwgfx_bo.h | 15 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 40 +- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 17 +- drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 62 ++- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 502 +++++++++--------= ---- drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 17 +- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 14 +- drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_prime.c | 32 +- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 27 +- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 33 +- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 174 ++++--- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 280 +++++++++++- drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c | 40 +- tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c | 4 +- 50 files changed, 1202 insertions(+), 650 deletions(-) . Date: Fri, 02 Aug 2024 10:15:45 +0200 From: Takashi Iwai To: Linus Torvalds Cc: Linux Sound Mailing List , Linux Kernel Mailing List Subject: [GIT PULL] sound fixes for 6.12-rc1 Linus, please pull sound fixes for v6.11-rc2 from: git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git tags/sound-6.11-rc2 The topmost commit is 478689b5990deb626a0b3f1ebf165979914d6be4 ---------------------------------------------------------------- sound fixes for 6.11-rc2 A small collection of fixes: - Revert of FireWire changes that caused a long-time regression - Another long-time regression fix for AMD HDMI - MIDI2 UMP fixes - HD-audio Conexant codec fixes and a qurik ---------------------------------------------------------------- Edmund Raile (2): Revert "ALSA: firewire-lib: obsolete workqueue for period update" Revert "ALSA: firewire-lib: operate for period elapse event in process context" Mavroudis Chatzilazaridis (1): ALSA: hda/realtek: Add quirk for Acer Aspire E5-574G Takashi Iwai (10): ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown ALSA: hda/conexant: Mute speakers at suspend / shutdown ALSA: seq: ump: Optimize conversions from SysEx to UMP ALSA: ump: Transmit RPN/NRPN message at each MSB/LSB data reception ALSA: ump: Explicitly reset RPN with Null RPN ALSA: seq: ump: Use the common RPN/bank conversion context ALSA: seq: ump: Transmit RPN/NRPN message at each MSB/LSB data reception ALSA: seq: ump: Explicitly reset RPN with Null RPN ALSA: usb-audio: Correct surround channels in UAC1 channel map ALSA: hda: Conditionally use snooping for AMD HDMI songxiebing (1): ALSA: hda: conexant: Fix headset auto detect fail in the polling mode --- include/sound/ump_convert.h | 1 + sound/core/seq/seq_ports.h | 14 +--- sound/core/seq/seq_ump_convert.c | 138 ++++++++++++++++++++++++--------------- sound/core/ump_convert.c | 60 ++++++++++++----- sound/firewire/amdtp-stream.c | 38 +++++++---- sound/firewire/amdtp-stream.h | 1 + sound/pci/hda/hda_controller.h | 2 +- sound/pci/hda/hda_generic.c | 63 ++++++++++++++++++ sound/pci/hda/hda_generic.h | 1 + sound/pci/hda/hda_intel.c | 10 ++- sound/pci/hda/patch_conexant.c | 56 ++++------------ sound/pci/hda/patch_realtek.c | 1 + sound/usb/stream.c | 4 +- 13 files changed, 244 insertions(+), 145 deletions(-) . Date: Fri, 02 Aug 2024 15:29:25 +0200 From: "Arnd Bergmann" To: "Linus Torvalds" Cc: linux-alpha@vger.kernel.org, "Jiri Olsa" , "Masami Hiramatsu (Google)" , "Florian Weimer" , "Andreas Schwab" , linux-kernel@vger.kernel.org, Linux-Arch , linux-api@vger.kernel.org Subject: [GIT PULL] asm-generic: fixes for 6.11 The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git tags/asm-generic-fixes-6.11-1 for you to fetch changes up to 343416f0c11c42bed07f6db03ca599f4f1771b17: syscalls: fix syscall macros for newfstat/newfstatat (2024-08-02 15:20:47 +0200) ---------------------------------------------------------------- asm-generic: fixes for 6.11 These are three important bug fixes for the cross-architecture tree, fixing a regression with the new syscall.tbl file, the inconsistent numbering for the new uretprobe syscall and a bug with iowrite64be on alpha. ---------------------------------------------------------------- Arnd Bergmann (3): alpha: fix ioread64be()/iowrite64be() helpers uretprobe: change syscall number, again syscalls: fix syscall macros for newfstat/newfstatat arch/alpha/include/asm/io.h | 4 ++-- arch/arm64/kernel/Makefile.syscalls | 2 +- arch/loongarch/kernel/Makefile.syscalls | 3 ++- arch/riscv/kernel/Makefile.syscalls | 2 +- arch/x86/entry/syscalls/syscall_64.tbl | 2 +- include/uapi/asm-generic/unistd.h | 5 +---- scripts/syscall.tbl | 5 ++--- tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c | 2 +- 8 files changed, 11 insertions(+), 14 deletions(-) ---------------------------------------------------------------- diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h index 2bb8cbeedf91..b191d87f89c4 100644 --- a/arch/alpha/include/asm/io.h +++ b/arch/alpha/include/asm/io.h @@ -534,8 +534,10 @@ extern inline void writeq(u64 b, volatile void __iomem *addr) #define ioread16be(p) swab16(ioread16(p)) #define ioread32be(p) swab32(ioread32(p)) +#define ioread64be(p) swab64(ioread64(p)) #define iowrite16be(v,p) iowrite16(swab16(v), (p)) #define iowrite32be(v,p) iowrite32(swab32(v), (p)) +#define iowrite64be(v,p) iowrite64(swab64(v), (p)) #define inb_p inb #define inw_p inw @@ -634,8 +636,6 @@ extern void outsl (unsigned long port, const void *src, unsigned long count); */ #define ioread64 ioread64 #define iowrite64 iowrite64 -#define ioread64be ioread64be -#define iowrite64be iowrite64be #define ioread8_rep ioread8_rep #define ioread16_rep ioread16_rep #define ioread32_rep ioread32_rep diff --git a/arch/arm64/kernel/Makefile.syscalls b/arch/arm64/kernel/Makefile.syscalls index 3cfafd003b2d..0542a718871a 100644 --- a/arch/arm64/kernel/Makefile.syscalls +++ b/arch/arm64/kernel/Makefile.syscalls @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 syscall_abis_32 += -syscall_abis_64 += renameat newstat rlimit memfd_secret +syscall_abis_64 += renameat rlimit memfd_secret syscalltbl = arch/arm64/tools/syscall_%.tbl diff --git a/arch/loongarch/kernel/Makefile.syscalls b/arch/loongarch/kernel/Makefile.syscalls index 523bb411a3bc..ab7d9baa2915 100644 --- a/arch/loongarch/kernel/Makefile.syscalls +++ b/arch/loongarch/kernel/Makefile.syscalls @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -syscall_abis_64 += newstat +# No special ABIs on loongarch so far +syscall_abis_64 += diff --git a/arch/riscv/kernel/Makefile.syscalls b/arch/riscv/kernel/Makefile.syscalls index 52087a023b3d..9668fd1faf60 100644 --- a/arch/riscv/kernel/Makefile.syscalls +++ b/arch/riscv/kernel/Makefile.syscalls @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 syscall_abis_32 += riscv memfd_secret -syscall_abis_64 += riscv newstat rlimit memfd_secret +syscall_abis_64 += riscv rlimit memfd_secret diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl index 83073fa3c989..7093ee21c0d1 100644 --- a/arch/x86/entry/syscalls/syscall_64.tbl +++ b/arch/x86/entry/syscalls/syscall_64.tbl @@ -344,6 +344,7 @@ 332 common statx sys_statx 333 common io_pgetevents sys_io_pgetevents 334 common rseq sys_rseq +335 common uretprobe sys_uretprobe # don't use numbers 387 through 423, add new calls after the last # 'common' entry 424 common pidfd_send_signal sys_pidfd_send_signal @@ -385,7 +386,6 @@ 460 common lsm_set_self_attr sys_lsm_set_self_attr 461 common lsm_list_modules sys_lsm_list_modules 462 common mseal sys_mseal -467 common uretprobe sys_uretprobe # # Due to a historical design error, certain syscalls are numbered differently diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index 985a262d0f9e..5bf6148cac2b 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -841,11 +841,8 @@ __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules) #define __NR_mseal 462 __SYSCALL(__NR_mseal, sys_mseal) -#define __NR_uretprobe 463 -__SYSCALL(__NR_uretprobe, sys_uretprobe) - #undef __NR_syscalls -#define __NR_syscalls 464 +#define __NR_syscalls 463 /* * 32 bit systems traditionally used different diff --git a/scripts/syscall.tbl b/scripts/syscall.tbl index 591d85e8ca7e..4586a18dfe9b 100644 --- a/scripts/syscall.tbl +++ b/scripts/syscall.tbl @@ -98,9 +98,9 @@ 77 common tee sys_tee 78 common readlinkat sys_readlinkat 79 stat64 fstatat64 sys_fstatat64 -79 newstat fstatat sys_newfstatat +79 64 newfstatat sys_newfstatat 80 stat64 fstat64 sys_fstat64 -80 newstat fstat sys_newfstat +80 64 newfstat sys_newfstat 81 common sync sys_sync 82 common fsync sys_fsync 83 common fdatasync sys_fdatasync @@ -402,4 +402,3 @@ 460 common lsm_set_self_attr sys_lsm_set_self_attr 461 common lsm_list_modules sys_lsm_list_modules 462 common mseal sys_mseal -467 common uretprobe sys_uretprobe diff --git a/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c b/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c index bd8c75b620c2..5f78edca6540 100644 --- a/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c +++ b/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c @@ -216,7 +216,7 @@ static void test_uretprobe_regs_change(void) } #ifndef __NR_uretprobe -#define __NR_uretprobe 467 +#define __NR_uretprobe 335 #endif __naked unsigned long uretprobe_syscall_call_1(void) . Date: Fri, 2 Aug 2024 15:56:59 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] USB-serial fix for 6.11-rc2 The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git tags/usb-serial-6.11-rc2 for you to fetch changes up to 00af4f3dda1461ec90d892edc10bec6d3c50c554: USB: serial: debug: do not echo input by default (2024-07-31 15:13:45 +0200) ---------------------------------------------------------------- USB-serial fix for 6.11-rc2 Here's a fix for an issue when using the usb_debug driver with Xen. This change has been in linux-next for a couple of days with no reported issues. ---------------------------------------------------------------- Marek Marczykowski-Górecki (1): USB: serial: debug: do not echo input by default drivers/usb/serial/usb_debug.c | 7 +++++++ 1 file changed, 7 insertions(+) . Date: Fri, 2 Aug 2024 16:01:05 +0200 From: Vasily Gorbik To: Linus Torvalds Cc: Heiko Carstens , Alexander Gordeev , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [GIT PULL] s390 updates for 6.11-rc2 Hello Linus, please pull s390 changes for 6.11-rc2. Thank you, Vasily The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git tags/s390-6.11-3 for you to fetch changes up to 33bd8d153c337ba9b30a2e5994437ca703ab4ed8: s390: Keep inittext section writable (2024-07-31 16:30:20 +0200) ---------------------------------------------------------------- s390 updates for 6.11-rc2 - Remove unused empty CPU alternatives header file - Fix recently and erroneously removed exception handling when loading an invalid floating point register - Couple of ptdump fixes to reflect the recent changes due to the uncoupling of physical vs virtual kernel address spaces - Couple of changes to avoid the unnecessary splitting of large pages in kernel mappings - Add the missing MODULE_DESCRIPTION for the CIO modules ---------------------------------------------------------------- Heiko Carstens (8): s390/fpu: Re-add exception handling in load_fpu_state() s390/alternatives: Remove unused empty header file s390/mm/ptdump: Fix handling of identity mapping area s390/mm/ptdump: Add support for relocated lowcore mapping s390/mm/ptdump: Improve sorting of markers s390/mm: Get rid of RELOC_HIDE() s390/vmlinux.lds.S: Move ro_after_init section behind rodata section s390: Keep inittext section writable Jeff Johnson (1): s390/cio: Add missing MODULE_DESCRIPTION() macros arch/s390/kernel/alternative.h | 0 arch/s390/kernel/fpu.c | 2 +- arch/s390/kernel/vmlinux.lds.S | 17 ++--- arch/s390/mm/dump_pagetables.c | 140 +++++++++++++++++++++++----------------- arch/s390/mm/init.c | 9 +-- arch/s390/mm/vmem.c | 13 +--- drivers/s390/cio/ccwgroup.c | 1 + drivers/s390/cio/vfio_ccw_drv.c | 1 + 8 files changed, 95 insertions(+), 88 deletions(-) delete mode 100644 arch/s390/kernel/alternative.h . Date: Fri, 02 Aug 2024 08:44:50 -0700 (PDT) From: Palmer Dabbelt To: Linus Torvalds Subject: [GIT PULL] RISC-V Fixes for 6.11-rc2 The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git tags/riscv-for-linus-6.11-rc2 for you to fetch changes up to 3b6564427aea83b7a35a15ca278291d50a1edcfc: riscv: Fix linear mapping checks for non-contiguous memory regions (2024-08-01 11:46:09 -0700) ---------------------------------------------------------------- RISC-V Fixes for 6.11-rc2 * A fix to avoid dropping some of the internal pseudo-extensions, which breaks *envcfg dependency parsing. * The kernel entry address is now aligned in purgatory, which avoids a misaligned load that can lead to crash on systems that don't support misaligned accesses early in boot. * The FW_SFENCE_VMA_RECEIVED perf event was duplicated in a handful of perf JSON configurations, one of them been updated to FW_SFENCE_VMA_ASID_SENT. * The starfive cache driver is now restricted to 64-bit systems, as it isn't 32-bit clean. * A fix for to avoid aliasing legacy-mode perf counters with software perf counters. * VM_FAULT_SIGSEGV is now handled in the page fault code. * A fix for stalls during CPU hotplug due to IPIs being disabled. * A fix for memblock bounds checking. This manifests as a crash on systems with discontinuous memory maps that have regions that don't fit in the linear map. ---------------------------------------------------------------- Daniel Maslowski (1): riscv/purgatory: align riscv_kernel_entry Eric Lin (1): perf arch events: Fix duplicate RISC-V SBI firmware event name Nick Hu (1): RISC-V: Enable the IPI before workqueue_online_cpu() Palmer Dabbelt (1): cache: StarFive: Require a 64-bit system Samuel Holland (1): riscv: cpufeature: Do not drop Linux-internal extensions Shifrin Dmitry (1): perf: riscv: Fix selecting counters in legacy mode Stuart Menefy (1): riscv: Fix linear mapping checks for non-contiguous memory regions Zhe Qiao (1): riscv/mm: Add handling for VM_FAULT_SIGSEGV in mm_fault_error() arch/riscv/kernel/cpufeature.c | 14 ++++++-------- arch/riscv/kernel/sbi-ipi.c | 2 +- arch/riscv/mm/fault.c | 17 +++++++++-------- arch/riscv/mm/init.c | 15 +++++++++++---- arch/riscv/purgatory/entry.S | 2 ++ drivers/cache/Kconfig | 1 + drivers/perf/riscv_pmu_sbi.c | 2 +- include/linux/cpuhotplug.h | 1 + .../perf/pmu-events/arch/riscv/andes/ax45/firmware.json | 2 +- .../perf/pmu-events/arch/riscv/riscv-sbi-firmware.json | 2 +- .../perf/pmu-events/arch/riscv/sifive/u74/firmware.json | 2 +- .../arch/riscv/starfive/dubhe-80/firmware.json | 2 +- .../arch/riscv/thead/c900-legacy/firmware.json | 2 +- 13 files changed, 37 insertions(+), 27 deletions(-) _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv . Date: Fri, 2 Aug 2024 12:51:16 -0400 From: Paolo Bonzini To: torvalds@linux-foundation.org Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: [GIT PULL] KVM changes for Linux 6.11-rc2 Linus, The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus for you to fetch changes up to 1773014a975919195be71646fc2c2cad1570fce4: Merge branch 'kvm-fixes' into HEAD (2024-08-02 12:33:43 -0400) The bulk of the changes here is a largish change to guest_memfd, delaying the clearing and encryption of guest-private pages until they are actually added to guest page tables. This started as "let's make it impossible to misuse the API" for SEV-SNP; but then it ballooned a bit. The new logic is generally simpler and more ready for hugepage support in guest_memfd. Thanks, Paolo ---------------------------------------------------------------- * fix latent bug in how usage of large pages is determined for confidential VMs * fix "underline too short" in docs * eliminate log spam from limited APIC timer periods * disallow pre-faulting of memory before SEV-SNP VMs are initialized * delay clearing and encrypting private memory until it is added to guest page tables * this change also enables another small cleanup: the checks in SNP_LAUNCH_UPDATE that limit it to non-populated, private pages can now be moved in the common kvm_gmem_populate() function * fix compilation error that the RISC-V merge introduced in selftests ---------------------------------------------------------------- Ackerley Tng (1): KVM: x86/mmu: fix determination of max NPT mapping level for private pages Chang Yu (1): KVM: Documentation: Fix title underline too short warning Jim Mattson (1): KVM: x86: Eliminate log spam from limited APIC timer periods Paolo Bonzini (16): KVM: x86: disallow pre-fault for SNP VMs before initialization KVM: guest_memfd: return folio from __kvm_gmem_get_pfn() KVM: guest_memfd: delay folio_mark_uptodate() until after successful preparation KVM: guest_memfd: do not go through struct page KVM: rename CONFIG_HAVE_KVM_GMEM_* to CONFIG_HAVE_KVM_ARCH_GMEM_* KVM: guest_memfd: return locked folio from __kvm_gmem_get_pfn KVM: guest_memfd: delay kvm_gmem_prepare_folio() until the memory is passed to the guest KVM: guest_memfd: make kvm_gmem_prepare_folio() operate on a single struct kvm KVM: remove kvm_arch_gmem_prepare_needed() KVM: guest_memfd: move check for already-populated page to common code KVM: cleanup and add shortcuts to kvm_range_has_memory_attributes() KVM: extend kvm_range_has_memory_attributes() to check subset of attributes KVM: guest_memfd: let kvm_gmem_populate() operate only on private gfns KVM: guest_memfd: abstract how prepared folios are recorded Merge tag 'kvm-riscv-fixes-6.11-1' of https://github.com/kvm-riscv/linux into HEAD Merge branch 'kvm-fixes' into HEAD Yong-Xuan Wang (1): KVM: riscv: selftests: Fix compile error Documentation/virt/kvm/api.rst | 8 +- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/Kconfig | 4 +- arch/x86/kvm/lapic.c | 2 +- arch/x86/kvm/mmu/mmu.c | 7 +- arch/x86/kvm/svm/sev.c | 17 +- arch/x86/kvm/svm/svm.c | 1 + arch/x86/kvm/x86.c | 12 +- include/linux/kvm_host.h | 9 +- tools/testing/selftests/kvm/riscv/get-reg-list.c | 8 +- virt/kvm/Kconfig | 4 +- virt/kvm/guest_memfd.c | 227 ++++++++++++++--------- virt/kvm/kvm_main.c | 73 ++++---- 13 files changed, 214 insertions(+), 159 deletions(-) . Date: Fri, 2 Aug 2024 18:46:36 +0200 From: Ilya Dryomov To: Linus Torvalds Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] Ceph fix for 6.11-rc2 Hi Linus, The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: https://github.com/ceph/ceph-client.git tags/ceph-for-6.11-rc2 for you to fetch changes up to 31634d7597d8c57894b6c98eeefc9e58cf842993: ceph: force sending a cap update msg back to MDS for revoke op (2024-08-01 13:14:28 +0200) ---------------------------------------------------------------- A fix for a potential hang in the MDS when cap revocation races with the client releasing the caps in question, marked for stable. ---------------------------------------------------------------- Xiubo Li (1): ceph: force sending a cap update msg back to MDS for revoke op fs/ceph/caps.c | 35 ++++++++++++++++++++++++----------- fs/ceph/super.h | 7 ++++--- 2 files changed, 28 insertions(+), 14 deletions(-) . Date: Fri, 2 Aug 2024 18:45:58 +0100 From: Catalin Marinas To: Linus Torvalds Cc: Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] arm64 fixes for 6.11-rc2 Hi Linus, Please pull the arm64 fixes below. Thanks. The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux tags/arm64-fixes for you to fetch changes up to cfb00a35786414e7c0e6226b277d9f09657eae74: arm64: jump_label: Ensure patched jump_labels are visible to all CPUs (2024-08-02 15:07:01 +0100) ---------------------------------------------------------------- arm64 fixes: - Expand the speculative SSBS errata workaround to more CPUs - Ensure jump label changes are visible to all CPUs with a kick_all_cpus_sync() (and also enable jump label batching as part of the fix) - The shadow call stack sanitiser is currently incompatible with Rust, make CONFIG_RUST conditional on !CONFIG_SHADOW_CALL_STACK ---------------------------------------------------------------- Alice Ryhl (1): rust: SHADOW_CALL_STACK is incompatible with Rust Mark Rutland (3): arm64: cputype: Add Cortex-X1C definitions arm64: cputype: Add Cortex-A725 definitions arm64: errata: Expand speculative SSBS workaround (again) Will Deacon (1): arm64: jump_label: Ensure patched jump_labels are visible to all CPUs Documentation/arch/arm64/silicon-errata.rst | 18 ++++++++++++++++++ arch/arm64/Kconfig | 22 ++++++++++++++++------ arch/arm64/include/asm/cputype.h | 4 ++++ arch/arm64/include/asm/jump_label.h | 1 + arch/arm64/kernel/cpu_errata.c | 11 ++++++++++- arch/arm64/kernel/jump_label.c | 11 +++++++++-- init/Kconfig | 1 + 7 files changed, 59 insertions(+), 9 deletions(-) -- Catalin . Date: Fri, 2 Aug 2024 19:50:32 +0200 From: "Rafael J. Wysocki" To: Linus Torvalds Cc: Linux PM , Linux Kernel Mailing List , Daniel Lezcano Subject: [GIT PULL] Thermal control fixes for v6.11-rc2 Hi Linus, Please pull from the tag git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \ thermal-6.11-rc2 with top-most commit a09074228977c24c677c10282f506fa11f88eb93 thermal: core: Update thermal zone registration documentation on top of commit 8400291e289ee6b2bf9779ff1c83a291501f017b Linux 6.11-rc1 to receive thermal control fixes for 6.11-rc2. These fix a few issues related to the MSI IRQs management in the int340x thermal driver, fix a thermal core issue that may lead to missing trip point crossing events and update the thermal core documentation. Specifics: - Fix MSI error path cleanup in int340x, allow it to work with a subset of thermal MSI IRQs if some of them are not working and make it free all MSI IRQs on module exit (Srinivas Pandruvada). - Fix a thermal core issue that may lead to missing trip point crossing events in some cases when thermal_zone_set_trips() is used and update the thermal core documentation (Rafael Wysocki). Thanks! --------------- Rafael J. Wysocki (2): thermal: trip: Avoid skipping trips in thermal_zone_set_trips() thermal: core: Update thermal zone registration documentation Srinivas Pandruvada (3): thermal: intel: int340x: Fix kernel warning during MSI cleanup thermal: intel: int340x: Allow limited thermal MSI support thermal: intel: int340x: Free MSI IRQ vectors on module exit --------------- Documentation/driver-api/thermal/sysfs-api.rst | 65 ++++++++++------------ .../int340x_thermal/processor_thermal_device_pci.c | 29 +++++++--- drivers/thermal/thermal_trip.c | 4 +- 3 files changed, 54 insertions(+), 44 deletions(-) . Date: Sat, 03 Aug 2024 17:46:50 -0400 From: James Bottomley To: Andrew Morton , Linus Torvalds Cc: linux-scsi , linux-kernel Subject: [GIT PULL] SCSI fixes for 6.11-rc1 One core change that reverts the double message print patch in sd.c (it was causing regressions on embedded systems). The rest are driver fixes in ufs, mpt3sas and mpi3mr. The patch is available here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes The short changelog is: Damien Le Moal (2): scsi: mpt3sas: Avoid IOMMU page faults on REPORT ZONES scsi: mpi3mr: Avoid IOMMU page faults on REPORT ZONES Eric Biggers (1): scsi: ufs: exynos: Don't resume FMP when crypto support is disabled Johan Hovold (1): scsi: Revert "scsi: sd: Do not repeat the starting disk message" Kyoungrul Kim (1): scsi: ufs: core: Check LSDBS cap when !mcq Manivannan Sadhasivam (1): scsi: ufs: core: Do not set link to OFF state while waking up from hibernation Peter Wang (2): scsi: ufs: core: Fix deadlock during RTC update scsi: ufs: core: Bypass quick recovery if force reset is needed With the diffstat: drivers/scsi/mpi3mr/mpi3mr_os.c | 11 +++++++++++ drivers/scsi/mpt3sas/mpt3sas_base.c | 20 ++++++++++++++++++-- drivers/scsi/sd.c | 5 +++-- drivers/ufs/core/ufshcd-priv.h | 5 +++++ drivers/ufs/core/ufshcd.c | 27 ++++++++++++++++++++++----- drivers/ufs/host/ufs-exynos.c | 3 +++ include/ufs/ufshcd.h | 1 + include/ufs/ufshci.h | 1 + 8 files changed, 64 insertions(+), 9 deletions(-) With full diff below. James --- diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index 69b14918de59..ca8f132e03ae 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -3575,6 +3575,17 @@ static int mpi3mr_prepare_sg_scmd(struct mpi3mr_ioc *mrioc, scmd->sc_data_direction); priv->meta_sg_valid = 1; /* To unmap meta sg DMA */ } else { + /* + * Some firmware versions byte-swap the REPORT ZONES command + * reply from ATA-ZAC devices by directly accessing in the host + * buffer. This does not respect the default command DMA + * direction and causes IOMMU page faults on some architectures + * with an IOMMU enforcing write mappings (e.g. AMD hosts). + * Avoid such issue by making the REPORT ZONES buffer mapping + * bi-directional. + */ + if (scmd->cmnd[0] == ZBC_IN && scmd->cmnd[1] == ZI_REPORT_ZONES) + scmd->sc_data_direction = DMA_BIDIRECTIONAL; sg_scmd = scsi_sglist(scmd); sges_left = scsi_dma_map(scmd); } diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index b2bcf4a27ddc..b785a7e88b49 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -2671,6 +2671,22 @@ _base_build_zero_len_sge_ieee(struct MPT3SAS_ADAPTER *ioc, void *paddr) _base_add_sg_single_ieee(paddr, sgl_flags, 0, 0, -1); } +static inline int _base_scsi_dma_map(struct scsi_cmnd *cmd) +{ + /* + * Some firmware versions byte-swap the REPORT ZONES command reply from + * ATA-ZAC devices by directly accessing in the host buffer. This does + * not respect the default command DMA direction and causes IOMMU page + * faults on some architectures with an IOMMU enforcing write mappings + * (e.g. AMD hosts). Avoid such issue by making the report zones buffer + * mapping bi-directional. + */ + if (cmd->cmnd[0] == ZBC_IN && cmd->cmnd[1] == ZI_REPORT_ZONES) + cmd->sc_data_direction = DMA_BIDIRECTIONAL; + + return scsi_dma_map(cmd); +} + /** * _base_build_sg_scmd - main sg creation routine * pcie_device is unused here! @@ -2717,7 +2733,7 @@ _base_build_sg_scmd(struct MPT3SAS_ADAPTER *ioc, sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; sg_scmd = scsi_sglist(scmd); - sges_left = scsi_dma_map(scmd); + sges_left = _base_scsi_dma_map(scmd); if (sges_left < 0) return -ENOMEM; @@ -2861,7 +2877,7 @@ _base_build_sg_scmd_ieee(struct MPT3SAS_ADAPTER *ioc, } sg_scmd = scsi_sglist(scmd); - sges_left = scsi_dma_map(scmd); + sges_left = _base_scsi_dma_map(scmd); if (sges_left < 0) return -ENOMEM; diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index adeaa8ab9951..8bb3a3611851 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -4205,6 +4205,8 @@ static int sd_resume(struct device *dev) { struct scsi_disk *sdkp = dev_get_drvdata(dev); + sd_printk(KERN_NOTICE, sdkp, "Starting disk\n"); + if (opal_unlock_from_suspend(sdkp->opal_dev)) { sd_printk(KERN_NOTICE, sdkp, "OPAL unlock failed\n"); return -EIO; @@ -4221,13 +4223,12 @@ static int sd_resume_common(struct device *dev, bool runtime) if (!sdkp) /* E.g.: runtime resume at the start of sd_probe() */ return 0; - sd_printk(KERN_NOTICE, sdkp, "Starting disk\n"); - if (!sd_do_start_stop(sdkp->device, runtime)) { sdkp->suspended = false; return 0; } + sd_printk(KERN_NOTICE, sdkp, "Starting disk\n"); ret = sd_start_stop_device(sdkp, 1); if (!ret) { sd_resume(dev); diff --git a/drivers/ufs/core/ufshcd-priv.h b/drivers/ufs/core/ufshcd-priv.h index ce36154ce963..7aea8fbaeee8 100644 --- a/drivers/ufs/core/ufshcd-priv.h +++ b/drivers/ufs/core/ufshcd-priv.h @@ -316,6 +316,11 @@ static inline int ufshcd_rpm_get_sync(struct ufs_hba *hba) return pm_runtime_get_sync(&hba->ufs_device_wlun->sdev_gendev); } +static inline int ufshcd_rpm_get_if_active(struct ufs_hba *hba) +{ + return pm_runtime_get_if_active(&hba->ufs_device_wlun->sdev_gendev); +} + static inline int ufshcd_rpm_put_sync(struct ufs_hba *hba) { return pm_runtime_put_sync(&hba->ufs_device_wlun->sdev_gendev); diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index dc757ba47522..5e3c67e96956 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -2416,7 +2416,17 @@ static inline int ufshcd_hba_capabilities(struct ufs_hba *hba) return err; } + /* + * The UFSHCI 3.0 specification does not define MCQ_SUPPORT and + * LSDB_SUPPORT, but [31:29] as reserved bits with reset value 0s, which + * means we can simply read values regardless of version. + */ hba->mcq_sup = FIELD_GET(MASK_MCQ_SUPPORT, hba->capabilities); + /* + * 0h: legacy single doorbell support is available + * 1h: indicate that legacy single doorbell support has been removed + */ + hba->lsdb_sup = !FIELD_GET(MASK_LSDB_SUPPORT, hba->capabilities); if (!hba->mcq_sup) return 0; @@ -6553,7 +6563,8 @@ static void ufshcd_err_handler(struct work_struct *work) if (ufshcd_err_handling_should_stop(hba)) goto skip_err_handling; - if (hba->dev_quirks & UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS) { + if ((hba->dev_quirks & UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS) && + !hba->force_reset) { bool ret; spin_unlock_irqrestore(hba->host->host_lock, flags); @@ -8211,7 +8222,10 @@ static void ufshcd_update_rtc(struct ufs_hba *hba) */ val = ts64.tv_sec - hba->dev_info.rtc_time_baseline; - ufshcd_rpm_get_sync(hba); + /* Skip update RTC if RPM state is not RPM_ACTIVE */ + if (ufshcd_rpm_get_if_active(hba) <= 0) + return; + err = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_WRITE_ATTR, QUERY_ATTR_IDN_SECONDS_PASSED, 0, 0, &val); ufshcd_rpm_put_sync(hba); @@ -10265,9 +10279,6 @@ int ufshcd_system_restore(struct device *dev) */ ufshcd_readl(hba, REG_UTP_TASK_REQ_LIST_BASE_H); - /* Resuming from hibernate, assume that link was OFF */ - ufshcd_set_link_off(hba); - return 0; } @@ -10496,6 +10507,12 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) } if (!is_mcq_supported(hba)) { + if (!hba->lsdb_sup) { + dev_err(hba->dev, "%s: failed to initialize (legacy doorbell mode not supported)\n", + __func__); + err = -EINVAL; + goto out_disable; + } err = scsi_add_host(host, hba->dev); if (err) { dev_err(hba->dev, "scsi_add_host failed\n"); diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 16ad3528d80b..9ec318ef52bf 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -1293,6 +1293,9 @@ static void exynos_ufs_fmp_resume(struct ufs_hba *hba) { struct arm_smccc_res res; + if (!(hba->caps & UFSHCD_CAP_CRYPTO)) + return; + arm_smccc_smc(SMC_CMD_FMP_SECURITY, 0, SMU_EMBEDDED, CFG_DESCTYPE_3, 0, 0, 0, 0, &res); if (res.a0) diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index a43b14276bc3..cac0cdb9a916 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -1109,6 +1109,7 @@ struct ufs_hba { bool ext_iid_sup; bool scsi_host_added; bool mcq_sup; + bool lsdb_sup; bool mcq_enabled; struct ufshcd_res_info res[RES_MAX]; void __iomem *mcq_base; diff --git a/include/ufs/ufshci.h b/include/ufs/ufshci.h index 38fe97971a65..9917c7743d80 100644 --- a/include/ufs/ufshci.h +++ b/include/ufs/ufshci.h @@ -77,6 +77,7 @@ enum { MASK_OUT_OF_ORDER_DATA_DELIVERY_SUPPORT = 0x02000000, MASK_UIC_DME_TEST_MODE_SUPPORT = 0x04000000, MASK_CRYPTO_SUPPORT = 0x10000000, + MASK_LSDB_SUPPORT = 0x20000000, MASK_MCQ_SUPPORT = 0x40000000, }; . Date: Sat, 3 Aug 2024 18:14:19 -0500 From: Steve French To: Linus Torvalds Cc: LKML , CIFS Subject: [GIT PULL] smb3 client fixes Please pull the following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://git.samba.org/sfrench/cifs-2.6.git tags/6.11-rc1-smb-client-fixes for you to fetch changes up to a91bfa67601c07ff9d31731fd2d624b47b0039f2: cifs: update internal version number (2024-08-02 10:56:14 -0500) ---------------------------------------------------------------- smb3 client fixes - two reparse point fixes - minor cleanup - additional trace point (to help debug a recent problem) ---------------------------------------------------------------- David Howells (1): cifs: Remove cifs_aio_ctx Paulo Alcantara (2): smb: client: handle lack of FSCTL_GET_REPARSE_POINT support smb: client: fix FSCTL_GET_REPARSE_POINT against NetApp Steve French (2): smb3: add dynamic tracepoints for shutdown ioctl cifs: update internal version number fs/smb/client/cifsfs.h | 4 ++-- fs/smb/client/cifsglob.h | 24 ----------------------- fs/smb/client/cifsproto.h | 2 -- fs/smb/client/inode.c | 17 ++++++++++++++-- fs/smb/client/ioctl.c | 32 +++++++++++++++++++++++------- fs/smb/client/misc.c | 54 --------------------------------------------------- fs/smb/client/reparse.c | 4 ++++ fs/smb/client/reparse.h | 19 ++++++++++++++++-- fs/smb/client/smb2inode.c | 8 ++++++-- fs/smb/client/trace.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++- 10 files changed, 119 insertions(+), 96 deletions(-) -- Thanks, Steve . Date: Sun, 4 Aug 2024 10:07:36 +0200 From: Mauro Carvalho Chehab To: Linus Torvalds Cc: Greg Kroah-Hartman , Andrew Morton , Linux Media Mailing List , Linux Kernel Mailing List Subject: [GIT PULL for v6.11-rc2] media fixes Hi Linus, Please pull from: git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media tags/media/v6.11-2 For: - two Kconfig fixes; - one fix at UVC driver addressing probing time detection of a UVC custom controls; - one fix related to PDF generation. The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media tags/media/v6.11-2 for you to fetch changes up to e2ed53694e5356a55fd539a4d8dc56c2fa42b2ff: Merge tag 'tags/fixes-media-uvc-20230722' of git://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git (2024-08-03 11:01:04 +0200) ---------------------------------------------------------------- media fixes for v6.11-rc2 ---------------------------------------------------------------- Arnd Bergmann (1): media: ipu-bridge: fix ipu6 Kconfig dependencies Bingbu Cao (1): media: intel/ipu6: select AUXILIARY_BUS in Kconfig Hans Verkuil (1): Merge tag 'tags/fixes-media-uvc-20230722' of git://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git Jean-Michel Hautbois (1): media: v4l: Fix missing tabular column hint for Y14P format Ricardo Ribalda (1): media: uvcvideo: Fix custom control mapping probing Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst | 4 ++-- drivers/media/pci/intel/ipu6/Kconfig | 3 ++- drivers/media/usb/uvc/uvc_ctrl.c | 8 +++++--- 3 files changed, 9 insertions(+), 6 deletions(-) . Date: Sun, 4 Aug 2024 15:02:53 +0200 (CEST) From: Thomas Gleixner To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] locking/urgent for v6.11-rc2 Linus, please pull the latest locking/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking-urgent-2= 024-08-04 up to: 224fa3552029: jump_label: Fix the fix, brown paper bags galore Two fixes for locking and jump labels: - Ensure that the atomic_cmpxchg() conditions are correct and evaluating to true on any non-zero value except 1. The missing check of the return value leads to inconsisted state of the jump label counter. - Add a missing type conversion in the paravirt spinlock code which makes loongson build again. Thanks, tglx ------------------> Peter Zijlstra (1): jump_label: Fix the fix, brown paper bags galore Uros Bizjak (1): locking/pvqspinlock: Correct the type of "old" variable in pv_kick_node= () kernel/jump_label.c | 4 ++-- kernel/locking/qspinlock_paravirt.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/jump_label.c b/kernel/jump_label.c index 4ad5ed8adf96..6dc76b590703 100644 --- a/kernel/jump_label.c +++ b/kernel/jump_label.c @@ -236,7 +236,7 @@ void static_key_disable_cpuslocked(struct static_key *key) } =20 jump_label_lock(); - if (atomic_cmpxchg(&key->enabled, 1, 0)) + if (atomic_cmpxchg(&key->enabled, 1, 0) =3D=3D 1) jump_label_update(key); jump_label_unlock(); } @@ -289,7 +289,7 @@ static void __static_key_slow_dec_cpuslocked(struct stati= c_key *key) return; =20 guard(mutex)(&jump_label_mutex); - if (atomic_cmpxchg(&key->enabled, 1, 0)) + if (atomic_cmpxchg(&key->enabled, 1, 0) =3D=3D 1) jump_label_update(key); else WARN_ON_ONCE(!static_key_slow_try_dec(key)); diff --git a/kernel/locking/qspinlock_paravirt.h b/kernel/locking/qspinlock_p= aravirt.h index f5a36e67b593..ac2e22502741 100644 --- a/kernel/locking/qspinlock_paravirt.h +++ b/kernel/locking/qspinlock_paravirt.h @@ -357,7 +357,7 @@ static void pv_wait_node(struct mcs_spinlock *node, struc= t mcs_spinlock *prev) static void pv_kick_node(struct qspinlock *lock, struct mcs_spinlock *node) { struct pv_node *pn =3D (struct pv_node *)node; - enum vcpu_state old =3D vcpu_halted; + u8 old =3D vcpu_halted; /* * If the vCPU is indeed halted, advance its state to match that of * pv_wait_node(). If OTOH this fails, the vCPU was running and will . Date: Sun, 4 Aug 2024 15:02:51 +0200 (CEST) From: Thomas Gleixner To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] irq/urgent for v6.11-rc2 Linus, please pull the latest irq/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq-urgent-2024-= 08-04 up to: 6be6cba9c437: irqchip/mbigen: Fix mbigen node address layout A couple of fixes for interrupt chip drivers: - Ensure to skip the clear register space in the MBIGEN driver when calculating the node register index. Otherwise the clear register is clobbered and the wrong node registers are accessed. - Fix a signed/unsigned confusion in the loongarch CPU driver which converts an error code to a huge "valid" interrupt number. - Convert the mesion GPIO interrupt controller lock to a raw spinlock so it works on RT. - Add a missing static to a internal function in the pic32 EVIC driver. Thanks, tglx ------------------> Arseniy Krasnov (1): irqchip/meson-gpio: Convert meson_gpio_irq_controller::lock to 'raw_spi= nlock_t' Huacai Chen (1): irqchip/loongarch-cpu: Fix return value of lpic_gsi_to_irq() Luca Ceresoli (1): irqchip/irq-pic32-evic: Add missing 'static' to internal function Yipeng Zou (1): irqchip/mbigen: Fix mbigen node address layout drivers/irqchip/irq-loongarch-cpu.c | 6 ++++-- drivers/irqchip/irq-mbigen.c | 20 ++++++++++++++++---- drivers/irqchip/irq-meson-gpio.c | 14 +++++++------- drivers/irqchip/irq-pic32-evic.c | 6 +++--- 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/drivers/irqchip/irq-loongarch-cpu.c b/drivers/irqchip/irq-loonga= rch-cpu.c index 9d8f2c406043..b35903a06902 100644 --- a/drivers/irqchip/irq-loongarch-cpu.c +++ b/drivers/irqchip/irq-loongarch-cpu.c @@ -18,11 +18,13 @@ struct fwnode_handle *cpuintc_handle; =20 static u32 lpic_gsi_to_irq(u32 gsi) { + int irq =3D 0; + /* Only pch irqdomain transferring is required for LoongArch. */ if (gsi >=3D GSI_MIN_PCH_IRQ && gsi <=3D GSI_MAX_PCH_IRQ) - return acpi_register_gsi(NULL, gsi, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_HIGH= ); + irq =3D acpi_register_gsi(NULL, gsi, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_HIG= H); =20 - return 0; + return (irq > 0) ? irq : 0; } =20 static struct fwnode_handle *lpic_get_gsi_domain_id(u32 gsi) diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c index 093fd42893a7..53cc08387588 100644 --- a/drivers/irqchip/irq-mbigen.c +++ b/drivers/irqchip/irq-mbigen.c @@ -64,6 +64,20 @@ struct mbigen_device { void __iomem *base; }; =20 +static inline unsigned int get_mbigen_node_offset(unsigned int nid) +{ + unsigned int offset =3D nid * MBIGEN_NODE_OFFSET; + + /* + * To avoid touched clear register in unexpected way, we need to directly + * skip clear register when access to more than 10 mbigen nodes. + */ + if (nid >=3D (REG_MBIGEN_CLEAR_OFFSET / MBIGEN_NODE_OFFSET)) + offset +=3D MBIGEN_NODE_OFFSET; + + return offset; +} + static inline unsigned int get_mbigen_vec_reg(irq_hw_number_t hwirq) { unsigned int nid, pin; @@ -72,8 +86,7 @@ static inline unsigned int get_mbigen_vec_reg(irq_hw_number= _t hwirq) nid =3D hwirq / IRQS_PER_MBIGEN_NODE + 1; pin =3D hwirq % IRQS_PER_MBIGEN_NODE; =20 - return pin * 4 + nid * MBIGEN_NODE_OFFSET - + REG_MBIGEN_VEC_OFFSET; + return pin * 4 + get_mbigen_node_offset(nid) + REG_MBIGEN_VEC_OFFSET; } =20 static inline void get_mbigen_type_reg(irq_hw_number_t hwirq, @@ -88,8 +101,7 @@ static inline void get_mbigen_type_reg(irq_hw_number_t hwi= rq, *mask =3D 1 << (irq_ofst % 32); ofst =3D irq_ofst / 32 * 4; =20 - *addr =3D ofst + nid * MBIGEN_NODE_OFFSET - + REG_MBIGEN_TYPE_OFFSET; + *addr =3D ofst + get_mbigen_node_offset(nid) + REG_MBIGEN_TYPE_OFFSET; } =20 static inline void get_mbigen_clear_reg(irq_hw_number_t hwirq, diff --git a/drivers/irqchip/irq-meson-gpio.c b/drivers/irqchip/irq-meson-gpi= o.c index 27e30ce41db3..cd789fa51519 100644 --- a/drivers/irqchip/irq-meson-gpio.c +++ b/drivers/irqchip/irq-meson-gpio.c @@ -178,7 +178,7 @@ struct meson_gpio_irq_controller { void __iomem *base; u32 channel_irqs[MAX_NUM_CHANNEL]; DECLARE_BITMAP(channel_map, MAX_NUM_CHANNEL); - spinlock_t lock; + raw_spinlock_t lock; }; =20 static void meson_gpio_irq_update_bits(struct meson_gpio_irq_controller *ctl, @@ -187,14 +187,14 @@ static void meson_gpio_irq_update_bits(struct meson_gpi= o_irq_controller *ctl, unsigned long flags; u32 tmp; =20 - spin_lock_irqsave(&ctl->lock, flags); + raw_spin_lock_irqsave(&ctl->lock, flags); =20 tmp =3D readl_relaxed(ctl->base + reg); tmp &=3D ~mask; tmp |=3D val; writel_relaxed(tmp, ctl->base + reg); =20 - spin_unlock_irqrestore(&ctl->lock, flags); + raw_spin_unlock_irqrestore(&ctl->lock, flags); } =20 static void meson_gpio_irq_init_dummy(struct meson_gpio_irq_controller *ctl) @@ -244,12 +244,12 @@ meson_gpio_irq_request_channel(struct meson_gpio_irq_co= ntroller *ctl, unsigned long flags; unsigned int idx; =20 - spin_lock_irqsave(&ctl->lock, flags); + raw_spin_lock_irqsave(&ctl->lock, flags); =20 /* Find a free channel */ idx =3D find_first_zero_bit(ctl->channel_map, ctl->params->nr_channels); if (idx >=3D ctl->params->nr_channels) { - spin_unlock_irqrestore(&ctl->lock, flags); + raw_spin_unlock_irqrestore(&ctl->lock, flags); pr_err("No channel available\n"); return -ENOSPC; } @@ -257,7 +257,7 @@ meson_gpio_irq_request_channel(struct meson_gpio_irq_cont= roller *ctl, /* Mark the channel as used */ set_bit(idx, ctl->channel_map); =20 - spin_unlock_irqrestore(&ctl->lock, flags); + raw_spin_unlock_irqrestore(&ctl->lock, flags); =20 /* * Setup the mux of the channel to route the signal of the pad @@ -567,7 +567,7 @@ static int meson_gpio_irq_of_init(struct device_node *nod= e, struct device_node * if (!ctl) return -ENOMEM; =20 - spin_lock_init(&ctl->lock); + raw_spin_lock_init(&ctl->lock); =20 ctl->base =3D of_iomap(node, 0); if (!ctl->base) { diff --git a/drivers/irqchip/irq-pic32-evic.c b/drivers/irqchip/irq-pic32-evi= c.c index 1d9bb28d13e5..277240325cbc 100644 --- a/drivers/irqchip/irq-pic32-evic.c +++ b/drivers/irqchip/irq-pic32-evic.c @@ -161,9 +161,9 @@ static int pic32_irq_domain_map(struct irq_domain *d, uns= igned int virq, return ret; } =20 -int pic32_irq_domain_xlate(struct irq_domain *d, struct device_node *ctrlr, - const u32 *intspec, unsigned int intsize, - irq_hw_number_t *out_hwirq, unsigned int *out_type) +static int pic32_irq_domain_xlate(struct irq_domain *d, struct device_node *= ctrlr, + const u32 *intspec, unsigned int intsize, + irq_hw_number_t *out_hwirq, unsigned int *out_type) { struct evic_chip_data *priv =3D d->host_data; =20 . Date: Sun, 4 Aug 2024 15:02:55 +0200 (CEST) From: Thomas Gleixner To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] perf/urgent for v6.11-rc2 Linus, please pull the latest perf/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-urgent-2024= -08-04 up to: f73cefa3b72e: perf/x86: Fix smp_processor_id()-in-preemptible warnings perf/x86 subsystem fixes: - Move the smp_processor_id() invocation back into the non-preemtible region, so that the result is valid to use. - Add the missing package C2 residency counters for Sierra Forest CPUs to make the newly added support actually useful Thanks, tglx ------------------> Li Huafei (1): perf/x86: Fix smp_processor_id()-in-preemptible warnings Zhenyu Wang (1): perf/x86/intel/cstate: Add pkg C2 residency counter for Sierra Forest arch/x86/events/core.c | 22 ++++++++++++---------- arch/x86/events/intel/cstate.c | 5 +++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 12f2a0c14d33..be01823b1bb4 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -1520,20 +1520,23 @@ static void x86_pmu_start(struct perf_event *event, i= nt flags) void perf_event_print_debug(void) { u64 ctrl, status, overflow, pmc_ctrl, pmc_count, prev_left, fixed; + unsigned long *cntr_mask, *fixed_cntr_mask; + struct event_constraint *pebs_constraints; + struct cpu_hw_events *cpuc; u64 pebs, debugctl; - int cpu =3D smp_processor_id(); - struct cpu_hw_events *cpuc =3D &per_cpu(cpu_hw_events, cpu); - unsigned long *cntr_mask =3D hybrid(cpuc->pmu, cntr_mask); - unsigned long *fixed_cntr_mask =3D hybrid(cpuc->pmu, fixed_cntr_mask); - struct event_constraint *pebs_constraints =3D hybrid(cpuc->pmu, pebs_constr= aints); - unsigned long flags; - int idx; + int cpu, idx; + + guard(irqsave)(); + + cpu =3D smp_processor_id(); + cpuc =3D &per_cpu(cpu_hw_events, cpu); + cntr_mask =3D hybrid(cpuc->pmu, cntr_mask); + fixed_cntr_mask =3D hybrid(cpuc->pmu, fixed_cntr_mask); + pebs_constraints =3D hybrid(cpuc->pmu, pebs_constraints); =20 if (!*(u64 *)cntr_mask) return; =20 - local_irq_save(flags); - if (x86_pmu.version >=3D 2) { rdmsrl(MSR_CORE_PERF_GLOBAL_CTRL, ctrl); rdmsrl(MSR_CORE_PERF_GLOBAL_STATUS, status); @@ -1577,7 +1580,6 @@ void perf_event_print_debug(void) pr_info("CPU#%d: fixed-PMC%d count: %016llx\n", cpu, idx, pmc_count); } - local_irq_restore(flags); } =20 void x86_pmu_stop(struct perf_event *event, int flags) diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c index be58cfb012dd..9f116dfc4728 100644 --- a/arch/x86/events/intel/cstate.c +++ b/arch/x86/events/intel/cstate.c @@ -64,7 +64,7 @@ * perf code: 0x00 * Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM,CNL, * KBL,CML,ICL,ICX,TGL,TNT,RKL,ADL, - * RPL,SPR,MTL,ARL,LNL + * RPL,SPR,MTL,ARL,LNL,SRF * Scope: Package (physical package) * MSR_PKG_C3_RESIDENCY: Package C3 Residency Counter. * perf code: 0x01 @@ -693,7 +693,8 @@ static const struct cstate_model srf_cstates __initconst = =3D { .core_events =3D BIT(PERF_CSTATE_CORE_C1_RES) | BIT(PERF_CSTATE_CORE_C6_RES), =20 - .pkg_events =3D BIT(PERF_CSTATE_PKG_C6_RES), + .pkg_events =3D BIT(PERF_CSTATE_PKG_C2_RES) | + BIT(PERF_CSTATE_PKG_C6_RES), =20 .module_events =3D BIT(PERF_CSTATE_MODULE_C6_RES), }; . Date: Sun, 4 Aug 2024 15:02:57 +0200 (CEST) From: Thomas Gleixner To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] sched/urgent for v6.11-rc2 Linus, please pull the latest sched/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched-urgent-202= 4-08-04 up to: fe7a11c78d2a: sched/core: Fix unbalance set_rq_online/offline() in sc= hed_cpu_deactivate() Scheduler fixes: - When stime is larger than rtime due to accounting imprecision, then utime =3D rtime - stime becomes negative. As this is unsigned math, the result becomes a huge positive number. Cure it by resetting stime to rtime in that case, so utime becomes 0. - Restore consistent state when sched_cpu_deactivate() fails. When offlining a CPU fails in sched_cpu_deactivate() after the SMT present counter has been decremented, then the function aborts but fails to increment the SMT present counter and leaves it imbalanced. Consecutive operations cause it to underflow. Add the missing fixup for the error path. As SMT accounting the runqueue needs to marked online again in the error exit path to restore consistent state. Thanks, tglx ------------------> Yang Yingliang (4): sched/smt: Introduce sched_smt_present_inc/dec() helper sched/smt: Fix unbalance sched_smt_present dec/inc sched/core: Introduce sched_set_rq_on/offline() helper sched/core: Fix unbalance set_rq_online/offline() in sched_cpu_deactiva= te() Zheng Zucheng (1): sched/cputime: Fix mul_u64_u64_div_u64() precision for cputime kernel/sched/core.c | 68 ++++++++++++++++++++++++++++++++++--------------= -- kernel/sched/cputime.c | 6 +++++ 2 files changed, 53 insertions(+), 21 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index a9f655025607..f3951e4a55e5 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7845,6 +7845,30 @@ void set_rq_offline(struct rq *rq) } } =20 +static inline void sched_set_rq_online(struct rq *rq, int cpu) +{ + struct rq_flags rf; + + rq_lock_irqsave(rq, &rf); + if (rq->rd) { + BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); + set_rq_online(rq); + } + rq_unlock_irqrestore(rq, &rf); +} + +static inline void sched_set_rq_offline(struct rq *rq, int cpu) +{ + struct rq_flags rf; + + rq_lock_irqsave(rq, &rf); + if (rq->rd) { + BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); + set_rq_offline(rq); + } + rq_unlock_irqrestore(rq, &rf); +} + /* * used to mark begin/end of suspend/resume: */ @@ -7895,10 +7919,25 @@ static int cpuset_cpu_inactive(unsigned int cpu) return 0; } =20 +static inline void sched_smt_present_inc(int cpu) +{ +#ifdef CONFIG_SCHED_SMT + if (cpumask_weight(cpu_smt_mask(cpu)) =3D=3D 2) + static_branch_inc_cpuslocked(&sched_smt_present); +#endif +} + +static inline void sched_smt_present_dec(int cpu) +{ +#ifdef CONFIG_SCHED_SMT + if (cpumask_weight(cpu_smt_mask(cpu)) =3D=3D 2) + static_branch_dec_cpuslocked(&sched_smt_present); +#endif +} + int sched_cpu_activate(unsigned int cpu) { struct rq *rq =3D cpu_rq(cpu); - struct rq_flags rf; =20 /* * Clear the balance_push callback and prepare to schedule @@ -7906,13 +7945,10 @@ int sched_cpu_activate(unsigned int cpu) */ balance_push_set(cpu, false); =20 -#ifdef CONFIG_SCHED_SMT /* * When going up, increment the number of cores with SMT present. */ - if (cpumask_weight(cpu_smt_mask(cpu)) =3D=3D 2) - static_branch_inc_cpuslocked(&sched_smt_present); -#endif + sched_smt_present_inc(cpu); set_cpu_active(cpu, true); =20 if (sched_smp_initialized) { @@ -7930,12 +7966,7 @@ int sched_cpu_activate(unsigned int cpu) * 2) At runtime, if cpuset_cpu_active() fails to rebuild the * domains. */ - rq_lock_irqsave(rq, &rf); - if (rq->rd) { - BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); - set_rq_online(rq); - } - rq_unlock_irqrestore(rq, &rf); + sched_set_rq_online(rq, cpu); =20 return 0; } @@ -7943,7 +7974,6 @@ int sched_cpu_activate(unsigned int cpu) int sched_cpu_deactivate(unsigned int cpu) { struct rq *rq =3D cpu_rq(cpu); - struct rq_flags rf; int ret; =20 /* @@ -7974,20 +8004,14 @@ int sched_cpu_deactivate(unsigned int cpu) */ synchronize_rcu(); =20 - rq_lock_irqsave(rq, &rf); - if (rq->rd) { - BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); - set_rq_offline(rq); - } - rq_unlock_irqrestore(rq, &rf); + sched_set_rq_offline(rq, cpu); =20 -#ifdef CONFIG_SCHED_SMT /* * When going down, decrement the number of cores with SMT present. */ - if (cpumask_weight(cpu_smt_mask(cpu)) =3D=3D 2) - static_branch_dec_cpuslocked(&sched_smt_present); + sched_smt_present_dec(cpu); =20 +#ifdef CONFIG_SCHED_SMT sched_core_cpu_deactivate(cpu); #endif =20 @@ -7997,6 +8021,8 @@ int sched_cpu_deactivate(unsigned int cpu) sched_update_numa(cpu, false); ret =3D cpuset_cpu_inactive(cpu); if (ret) { + sched_smt_present_inc(cpu); + sched_set_rq_online(rq, cpu); balance_push_set(cpu, false); set_cpu_active(cpu, true); sched_update_numa(cpu, true); diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index a5e00293ae43..0bed0fa1acd9 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -582,6 +582,12 @@ void cputime_adjust(struct task_cputime *curr, struct pr= ev_cputime *prev, } =20 stime =3D mul_u64_u64_div_u64(stime, rtime, stime + utime); + /* + * Because mul_u64_u64_div_u64() can approximate on some + * achitectures; enforce the constraint that: a*b/(b+c) <=3D a. + */ + if (unlikely(stime > rtime)) + stime =3D rtime; =20 update: /* . Date: Sun, 4 Aug 2024 15:02:58 +0200 (CEST) From: Thomas Gleixner To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] timers/urgent for v6.11-rc2 Linus, please pull the latest timers/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-20= 24-08-04 up to: f2655ac2c06a: clocksource: Fix brown-bag boolean thinko in cs_watchdo= g_read() Two fixes for the timer/clocksource code: - The recent fix for making the take over of the broadcast timer more reliable retrieves a per CPU pointer in preemptible context. This went unnoticed in testing as some compilers hoist the access into the non-preemotible section where the pointer is actually used, but obviously compilers can rightfully invoke it where the code put it. Move it into the non-preemptible section right to the actual usage side to cure it. - The clocksource watchdog is supposed to emit a warning when the retry count is greater than one and the number of retries reaches the limit. The condition is backwards and warns always when the count is greater than one. Fixup the condition to prevent spamming dmesg. Thanks, tglx ------------------> Paul E. McKenney (1): clocksource: Fix brown-bag boolean thinko in cs_watchdog_read() Thomas Gleixner (1): tick/broadcast: Move per CPU pointer access into the atomic section kernel/time/clocksource.c | 2 +- kernel/time/tick-broadcast.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index d25ba49e313c..d0538a75f4c6 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -246,7 +246,7 @@ static enum wd_read_status cs_watchdog_read(struct clocks= ource *cs, u64 *csnow, =20 wd_delay =3D cycles_to_nsec_safe(watchdog, *wdnow, wd_end); if (wd_delay <=3D WATCHDOG_MAX_SKEW) { - if (nretries > 1 || nretries >=3D max_retries) { + if (nretries > 1 && nretries >=3D max_retries) { pr_warn("timekeeping watchdog on CPU%d: %s retried %d times before succe= ss\n", smp_processor_id(), watchdog->name, nretries); } diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index b4843099a8da..ed58eebb4e8f 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c @@ -1141,7 +1141,6 @@ void tick_broadcast_switch_to_oneshot(void) #ifdef CONFIG_HOTPLUG_CPU void hotplug_cpu__broadcast_tick_pull(int deadcpu) { - struct tick_device *td =3D this_cpu_ptr(&tick_cpu_device); struct clock_event_device *bc; unsigned long flags; =20 @@ -1167,6 +1166,8 @@ void hotplug_cpu__broadcast_tick_pull(int deadcpu) * device to avoid the starvation. */ if (tick_check_broadcast_expired()) { + struct tick_device *td =3D this_cpu_ptr(&tick_cpu_device); + cpumask_clear_cpu(smp_processor_id(), tick_broadcast_force_mask); tick_program_event(td->evtdev->next_event, 1); } . Date: Sun, 4 Aug 2024 15:03:00 +0200 (CEST) From: Thomas Gleixner To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] x86/urgent for v6.11-rc2 Linus, please pull the latest x86/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-2024-= 08-04 up to: dd35a0933269: x86/uaccess: Zero the 8-byte get_range case on failure = on 32-bit X86 fixes: - Prevent a deadlock on cpu_hotplug_lock in the aperf/mperf driver. A recent change in the ACPI code which consolidated code pathes moved the invocation of init_freq_invariance_cppc() to be moved to a CPU hotplug handler. The first invocation on AMD CPUs ends up enabling a static branch which dead locks because the static branch enable tries to acquire cpu_hotplug_lock but that lock is already held write by the hotplug machinery. Use static_branch_enable_cpuslocked() instead and take the hotplug lock read for the Intel code path which is invoked from the architecture code outside of the CPU hotplug operations. - Fix the number of reserved bits in the sev_config structure bit field so that the bitfield does not exceed 64 bit. - Add missing Zen5 model numbers - Fix the alignment assumptions of pti_clone_pgtable() and clone_entry_text() on 32-bit: The code assumes PMD aligned code sections, but on 32-bit the kernel entry text is not PMD aligned. So depending on the code size and location, which is configuration and compiler dependent, entry text can cross a PMD boundary. As the start is not PMD aligned adding PMD size to the start address is larger than the end address which results in partially mapped entry code for user space. That causes endless recursion on the first entry from userspace (usually #PF). Cure this by aligning the start address in the addition so it ends up at the next PMD start address. clone_entry_text() enforces PMD mapping, but on 32-bit the tail might eventually be PTE mapped, which causes a map fail because the PMD for the tail is not a large page mapping. Use PTI_LEVEL_KERNEL_IMAGE for the clone() invocation which resolves to PTE on 32-bit and PMD on 64-bit. - Zero the 8-byte case for get_user() on range check failure on 32-bit The recend consolidation of the 8-byte get_user() case broke the zeroing in the failure case again. Establish it by clearing ECX before the range check and not afterwards as that obvioulsy can't be reached when the range check fails =20 Thanks, tglx ------------------> Borislav Petkov (AMD) (1): x86/setup: Parse the builtin command line before merging David Gow (1): x86/uaccess: Zero the 8-byte get_range case on failure on 32-bit Jonathan Cameron (1): x86/aperfmperf: Fix deadlock on cpu_hotplug_lock Pavan Kumar Paluri (1): x86/sev: Fix __reserved field in sev_config Perry Yuan (1): x86/CPU/AMD: Add models 0x60-0x6f to the Zen5 range Peter Zijlstra (2): x86/mm: Fix pti_clone_pgtable() alignment assumption x86/mm: Fix pti_clone_entry_text() for i386 arch/x86/coco/sev/core.c | 2 +- arch/x86/include/asm/cmdline.h | 4 ++++ arch/x86/kernel/cpu/amd.c | 2 +- arch/x86/kernel/cpu/aperfmperf.c | 6 ++++-- arch/x86/kernel/setup.c | 2 +- arch/x86/lib/cmdline.c | 25 ++++++++++++++++++------- arch/x86/lib/getuser.S | 4 +++- arch/x86/mm/pti.c | 8 ++++---- 8 files changed, 36 insertions(+), 17 deletions(-) diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c index 082d61d85dfc..de1df0cb45da 100644 --- a/arch/x86/coco/sev/core.c +++ b/arch/x86/coco/sev/core.c @@ -163,7 +163,7 @@ struct sev_config { */ use_cas : 1, =20 - __reserved : 62; + __reserved : 61; }; =20 static struct sev_config sev_cfg __read_mostly; diff --git a/arch/x86/include/asm/cmdline.h b/arch/x86/include/asm/cmdline.h index 6faaf27e8899..6cbd9ae58b21 100644 --- a/arch/x86/include/asm/cmdline.h +++ b/arch/x86/include/asm/cmdline.h @@ -2,6 +2,10 @@ #ifndef _ASM_X86_CMDLINE_H #define _ASM_X86_CMDLINE_H =20 +#include + +extern char builtin_cmdline[COMMAND_LINE_SIZE]; + int cmdline_find_option_bool(const char *cmdline_ptr, const char *option); int cmdline_find_option(const char *cmdline_ptr, const char *option, char *buffer, int bufsize); diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index be5889bded49..1e0fe5f8ab84 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -462,7 +462,7 @@ static void bsp_init_amd(struct cpuinfo_x86 *c) switch (c->x86_model) { case 0x00 ... 0x2f: case 0x40 ... 0x4f: - case 0x70 ... 0x7f: + case 0x60 ... 0x7f: setup_force_cpu_cap(X86_FEATURE_ZEN5); break; default: diff --git a/arch/x86/kernel/cpu/aperfmperf.c b/arch/x86/kernel/cpu/aperfmper= f.c index b3fa61d45352..0b69bfbf345d 100644 --- a/arch/x86/kernel/cpu/aperfmperf.c +++ b/arch/x86/kernel/cpu/aperfmperf.c @@ -306,7 +306,7 @@ static void freq_invariance_enable(void) WARN_ON_ONCE(1); return; } - static_branch_enable(&arch_scale_freq_key); + static_branch_enable_cpuslocked(&arch_scale_freq_key); register_freq_invariance_syscore_ops(); pr_info("Estimated ratio of average max frequency by base frequency (times = 1024): %llu\n", arch_max_freq_ratio); } @@ -323,8 +323,10 @@ static void __init bp_init_freq_invariance(void) if (boot_cpu_data.x86_vendor !=3D X86_VENDOR_INTEL) return; =20 - if (intel_set_max_freq_ratio()) + if (intel_set_max_freq_ratio()) { + guard(cpus_read_lock)(); freq_invariance_enable(); + } } =20 static void disable_freq_invariance_workfn(struct work_struct *work) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 5d34cad9b7b1..6129dc2ba784 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -164,7 +164,7 @@ unsigned long saved_video_mode; =20 static char __initdata command_line[COMMAND_LINE_SIZE]; #ifdef CONFIG_CMDLINE_BOOL -static char __initdata builtin_cmdline[COMMAND_LINE_SIZE] =3D CONFIG_CMDLINE; +char builtin_cmdline[COMMAND_LINE_SIZE] =3D CONFIG_CMDLINE; bool builtin_cmdline_added __ro_after_init; #endif =20 diff --git a/arch/x86/lib/cmdline.c b/arch/x86/lib/cmdline.c index 384da1fdd5c6..c65cd5550454 100644 --- a/arch/x86/lib/cmdline.c +++ b/arch/x86/lib/cmdline.c @@ -207,18 +207,29 @@ __cmdline_find_option(const char *cmdline, int max_cmdl= ine_size, =20 int cmdline_find_option_bool(const char *cmdline, const char *option) { - if (IS_ENABLED(CONFIG_CMDLINE_BOOL)) - WARN_ON_ONCE(!builtin_cmdline_added); + int ret; =20 - return __cmdline_find_option_bool(cmdline, COMMAND_LINE_SIZE, option); + ret =3D __cmdline_find_option_bool(cmdline, COMMAND_LINE_SIZE, option); + if (ret > 0) + return ret; + + if (IS_ENABLED(CONFIG_CMDLINE_BOOL) && !builtin_cmdline_added) + return __cmdline_find_option_bool(builtin_cmdline, COMMAND_LINE_SIZE, opti= on); + + return ret; } =20 int cmdline_find_option(const char *cmdline, const char *option, char *buffe= r, int bufsize) { - if (IS_ENABLED(CONFIG_CMDLINE_BOOL)) - WARN_ON_ONCE(!builtin_cmdline_added); + int ret; + + ret =3D __cmdline_find_option(cmdline, COMMAND_LINE_SIZE, option, buffer, b= ufsize); + if (ret > 0) + return ret; + + if (IS_ENABLED(CONFIG_CMDLINE_BOOL) && !builtin_cmdline_added) + return __cmdline_find_option(builtin_cmdline, COMMAND_LINE_SIZE, option, b= uffer, bufsize); =20 - return __cmdline_find_option(cmdline, COMMAND_LINE_SIZE, option, - buffer, bufsize); + return ret; } diff --git a/arch/x86/lib/getuser.S b/arch/x86/lib/getuser.S index a314622aa093..d066aecf8aeb 100644 --- a/arch/x86/lib/getuser.S +++ b/arch/x86/lib/getuser.S @@ -88,12 +88,14 @@ SYM_FUNC_END(__get_user_4) EXPORT_SYMBOL(__get_user_4) =20 SYM_FUNC_START(__get_user_8) +#ifndef CONFIG_X86_64 + xor %ecx,%ecx +#endif check_range size=3D8 ASM_STAC #ifdef CONFIG_X86_64 UACCESS movq (%_ASM_AX),%rdx #else - xor %ecx,%ecx UACCESS movl (%_ASM_AX),%edx UACCESS movl 4(%_ASM_AX),%ecx #endif diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index 2e69abf4f852..bfdf5f45b137 100644 --- a/arch/x86/mm/pti.c +++ b/arch/x86/mm/pti.c @@ -374,14 +374,14 @@ pti_clone_pgtable(unsigned long start, unsigned long en= d, */ *target_pmd =3D *pmd; =20 - addr +=3D PMD_SIZE; + addr =3D round_up(addr + 1, PMD_SIZE); =20 } else if (level =3D=3D PTI_CLONE_PTE) { =20 /* Walk the page-table down to the pte level */ pte =3D pte_offset_kernel(pmd, addr); if (pte_none(*pte)) { - addr +=3D PAGE_SIZE; + addr =3D round_up(addr + 1, PAGE_SIZE); continue; } =20 @@ -401,7 +401,7 @@ pti_clone_pgtable(unsigned long start, unsigned long end, /* Clone the PTE */ *target_pte =3D *pte; =20 - addr +=3D PAGE_SIZE; + addr =3D round_up(addr + 1, PAGE_SIZE); =20 } else { BUG(); @@ -496,7 +496,7 @@ static void pti_clone_entry_text(void) { pti_clone_pgtable((unsigned long) __entry_text_start, (unsigned long) __entry_text_end, - PTI_CLONE_PMD); + PTI_LEVEL_KERNEL_IMAGE); } =20 /* . Date: Mon, 5 Aug 2024 12:00:33 +0200 From: Vlastimil Babka To: Linus Torvalds Cc: David Rientjes , Joonsoo Kim , Christoph Lameter , Pekka Enberg , Andrew Morton , "linux-mm@kvack.org" , LKML , patches@lists.linux.dev, Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Chengming Zhou , Rik van Riel Subject: [GIT PULL] slab fixes for 6.11-rc2 Hi Linus, please pull the latest slab hot-fixes from: git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git tags/slab-fixes-for-6.11-rc2 Thanks, Vlastimil ====================================== - Stable fix for KFENCE integration (Rik van Riel) Since v6.8 we've had a subtle breakage in SLUB with KFENCE enabled, that can cause a crash. It hasn't been found earlier due to quite specific conditions necessary (OOM during kmem_cache_alloc_bulk()). ---------------------------------------------------------------- Rik van Riel (1): mm, slub: do not call do_slab_free for kfence object mm/slub.c | 3 +++ 1 file changed, 3 insertions(+) . Date: Mon, 5 Aug 2024 15:08:10 -0600 From: Shuah Khan To: Linus Torvalds Cc: shuah , Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] Kselftest fixes update for Linux 6.11-rc3 This is a multi-part message in MIME format. --------------LlER0KbKGvSKZ6L4wyCWLfpp Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Linus, Please pull the kselftest fixes update for Linux 6.11-rc3. This kselftest fixes update consists of a single fix to the conditional in ksft.py script which incorrectly flags a test suite failed when there are skipped tests in the mix. The logic is fixed to take skipped tests into account and report the test as passed. diff is attached. thanks, -- Shuah ---------------------------------------------------------------- The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-fixes-6.11-rc3 for you to fetch changes up to 170c966cbe274e664288cfc12ee919d5e706dc50: selftests: ksft: Fix finished() helper exit code on skipped tests (2024-07-31 11:38:56 -0600) ---------------------------------------------------------------- linux_kselftest-fixes-6.11-rc3 This kselftest fixes update consists of a single fix to the conditional in ksft.py script which incorrectly flags a test suite failed when there are skipped tests in the mix. The logic is fixed to take skipped tests into account and report the test as passed. ---------------------------------------------------------------- Laura Nao (1): selftests: ksft: Fix finished() helper exit code on skipped tests tools/testing/selftests/kselftest/ksft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------- --------------LlER0KbKGvSKZ6L4wyCWLfpp Content-Type: text/x-patch; charset=UTF-8; name="linux_kselftest-fixes-6.11-rc3.diff" Content-Disposition: attachment; filename="linux_kselftest-fixes-6.11-rc3.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3Rvb2xzL3Rlc3Rpbmcvc2VsZnRlc3RzL2tzZWxmdGVzdC9rc2Z0LnB5 IGIvdG9vbHMvdGVzdGluZy9zZWxmdGVzdHMva3NlbGZ0ZXN0L2tzZnQucHkKaW5kZXggY2Q4 OWZiMmJjMTBlLi5iZjIxNTc5MGE4OWQgMTAwNjQ0Ci0tLSBhL3Rvb2xzL3Rlc3Rpbmcvc2Vs ZnRlc3RzL2tzZWxmdGVzdC9rc2Z0LnB5CisrKyBiL3Rvb2xzL3Rlc3Rpbmcvc2VsZnRlc3Rz L2tzZWxmdGVzdC9rc2Z0LnB5CkBAIC03MCw3ICs3MCw3IEBAIGRlZiB0ZXN0X3Jlc3VsdChj b25kaXRpb24sIGRlc2NyaXB0aW9uPSIiKToKIAogCiBkZWYgZmluaXNoZWQoKToKLSAgICBp ZiBrc2Z0X2NudFsicGFzcyJdID09IGtzZnRfbnVtX3Rlc3RzOgorICAgIGlmIGtzZnRfY250 WyJwYXNzIl0gKyBrc2Z0X2NudFsic2tpcCJdID09IGtzZnRfbnVtX3Rlc3RzOgogICAgICAg ICBleGl0X2NvZGUgPSBLU0ZUX1BBU1MKICAgICBlbHNlOgogICAgICAgICBleGl0X2NvZGUg PSBLU0ZUX0ZBSUwK --------------LlER0KbKGvSKZ6L4wyCWLfpp-- . Date: Tue, 06 Aug 2024 09:40:38 +0300 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: Linus Torvalds Cc: LKML , PDx86 , Hans de Goede , Andy Shevchenko Subject: [GIT PULL] platform-drivers-x86 for v6.11-2 Hi Linus, Here is a platform-drivers-x86 fixes PR for v6.11. Fixes: - intel-vbtn: ACPI notifier racing with itself. - intel/ifs: Init local variable to cover a timeout corner case. - WMI docs spelling New HW Support: - amd/{pmc,pmf}: AMD 1Ah model 60h series. - amd/pmf: SPS quirk support for ASUS ROG Ally X Regards, i. The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git tags/platform-drivers-x86-v6.11-2 for you to fetch changes up to 3114f77e9453daa292ec0906f313a715c69b5943: platform/x86/intel/ifs: Initialize union ifs_status to zero (2024-07-31 12:37:34 +0300) ---------------------------------------------------------------- platform-drivers-x86 for v6.11-2 Fixes: - intel-vbtn: ACPI notifier racing with itself. - intel/ifs: Init local variable to cover a timeout corner case. - WMI docs spelling New HW Support: - amd/{pmc,pmf}: AMD 1Ah model 60h series. - amd/pmf: SPS quirk support for ASUS ROG Ally X The following is an automated shortlog grouped by driver: amd/pmc: - Send OS_HINT command for new AMD platform amd/pmf: - Add new ACPI ID AMDI0107 amd: pmf: - Add quirk for ROG Ally X intel/ifs: - Initialize union ifs_status to zero intel-vbtn: - Protect ACPI notify handler against recursion msi-wmi-platform: - Fix spelling mistakes ---------------------------------------------------------------- Hans de Goede (1): platform/x86: intel-vbtn: Protect ACPI notify handler against recursion Kuppuswamy Sathyanarayanan (1): platform/x86/intel/ifs: Initialize union ifs_status to zero Luis Felipe Hernandez (1): platform/x86: msi-wmi-platform: Fix spelling mistakes Luke D. Jones (1): platform/x86/amd: pmf: Add quirk for ROG Ally X Shyam Sundar S K (2): platform/x86/amd/pmc: Send OS_HINT command for new AMD platform platform/x86/amd/pmf: Add new ACPI ID AMDI0107 Documentation/wmi/devices/msi-wmi-platform.rst | 6 +++--- drivers/platform/x86/amd/pmc/pmc.c | 2 ++ drivers/platform/x86/amd/pmc/pmc.h | 1 + drivers/platform/x86/amd/pmf/core.c | 3 +++ drivers/platform/x86/amd/pmf/pmf-quirks.c | 9 ++++++++- drivers/platform/x86/intel/ifs/runtest.c | 2 +- drivers/platform/x86/intel/vbtn.c | 9 +++++++++ 7 files changed, 27 insertions(+), 5 deletions(-) . Date: Tue, 6 Aug 2024 07:26:59 -0500 From: Nishanth Menon To: Olof Johansson , Arnd Bergmann , , Subject: [GIT PULL] arm64: dts: TI K3 fixes for v6.11 --vwawzq3tw7tz25jq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi SoC maintainers, Please find DT fixups for the v6.11 rc cycle - This tag includes the previous late PR https://patchwork.kernel.org/project/linux-soc/patch/aacd1e96-9ff4-4222-9f4= d-29e63041f7fb@ti.com/ The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git tags/ti-k3-d= t-fixes-for-v6.11 for you to fetch changes up to 402d336053a5d827c70ec11109e079811e86e0e8: arm64: dts: ti: k3-j784s4-main: Correct McASP DMAs (2024-08-06 06:39:23 -= 0500) ---------------------------------------------------------------- Devicetree fixes for TI K3 platforms for v6.11 Critical fixes for the following: * j784s4: Fix for McASP DMA map * J722s/AM62p: GPIO ranges fixes * k3-am62-verdin-dahlia: sleep-moci fixes for deep-sleep (revert) ---------------------------------------------------------------- Andrew Halaney (2): arm64: dts: ti: k3-j784s4-evm: Assign only lanes 0 and 1 to PCIe1 arm64: dts: ti: k3-j784s4-evm: Consolidate serdes0 references Francesco Dolcini (1): arm64: dts: ti: k3-am62-verdin-dahlia: Keep CTRL_SLEEP_MOCI# regulato= r on Jared McArthur (3): arm64: dts: ti: k3-am62p: Add gpio-ranges for mcu_gpio0 arm64: dts: ti: k3-am62p: Fix gpio-range for main_pmx0 arm64: dts: ti: k3-j722s: Fix gpio-range for main_pmx0 Nishanth Menon (1): Merge tag 'ti-k3-dt-for-v6.11-part2' into ti-k3-dts-next Parth Pancholi (1): arm64: dts: ti: k3-j784s4-main: Correct McASP DMAs arch/arm64/boot/dts/ti/k3-am62-verdin-dahlia.dtsi | 22 ------------------- arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi | 6 ------ .../boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi | 2 ++ arch/arm64/boot/dts/ti/k3-am62p-main.dtsi | 3 ++- arch/arm64/boot/dts/ti/k3-j722s-main.dtsi | 3 ++- arch/arm64/boot/dts/ti/k3-j784s4-evm.dts | 25 +++++++-----------= ---- arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi | 4 ++-- 7 files changed, 16 insertions(+), 49 deletions(-) --=20 Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5= 849D 1736 249D --vwawzq3tw7tz25jq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE+KKGk1TrgjIXoxo03bWEnRc2JJ0FAmayFo0ACgkQ3bWEnRc2 JJ1oKg/9EAHR8Cr6XyueByC0qUGUvjv4gHQMRRx22PRE5uyMvWjIkTfN9I4q8Sfa HtG3o6J5TBeGm4DytawgYf++CqQsAE08jfednrkeUwV/NF1jkbtWIJTe3e2OI/n1 agWFDlJtKHLJwM8QqqtagczKypM8mbl50OU7Pdqgh2Nf06fUFe7/Q98SH8H62/S+ YCNEp0XZW5rfh167lc0yp9M0RZiFCna/IlM5MbFr7UMkOuzSd91G2cKq3IKqaR8g HHIoXacueiOIeqB4vjweTKAFP23Lwp4Yx4gzyMXyvmtSTl8l37JyCjskx941v4XR QeGPtLJJ4osPom3yNgy9LgerVPpv4+9ayFJBImmm9EKCVTCIZMfLDOnEZXoZveFx u8XMegLIXRNtbBtzdWjjsKm12hC4DIonqPiVriPdoxc3L0cTLEnuW4zx7hyHtlfR f+hgVcO+MuJ6UUWEZgsXkVkCeS5sSkwtJT+ssHUOV4e16/ttt60PCdjCNDVNbJ+c j3WS/49CZ2A9+gKOYhFVne0yOhjQvRkIu2e0nc9qqea/YB1tMXDI8qPfjbZPeeeq VPCKmhJ3XF1eeN4D6QmSHi10Fe4OxHTwGnJC9opxYR+xbspumxfI0Hp6YMo8XYbP Pk+SCtMczevJKc8E5ihVKBo5YUqYr8jpYMSkLE+MVVf11c8Pbj4= =XSOH -----END PGP SIGNATURE----- --vwawzq3tw7tz25jq-- . Date: Tue, 6 Aug 2024 23:35:01 +0200 From: Sebastian Reichel To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [GIT PULL] power-supply changes for 6.11-rc3 --ixfyut5kjxo53sav Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Linus, The following changes since commit 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0: Linux 6.10-rc1 (2024-05-26 15:20:12 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git tags/for-v6.11-rc for you to fetch changes up to d6cca7631a4b54a8995e3bc53e5afb11d3b0c8ff: power: supply: qcom_battmgr: Ignore extra __le32 in info payload (2024-07-27 00:18:40 +0200) ---------------------------------------------------------------- Power Supply Fixes for 6.11 cycle * rt5033: fix driver regression causing kernel oops * axp288-charger: fix charge voltage setup * qcom-battmgr: fix thermal zone spamming errors * qcom-battmgr: fix init on Qualcomm X Elite ---------------------------------------------------------------- Hans de Goede (2): power: supply: axp288_charger: Fix constant_charge_voltage writes power: supply: axp288_charger: Round constant_charge_voltage writes down Neil Armstrong (1): power: supply: qcom_battmgr: return EAGAIN when firmware service is not up Nikita Travkin (1): power: supply: rt5033: Bring back i2c_set_clientdata Stephan Gerhold (1): power: supply: qcom_battmgr: Ignore extra __le32 in info payload drivers/power/supply/axp288_charger.c | 24 ++++++++++++------------ drivers/power/supply/qcom_battmgr.c | 12 +++++++----- drivers/power/supply/rt5033_battery.c | 1 + 3 files changed, 20 insertions(+), 17 deletions(-) --ixfyut5kjxo53sav Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmaylwQACgkQ2O7X88g7 +polKA//VycZvY96wXNSB4eLTUJIudH6BWB0n7gypu5ln5d/zM4YAoaFCwy9K0y3 iBoJopFeX/N1mOhRLhYbNCvAOfj1YSGcC6HJ3NKre5ALMzpVplpOTtxjuPhxxmWL ZlLCA2sJNozYySip9jPq6kOgsk/GvEMckoqb/r4l/6lkuMZHva0uM4BUZZ5TgzyQ jO3WJxVRtJ/2Gzz7s0Z2CFIVFBiCaoZZzWpWqzJBqYbDd3FfgPbECPFUpxMURgjd gpCEmDVF0QdJY5ncksMgWEbk1Xe8vp8ppvo2Usf29x+ohbMpps6nVoO6T+11vc/p LQUQtNV9YZpRj1beqzCzNAR3MTNeCXJJC2cK5nTOxa2or5vVGoKnAAb8Da9kvzBJ NUTq7b8sx35rOFWr5QFal+f+i3zyfJ7vHyXLoxuubRyXSKp5LW6P0o9YgcRYr2qu vTwZY7+XoLf9+tjEg3s3MxNMe4m91ywLT0XSEa/yyk9K5+uVAL5cM8cWrN7hbUqA oonKeXd3hUShIhFvyre2LfajEBjmaJJLXvl7Zvzh7FG2GPXOPxedeWTgrJIhchwr l3olSw3cLZjaRFRxKxeRkYyxV8PxHbsJQZR01QyFDouVRNiOaLXjgS/kq0G+X4Iy jPPMtMr1LKWo0pbo8Th4NLrM1XWrtqIMZ/GOce9Q5yc4kY2gjd0= =3gdF -----END PGP SIGNATURE----- --ixfyut5kjxo53sav-- . Date: Wed, 7 Aug 2024 15:40:22 +0200 From: David Sterba To: torvalds@linux-foundation.org Cc: David Sterba , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] Btrfs fixes for 6.11-rc3 Hi, a few regular fixes. Please pull, thanks. - fix double inode unlock for direct IO sync writes (reported by syzbot) - fix root tree id/name map definitions, don't use fixed size buffers for name (reported by -Werror=unterminated-string-initialization) - fix qgroup reserve leaks in bufferd write path - update scrub status structure more often so it can be reported in user space more accurately and let 'resume' not repeat work - in preparation to remove space chache v1 in the future print a warning if it's detected ---------------------------------------------------------------- The following changes since commit b8e947e9f64cac9df85a07672b658df5b2bcff07: btrfs: initialize location to fix -Wmaybe-uninitialized in btrfs_lookup_dentry() (2024-07-30 15:33:06 +0200) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git tags/for-6.11-rc2-tag for you to fetch changes up to 12653ec36112ab55fa06c01db7c4432653d30a8d: btrfs: avoid using fixed char array size for tree names (2024-08-02 22:44:27 +0200) ---------------------------------------------------------------- Boris Burkov (2): btrfs: implement launder_folio for clearing dirty page reserve btrfs: fix qgroup reserve leaks in cow_file_range Filipe Manana (1): btrfs: fix double inode unlock for direct IO sync writes Josef Bacik (1): btrfs: emit a warning about space cache v1 being deprecated Qu Wenruo (3): btrfs: factor out stripe length calculation into a helper btrfs: scrub: update last_physical after scrubbing one stripe btrfs: avoid using fixed char array size for tree names fs/btrfs/file.c | 5 ++++- fs/btrfs/inode.c | 10 ++++++++++ fs/btrfs/print-tree.c | 2 +- fs/btrfs/scrub.c | 25 +++++++++++++++++++------ fs/btrfs/super.c | 5 ++++- 5 files changed, 38 insertions(+), 9 deletions(-) . Date: Wed, 7 Aug 2024 20:28:07 -0700 From: Andrew Morton To: Linus Torvalds Cc: mm-commits@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [GIT PULL] hotfixes for 6.11-rc2 Linus, please merge this batch of hotfixes, thanks. The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm tags/mm-hotfixes-stable-2024-08-07-18-32 for you to fetch changes up to 6d45e1c948a8b7ed6ceddb14319af69424db730c: padata: Fix possible divide-by-0 panic in padata_mt_helper() (2024-08-07 18:33:56 -0700) ---------------------------------------------------------------- 9 hotfixes. 5 are cc:stable, 4 either pertain to post-6.10 material or aren't considered necessary for earlier kernels. 5 are MM and 4 are non-MM. No identifiable theme here - please see the individual changelogs. ---------------------------------------------------------------- Andrey Konovalov (1): kcov: properly check for softirq context Baolin Wang (2): mm: shmem: avoid allocating huge pages larger than MAX_PAGECACHE_ORDER for shmem mm: shmem: fix incorrect aligned index when checking conflicts David Heidelberg (1): mailmap: update entry for David Heidelberg Muchun Song (1): mm: list_lru: fix UAF for memory cgroup Nico Pache (1): selftests: mm: add s390 to ARCH check Petr Vorel (1): MAINTAINERS: Update LTP members and web Shakeel Butt (1): memcg: protect concurrent access to mem_cgroup_idr Waiman Long (1): padata: Fix possible divide-by-0 panic in padata_mt_helper() .mailmap | 1 + MAINTAINERS | 4 +++- kernel/kcov.c | 15 ++++++++++++--- kernel/padata.c | 7 +++++++ mm/list_lru.c | 28 ++++++++++++++++++++++------ mm/memcontrol.c | 22 ++++++++++++++++++++-- mm/shmem.c | 14 +++++--------- tools/testing/selftests/mm/Makefile | 2 +- 8 files changed, 71 insertions(+), 22 deletions(-) . Date: Wed, 7 Aug 2024 20:39:25 -0700 From: Boqun Feng To: peterz@infradead.org, mingo@redhat.com Cc: will@kernel.org, longman@redhat.com, boqun.feng@gmail.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, paulmck@kernel.org, frederic@kernel.org, josh@joshtriplett.org, neeraj.iitr10@gmail.com, urezki@gmail.com, rcu@vger.kernel.org Subject: [GIT PULL] LOCKDEP changes for v6.12 Hi Peter & Ingo, Per discussion: https://lore.kernel.org/lkml/20240802151619.GN39708@noisy.programming.kicks-ass.net/ I'm sending a PR with some lockdep changes to tip. The following changes since commit d5934e76316e84eced836b6b2bafae1837d1cd58: cleanup: Add usage and style documentation (2024-08-05 16:54:41 +0200) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux tags/lockdep-for-tip.20240806 for you to fetch changes up to 39dea484e2bb9066abbc01e2c5e03b6917b0b775: locking/lockdep: Simplify character output in seq_line() (2024-08-06 10:46:43 -0700) I've reviewed and tested these changes from my end, but since I don't have a branch tracked by linux-next, so that part of testing is missing. It does pass the 0day build test though. RCU is Cced since I believe patch: lockdep: fix deadlock issue between lockdep and rcu is also queued in the upcoming RCU PR for v6.12. However, since it's a bug fix in lockdep, I feel it makes more sense to go via tip. Worst case, git merge will eventually find the duplicate commit, so not a problem. I'm doing this "sub-maintenance" via a PR, but I'm also OK to send them as patch series, whatever makes your life easier. ;-) Also since this is a sub-maintenance, I plan to stop pusing anything new after -rc2 for a particular release (i.e. anything new after -rc3 will be in a PR from me in the later release), mostly due to lockdep shouldn't have anything urgent (famous last words though), and give you guys more time to prepare the PRs from the tip tree, but again I'm open to any suggestion as well. ---------------------------------------------------------------- Lockdep changes for v6.12: - Fixes a deadlock in lockdep by avoiding calling rcu with the graph lock held. - Uses str_plural() to fix Coccinelle warning. - Uses seq_putc() instead of seq_printf() to print a single character in lockdep proc file. Regards, Boqun ---------------------------------------------------------------- Markus Elfring (1): locking/lockdep: Simplify character output in seq_line() Thorsten Blum (1): lockdep: Use str_plural() to fix Coccinelle warning Zhiguo Niu (1): lockdep: fix deadlock issue between lockdep and rcu kernel/locking/lockdep.c | 50 ++++++++++++++++++++++++++++--------------- kernel/locking/lockdep_proc.c | 2 +- 2 files changed, 34 insertions(+), 18 deletions(-) . Date: Thu, 8 Aug 2024 19:24:37 +0800 From: Huacai Chen To: Linus Torvalds , Arnd Bergmann , Huacai Chen Cc: loongarch@lists.linux.dev, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Guo Ren , Xuerui Wang , Jiaxun Yang , Huacai Chen Subject: [GIT PULL] LoongArch fixes for v6.11-rc3 The following changes since commit de9c2c66ad8e787abec7c9d7eff4f8c3cdd28aed: Linux 6.11-rc2 (2024-08-04 13:50:53 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git tags/loongarch-fixes-6.11-1 for you to fetch changes up to 494b0792d962e8efac72b3a5b6d9bcd4e6fa8cf0: LoongArch: KVM: Remove undefined a6 argument comment for kvm_hypercall() (2024-08-07 17:37:14 +0800) ---------------------------------------------------------------- LoongArch fixes for v6.11-rc3 Enable general EFI poweroff method to make poweroff usable on hardwares which lack ACPI S5, use accessors to page table entries instead of direct dereference to avoid potential problems, and two trivial kvm cleanups. ---------------------------------------------------------------- Dandan Zhang (1): LoongArch: KVM: Remove undefined a6 argument comment for kvm_hypercall() Huacai Chen (1): LoongArch: Use accessors to page table entries instead of direct dereference Miao Wang (1): LoongArch: Enable general EFI poweroff method Yuli Wang (1): LoongArch: KVM: Remove unnecessary definition of KVM_PRIVATE_MEM_SLOTS arch/loongarch/include/asm/hugetlb.h | 4 +-- arch/loongarch/include/asm/kfence.h | 6 ++--- arch/loongarch/include/asm/kvm_host.h | 2 -- arch/loongarch/include/asm/kvm_para.h | 4 +-- arch/loongarch/include/asm/pgtable.h | 48 +++++++++++++++++++++-------------- arch/loongarch/kernel/efi.c | 6 +++++ arch/loongarch/kvm/mmu.c | 8 +++--- arch/loongarch/mm/hugetlbpage.c | 6 ++--- arch/loongarch/mm/init.c | 10 ++++---- arch/loongarch/mm/kasan_init.c | 10 ++++---- arch/loongarch/mm/pgtable.c | 2 +- 11 files changed, 60 insertions(+), 46 deletions(-) . Date: Thu, 8 Aug 2024 11:32:58 -0400 From: Kent Overstreet To: Linus Torvalds Cc: linux-bcachefs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] bcachefs fixes for 6.11-rc3 Hi Linus, couple little ones for you... The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://evilpiepirate.org/bcachefs.git tags/bcachefs-2024-08-08 for you to fetch changes up to 73dc1656f41a42849e43b945fe44d4e3d55eb6c3: bcachefs: Use bch2_wait_on_allocator() in btree node alloc path (2024-08-07 21:04:55 -0400) ---------------------------------------------------------------- bcachefs fixes for 6.11-rc3 Assorted little stuff: - lockdep fixup for lockdep_set_notrack_class() - we can now remove a device when using erasure coding without deadlocking, though we still hit other issues - the "allocator stuck" timeout is now configurable, and messages are ratelimited; default timeout has been increased from 10 seconds to 30 ---------------------------------------------------------------- Kent Overstreet (10): bcachefs: Fix double free of ca->buckets_nouse lockdep: Fix lockdep_set_notrack_class() for CONFIG_LOCK_STAT bcachefs: Don't rely on implicit unsigned -> signed integer conversion bcachefs: Add a comment for bucket helper types bcachefs: Add missing bch2_trans_begin() call bcachefs: Improved allocator debugging for ec bcachefs: ec should not allocate from ro devs bcachefs: Add missing path_traverse() to btree_iter_next_node() bcachefs: Make allocator stuck timeout configurable, ratelimit messages bcachefs: Use bch2_wait_on_allocator() in btree node alloc path fs/bcachefs/alloc_background.h | 12 ++++++++++-- fs/bcachefs/alloc_foreground.c | 32 ++++++++++++++++++++++++++++---- fs/bcachefs/alloc_foreground.h | 9 +++++++-- fs/bcachefs/bcachefs.h | 2 ++ fs/bcachefs/bcachefs_format.h | 2 ++ fs/bcachefs/btree_iter.c | 5 +++++ fs/bcachefs/btree_update_interior.c | 2 +- fs/bcachefs/ec.c | 34 +++++++++++++++++++++++----------- fs/bcachefs/io_misc.c | 6 +----- fs/bcachefs/io_read.c | 1 + fs/bcachefs/io_write.c | 5 +---- fs/bcachefs/opts.h | 5 +++++ fs/bcachefs/super-io.c | 4 ++++ fs/bcachefs/super.c | 1 - fs/bcachefs/sysfs.c | 6 +++++- kernel/locking/lockdep.c | 6 ++++++ 16 files changed, 101 insertions(+), 31 deletions(-) . Date: Thu, 8 Aug 2024 12:21:08 -0400 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Masami Hiramatsu , Mathieu Desnoyers , Mark Rutland , Jianhui Zhou <912460177@qq.com>, Mathias Krause , Petr Pavlu , Tze-nan Wu Subject: [GIT PULL] tracing: Updates for 6.11-rc2 Linus, tracing fixes for v6.11: - Have reading of event format files test if the meta data still exists. When an event is freed, a flag (EVENT_FILE_FL_FREED) in the meta data is set to state that it is to prevent any new references to it from happening while waiting for existing references to close. When the last reference closes, the meta data is freed. But the "format" file was missing a check to this flag (along with some other files) that allowed new references to happen, and a use-after-free bug to occur. - Have the trace event meta data use the refcount infrastructure instead of relying on its own atomic counters. - Have tracefs inodes use alloc_inode_sb() for allocation instead of using kmem_cache_alloc() directly. - Have eventfs_create_dir() return an ERR_PTR instead of NULL as the callers expect a real object or an ERR_PTR. - Have release_ei() use call_srcu() and not call_rcu() as all the protection is on SRCU and not RCU. - Fix ftrace_graph_ret_addr() to use the task passed in and not current. - Fix overflow bug in get_free_elt() where the counter can overflow the integer and cause an infinite loop. - Remove unused function ring_buffer_nr_pages() - Have tracefs freeing use the inode RCU infrastructure instead of creating its own. When the kernel had randomize structure fields enabled, the rcu field of the tracefs_inode was overlapping the rcu field of the inode structure, and corrupting it. Instead, use the destroy_inode() callback to do the initial cleanup of the code, and then have free_inode() free it. Please pull the latest trace-v6.11-rc2 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-v6.11-rc2 Tag SHA1: 511ef7e0a9da29a1d9a120a99630152d9c779ee3 Head SHA1: 0b6743bd60a56a701070b89fb80c327a44b7b3e2 Jianhui Zhou (1): ring-buffer: Remove unused function ring_buffer_nr_pages() Mathias Krause (3): tracefs: Fix inode allocation eventfs: Don't return NULL in eventfs_create_dir() eventfs: Use SRCU for freeing eventfs_inodes Petr Pavlu (1): function_graph: Fix the ret_stack used by ftrace_graph_ret_addr() Steven Rostedt (3): tracing: Have format file honor EVENT_FILE_FL_FREED tracing: Use refcount for trace_event_file reference counter tracefs: Use generic inode RCU for synchronizing freeing Tze-nan Wu (1): tracing: Fix overflow in get_free_elt() ---- fs/tracefs/event_inode.c | 4 ++-- fs/tracefs/inode.c | 12 +++++------ fs/tracefs/internal.h | 5 +---- include/linux/ring_buffer.h | 1 - include/linux/trace_events.h | 2 +- kernel/trace/fgraph.c | 2 +- kernel/trace/ring_buffer.c | 12 ----------- kernel/trace/trace.h | 23 +++++++++++++++++++++ kernel/trace/trace_events.c | 41 ++++++++++++++++++++++--------------- kernel/trace/trace_events_hist.c | 4 ++-- kernel/trace/trace_events_inject.c | 2 +- kernel/trace/trace_events_trigger.c | 6 +++--- kernel/trace/tracing_map.c | 6 +++--- 13 files changed, 66 insertions(+), 54 deletions(-) --------------------------- diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 5d88c184f0fc..01e99e98457d 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -112,7 +112,7 @@ static void release_ei(struct kref *ref) entry->release(entry->name, ei->data); } - call_rcu(&ei->rcu, free_ei_rcu); + call_srcu(&eventfs_srcu, &ei->rcu, free_ei_rcu); } static inline void put_ei(struct eventfs_inode *ei) @@ -736,7 +736,7 @@ struct eventfs_inode *eventfs_create_dir(const char *name, struct eventfs_inode /* Was the parent freed? */ if (list_empty(&ei->list)) { cleanup_ei(ei); - ei = NULL; + ei = ERR_PTR(-EBUSY); } return ei; } diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c index 1028ab6d9a74..1748dff58c3b 100644 --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@ -42,7 +42,7 @@ static struct inode *tracefs_alloc_inode(struct super_block *sb) struct tracefs_inode *ti; unsigned long flags; - ti = kmem_cache_alloc(tracefs_inode_cachep, GFP_KERNEL); + ti = alloc_inode_sb(sb, tracefs_inode_cachep, GFP_KERNEL); if (!ti) return NULL; @@ -53,15 +53,14 @@ static struct inode *tracefs_alloc_inode(struct super_block *sb) return &ti->vfs_inode; } -static void tracefs_free_inode_rcu(struct rcu_head *rcu) +static void tracefs_free_inode(struct inode *inode) { - struct tracefs_inode *ti; + struct tracefs_inode *ti = get_tracefs(inode); - ti = container_of(rcu, struct tracefs_inode, rcu); kmem_cache_free(tracefs_inode_cachep, ti); } -static void tracefs_free_inode(struct inode *inode) +static void tracefs_destroy_inode(struct inode *inode) { struct tracefs_inode *ti = get_tracefs(inode); unsigned long flags; @@ -69,8 +68,6 @@ static void tracefs_free_inode(struct inode *inode) spin_lock_irqsave(&tracefs_inode_lock, flags); list_del_rcu(&ti->list); spin_unlock_irqrestore(&tracefs_inode_lock, flags); - - call_rcu(&ti->rcu, tracefs_free_inode_rcu); } static ssize_t default_read_file(struct file *file, char __user *buf, @@ -437,6 +434,7 @@ static int tracefs_drop_inode(struct inode *inode) static const struct super_operations tracefs_super_operations = { .alloc_inode = tracefs_alloc_inode, .free_inode = tracefs_free_inode, + .destroy_inode = tracefs_destroy_inode, .drop_inode = tracefs_drop_inode, .statfs = simple_statfs, .show_options = tracefs_show_options, diff --git a/fs/tracefs/internal.h b/fs/tracefs/internal.h index f704d8348357..d83c2a25f288 100644 --- a/fs/tracefs/internal.h +++ b/fs/tracefs/internal.h @@ -10,10 +10,7 @@ enum { }; struct tracefs_inode { - union { - struct inode vfs_inode; - struct rcu_head rcu; - }; + struct inode vfs_inode; /* The below gets initialized with memset_after(ti, 0, vfs_inode) */ struct list_head list; unsigned long flags; diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index 96d2140b471e..fd35d4ec12e1 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h @@ -193,7 +193,6 @@ void ring_buffer_set_clock(struct trace_buffer *buffer, void ring_buffer_set_time_stamp_abs(struct trace_buffer *buffer, bool abs); bool ring_buffer_time_stamp_abs(struct trace_buffer *buffer); -size_t ring_buffer_nr_pages(struct trace_buffer *buffer, int cpu); size_t ring_buffer_nr_dirty_pages(struct trace_buffer *buffer, int cpu); struct buffer_data_read_page; diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h index 9df3e2973626..fed58e54f15e 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -680,7 +680,7 @@ struct trace_event_file { * caching and such. Which is mostly OK ;-) */ unsigned long flags; - atomic_t ref; /* ref count for opened files */ + refcount_t ref; /* ref count for opened files */ atomic_t sm_ref; /* soft-mode reference counter */ atomic_t tm_ref; /* trigger-mode reference counter */ }; diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c index fc205ad167a9..d1d5ea2d0a1b 100644 --- a/kernel/trace/fgraph.c +++ b/kernel/trace/fgraph.c @@ -902,7 +902,7 @@ unsigned long ftrace_graph_ret_addr(struct task_struct *task, int *idx, i = *idx ? : task->curr_ret_stack; while (i > 0) { - ret_stack = get_ret_stack(current, i, &i); + ret_stack = get_ret_stack(task, i, &i); if (!ret_stack) break; /* diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 28853966aa9a..cebd879a30cb 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -692,18 +692,6 @@ u64 ring_buffer_event_time_stamp(struct trace_buffer *buffer, return ts; } -/** - * ring_buffer_nr_pages - get the number of buffer pages in the ring buffer - * @buffer: The ring_buffer to get the number of pages from - * @cpu: The cpu of the ring_buffer to get the number of pages from - * - * Returns the number of pages used by a per_cpu buffer of the ring buffer. - */ -size_t ring_buffer_nr_pages(struct trace_buffer *buffer, int cpu) -{ - return buffer->buffers[cpu]->nr_pages; -} - /** * ring_buffer_nr_dirty_pages - get the number of used pages in the ring buffer * @buffer: The ring_buffer to get the number of pages from diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 8783bebd0562..bd3e3069300e 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -1634,6 +1634,29 @@ static inline void *event_file_data(struct file *filp) extern struct mutex event_mutex; extern struct list_head ftrace_events; +/* + * When the trace_event_file is the filp->i_private pointer, + * it must be taken under the event_mutex lock, and then checked + * if the EVENT_FILE_FL_FREED flag is set. If it is, then the + * data pointed to by the trace_event_file can not be trusted. + * + * Use the event_file_file() to access the trace_event_file from + * the filp the first time under the event_mutex and check for + * NULL. If it is needed to be retrieved again and the event_mutex + * is still held, then the event_file_data() can be used and it + * is guaranteed to be valid. + */ +static inline struct trace_event_file *event_file_file(struct file *filp) +{ + struct trace_event_file *file; + + lockdep_assert_held(&event_mutex); + file = READ_ONCE(file_inode(filp)->i_private); + if (!file || file->flags & EVENT_FILE_FL_FREED) + return NULL; + return file; +} + extern const struct file_operations event_trigger_fops; extern const struct file_operations event_hist_fops; extern const struct file_operations event_hist_debug_fops; diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 6ef29eba90ce..7266ec2a4eea 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -992,18 +992,18 @@ static void remove_subsystem(struct trace_subsystem_dir *dir) void event_file_get(struct trace_event_file *file) { - atomic_inc(&file->ref); + refcount_inc(&file->ref); } void event_file_put(struct trace_event_file *file) { - if (WARN_ON_ONCE(!atomic_read(&file->ref))) { + if (WARN_ON_ONCE(!refcount_read(&file->ref))) { if (file->flags & EVENT_FILE_FL_FREED) kmem_cache_free(file_cachep, file); return; } - if (atomic_dec_and_test(&file->ref)) { + if (refcount_dec_and_test(&file->ref)) { /* Count should only go to zero when it is freed */ if (WARN_ON_ONCE(!(file->flags & EVENT_FILE_FL_FREED))) return; @@ -1386,12 +1386,12 @@ event_enable_read(struct file *filp, char __user *ubuf, size_t cnt, char buf[4] = "0"; mutex_lock(&event_mutex); - file = event_file_data(filp); + file = event_file_file(filp); if (likely(file)) flags = file->flags; mutex_unlock(&event_mutex); - if (!file || flags & EVENT_FILE_FL_FREED) + if (!file) return -ENODEV; if (flags & EVENT_FILE_FL_ENABLED && @@ -1424,8 +1424,8 @@ event_enable_write(struct file *filp, const char __user *ubuf, size_t cnt, case 1: ret = -ENODEV; mutex_lock(&event_mutex); - file = event_file_data(filp); - if (likely(file && !(file->flags & EVENT_FILE_FL_FREED))) { + file = event_file_file(filp); + if (likely(file)) { ret = tracing_update_buffers(file->tr); if (ret < 0) { mutex_unlock(&event_mutex); @@ -1540,7 +1540,8 @@ enum { static void *f_next(struct seq_file *m, void *v, loff_t *pos) { - struct trace_event_call *call = event_file_data(m->private); + struct trace_event_file *file = event_file_data(m->private); + struct trace_event_call *call = file->event_call; struct list_head *common_head = &ftrace_common_fields; struct list_head *head = trace_get_fields(call); struct list_head *node = v; @@ -1572,7 +1573,8 @@ static void *f_next(struct seq_file *m, void *v, loff_t *pos) static int f_show(struct seq_file *m, void *v) { - struct trace_event_call *call = event_file_data(m->private); + struct trace_event_file *file = event_file_data(m->private); + struct trace_event_call *call = file->event_call; struct ftrace_event_field *field; const char *array_descriptor; @@ -1627,12 +1629,14 @@ static int f_show(struct seq_file *m, void *v) static void *f_start(struct seq_file *m, loff_t *pos) { + struct trace_event_file *file; void *p = (void *)FORMAT_HEADER; loff_t l = 0; /* ->stop() is called even if ->start() fails */ mutex_lock(&event_mutex); - if (!event_file_data(m->private)) + file = event_file_file(m->private); + if (!file) return ERR_PTR(-ENODEV); while (l < *pos && p) @@ -1706,8 +1710,8 @@ event_filter_read(struct file *filp, char __user *ubuf, size_t cnt, trace_seq_init(s); mutex_lock(&event_mutex); - file = event_file_data(filp); - if (file && !(file->flags & EVENT_FILE_FL_FREED)) + file = event_file_file(filp); + if (file) print_event_filter(file, s); mutex_unlock(&event_mutex); @@ -1736,9 +1740,13 @@ event_filter_write(struct file *filp, const char __user *ubuf, size_t cnt, return PTR_ERR(buf); mutex_lock(&event_mutex); - file = event_file_data(filp); - if (file) - err = apply_event_filter(file, buf); + file = event_file_file(filp); + if (file) { + if (file->flags & EVENT_FILE_FL_FREED) + err = -ENODEV; + else + err = apply_event_filter(file, buf); + } mutex_unlock(&event_mutex); kfree(buf); @@ -2485,7 +2493,6 @@ static int event_callback(const char *name, umode_t *mode, void **data, if (strcmp(name, "format") == 0) { *mode = TRACE_MODE_READ; *fops = &ftrace_event_format_fops; - *data = call; return 1; } @@ -2996,7 +3003,7 @@ trace_create_new_event(struct trace_event_call *call, atomic_set(&file->tm_ref, 0); INIT_LIST_HEAD(&file->triggers); list_add(&file->list, &tr->events); - event_file_get(file); + refcount_set(&file->ref, 1); return file; } diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 6ece1308d36a..5f9119eb7c67 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -5601,7 +5601,7 @@ static int hist_show(struct seq_file *m, void *v) mutex_lock(&event_mutex); - event_file = event_file_data(m->private); + event_file = event_file_file(m->private); if (unlikely(!event_file)) { ret = -ENODEV; goto out_unlock; @@ -5880,7 +5880,7 @@ static int hist_debug_show(struct seq_file *m, void *v) mutex_lock(&event_mutex); - event_file = event_file_data(m->private); + event_file = event_file_file(m->private); if (unlikely(!event_file)) { ret = -ENODEV; goto out_unlock; diff --git a/kernel/trace/trace_events_inject.c b/kernel/trace/trace_events_inject.c index 8650562bdaa9..a8f076809db4 100644 --- a/kernel/trace/trace_events_inject.c +++ b/kernel/trace/trace_events_inject.c @@ -299,7 +299,7 @@ event_inject_write(struct file *filp, const char __user *ubuf, size_t cnt, strim(buf); mutex_lock(&event_mutex); - file = event_file_data(filp); + file = event_file_file(filp); if (file) { call = file->event_call; size = parse_entry(buf, call, &entry); diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c index 4bec043c8690..a5e3d6acf1e1 100644 --- a/kernel/trace/trace_events_trigger.c +++ b/kernel/trace/trace_events_trigger.c @@ -159,7 +159,7 @@ static void *trigger_start(struct seq_file *m, loff_t *pos) /* ->stop() is called even if ->start() fails */ mutex_lock(&event_mutex); - event_file = event_file_data(m->private); + event_file = event_file_file(m->private); if (unlikely(!event_file)) return ERR_PTR(-ENODEV); @@ -213,7 +213,7 @@ static int event_trigger_regex_open(struct inode *inode, struct file *file) mutex_lock(&event_mutex); - if (unlikely(!event_file_data(file))) { + if (unlikely(!event_file_file(file))) { mutex_unlock(&event_mutex); return -ENODEV; } @@ -293,7 +293,7 @@ static ssize_t event_trigger_regex_write(struct file *file, strim(buf); mutex_lock(&event_mutex); - event_file = event_file_data(file); + event_file = event_file_file(file); if (unlikely(!event_file)) { mutex_unlock(&event_mutex); kfree(buf); diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c index a4dcf0f24352..3a56e7c8aa4f 100644 --- a/kernel/trace/tracing_map.c +++ b/kernel/trace/tracing_map.c @@ -454,7 +454,7 @@ static struct tracing_map_elt *get_free_elt(struct tracing_map *map) struct tracing_map_elt *elt = NULL; int idx; - idx = atomic_inc_return(&map->next_elt); + idx = atomic_fetch_add_unless(&map->next_elt, 1, map->max_elts); if (idx < map->max_elts) { elt = *(TRACING_MAP_ELT(map->elts, idx)); if (map->ops && map->ops->elt_init) @@ -699,7 +699,7 @@ void tracing_map_clear(struct tracing_map *map) { unsigned int i; - atomic_set(&map->next_elt, -1); + atomic_set(&map->next_elt, 0); atomic64_set(&map->hits, 0); atomic64_set(&map->drops, 0); @@ -783,7 +783,7 @@ struct tracing_map *tracing_map_create(unsigned int map_bits, map->map_bits = map_bits; map->max_elts = (1 << map_bits); - atomic_set(&map->next_elt, -1); + atomic_set(&map->next_elt, 0); map->map_size = (1 << (map_bits + 1)); map->ops = ops; .