Commit Graph

1233466 Commits

Author SHA1 Message Date
Shigeru Yoshida 34c4effacf virtio/vsock: Fix uninit-value in virtio_transport_recv_pkt()
KMSAN reported the following uninit-value access issue:

=====================================================
BUG: KMSAN: uninit-value in virtio_transport_recv_pkt+0x1dfb/0x26a0 net/vmw_vsock/virtio_transport_common.c:1421
 virtio_transport_recv_pkt+0x1dfb/0x26a0 net/vmw_vsock/virtio_transport_common.c:1421
 vsock_loopback_work+0x3bb/0x5a0 net/vmw_vsock/vsock_loopback.c:120
 process_one_work kernel/workqueue.c:2630 [inline]
 process_scheduled_works+0xff6/0x1e60 kernel/workqueue.c:2703
 worker_thread+0xeca/0x14d0 kernel/workqueue.c:2784
 kthread+0x3cc/0x520 kernel/kthread.c:388
 ret_from_fork+0x66/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304

Uninit was stored to memory at:
 virtio_transport_space_update net/vmw_vsock/virtio_transport_common.c:1274 [inline]
 virtio_transport_recv_pkt+0x1ee8/0x26a0 net/vmw_vsock/virtio_transport_common.c:1415
 vsock_loopback_work+0x3bb/0x5a0 net/vmw_vsock/vsock_loopback.c:120
 process_one_work kernel/workqueue.c:2630 [inline]
 process_scheduled_works+0xff6/0x1e60 kernel/workqueue.c:2703
 worker_thread+0xeca/0x14d0 kernel/workqueue.c:2784
 kthread+0x3cc/0x520 kernel/kthread.c:388
 ret_from_fork+0x66/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304

Uninit was created at:
 slab_post_alloc_hook+0x105/0xad0 mm/slab.h:767
 slab_alloc_node mm/slub.c:3478 [inline]
 kmem_cache_alloc_node+0x5a2/0xaf0 mm/slub.c:3523
 kmalloc_reserve+0x13c/0x4a0 net/core/skbuff.c:559
 __alloc_skb+0x2fd/0x770 net/core/skbuff.c:650
 alloc_skb include/linux/skbuff.h:1286 [inline]
 virtio_vsock_alloc_skb include/linux/virtio_vsock.h:66 [inline]
 virtio_transport_alloc_skb+0x90/0x11e0 net/vmw_vsock/virtio_transport_common.c:58
 virtio_transport_reset_no_sock net/vmw_vsock/virtio_transport_common.c:957 [inline]
 virtio_transport_recv_pkt+0x1279/0x26a0 net/vmw_vsock/virtio_transport_common.c:1387
 vsock_loopback_work+0x3bb/0x5a0 net/vmw_vsock/vsock_loopback.c:120
 process_one_work kernel/workqueue.c:2630 [inline]
 process_scheduled_works+0xff6/0x1e60 kernel/workqueue.c:2703
 worker_thread+0xeca/0x14d0 kernel/workqueue.c:2784
 kthread+0x3cc/0x520 kernel/kthread.c:388
 ret_from_fork+0x66/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304

CPU: 1 PID: 10664 Comm: kworker/1:5 Not tainted 6.6.0-rc3-00146-g9f3ebbef746f #3
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc38 04/01/2014
Workqueue: vsock-loopback vsock_loopback_work
=====================================================

The following simple reproducer can cause the issue described above:

int main(void)
{
  int sock;
  struct sockaddr_vm addr = {
    .svm_family = AF_VSOCK,
    .svm_cid = VMADDR_CID_ANY,
    .svm_port = 1234,
  };

  sock = socket(AF_VSOCK, SOCK_STREAM, 0);
  connect(sock, (struct sockaddr *)&addr, sizeof(addr));
  return 0;
}

This issue occurs because the `buf_alloc` and `fwd_cnt` fields of the
`struct virtio_vsock_hdr` are not initialized when a new skb is allocated
in `virtio_transport_init_hdr()`. This patch resolves the issue by
initializing these fields during allocation.

Fixes: 71dc9ec9ac ("virtio/vsock: replace virtio_vsock_pkt with sk_buff")
Reported-and-tested-by: syzbot+0c8ce1da0ac31abbadcd@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=0c8ce1da0ac31abbadcd
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20231104150531.257952-1-syoshida@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-11-07 18:56:06 -08:00
Heiner Kallweit 8999ce4cfc r8169: respect userspace disabling IFF_MULTICAST
So far we ignore the setting of IFF_MULTICAST. Fix this and clear bit
AcceptMulticast if IFF_MULTICAST isn't set.

Note: Based on the implementations I've seen it doesn't seem to be 100% clear
what a driver is supposed to do if IFF_ALLMULTI is set but IFF_MULTICAST
is not. This patch is based on the understanding that IFF_MULTICAST has
precedence.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/4a57ba02-d52d-4369-9f14-3565e6c1f7dc@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-11-07 18:55:56 -08:00
Linus Torvalds 305230142a More power management updates for 6.7-rc1
- Add support for several Qualcomm SoC versions to the Qualcomm cpufreq
    driver (Robert Marko, Varadarajan Narayanan).
 
  - Fix a reference to a removed document in the cpupower utility
    documentation (Vegard Nossum).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmVKlOESHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRx1kUP/RqJkLw/HzQ0AErnhlcQ/UO3sYkxdqEy
 OwoBHSmX8fYWkXgBsBLbZYklWPi7GKhuKqMnodt0DcXONoF/2ZpJ3ZkYD3E6KWvC
 BhbBx8+ciU9IeLPmVDd+rJpHMFKwGsf8sVNoZaCa2fTqMpcFAskI7i3w+dqfc6pe
 UYD7Cp1Tmm1fBQRXRqIY/z+aak9TgxG53RIQrHhP6qeJ9YZ+ixVofWtJofkynf7V
 5ZtSjphn5iHOXdHaAcjRTUjPJn65MFeJ0/ElqG7O42mRbFBwE2jt6m8Rnjh8T6xx
 uz/ogP11hKaK5E1c4csR5BQegzk6PdUZVNv/dauWKFjat/yyNSLIqena+lJKNVjW
 X+XEV6akO32AJ/uwczl8vfCx4JzQVbzd7qqKqzi5CDvVyKwkKP0t2resThFKwYFU
 CBnmK2aGa4vpEEEiqzgAkjCecML77pcuhGNSwhi9gZQ1GezVIuend5GbYXAYSrs/
 B0MHEvQYY1Omq3N4qNPOI6JhvULRRbniVr3l1Dbgf9khRIOA6lE+ONlzaZ0yxzBM
 gNqQjGzMN7e9kPe8BCXFRx2guoPIw53Z42mrDJneSD4wX3dunWcXtzO8eLP+O9/h
 y0efGLjcvFLX+nyLJ3Pj0RQ6J7tMfVhw2Df3o6m7t0AGic/0E+rSR+Y61+vZ3TGQ
 UGwZz0Zul5Mb
 =f4QJ
 -----END PGP SIGNATURE-----

Merge tag 'pm-6.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull more power management updates from Rafael Wysocki:
 "These add new hardware support to a cpufreq driver and fix cpupower
  utility documentation:

   - Add support for several Qualcomm SoC versions to the Qualcomm
     cpufreq driver (Robert Marko, Varadarajan Narayanan)

   - Fix a reference to a removed document in the cpupower utility
     documentation (Vegard Nossum)"

* tag 'pm-6.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: qcom-nvmem: Introduce cpufreq for ipq95xx
  cpufreq: qcom-nvmem: Enable cpufreq for ipq53xx
  cpufreq: qcom-nvmem: add support for IPQ8074
  cpupower: fix reference to nonexistent document
2023-11-07 17:16:23 -08:00
Linus Torvalds 25b6377007 drm next and fixes for 6.7-rc1
renesas:
 - atomic conversion
 - DT support
 
 ssd13xx:
 - dt binding fix for ssd132x
 - Initialize ssd130x crtc_state to NULL.
 
 amdgpu:
 - Fix RAS support check
 - RAS fixes
 - MES fixes
 - SMU13 fixes
 - Contiguous memory allocation fix
 - BACO fixes
 - GPU reset fixes
 - Min power limit fixes
 - GFX11 fixes
 - USB4/TB hotplug fixes
 - ARM regression fix
 - GFX9.4.3 fixes
 - KASAN/KCSAN stack size check fixes
 - SR-IOV fixes
 - SMU14 fixes
 - PSP13 fixes
 - Display blend fixes
 - Flexible array size fixes
 
 amdkfd:
 - GPUVM fix
 
 radeon:
 - Flexible array size fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEEKbZHaGwW9KfbeusDHTzWXnEhr4FAmVJmdsACgkQDHTzWXnE
 hr5hphAAoFdk4ma7TauUNyP3JoUwht+Ohm9NcUHq/9P9kOCwPIIehxMZnwPoTGyw
 VWwXpqpeVsW6zyMgfxWq/+P1S1C5LvZ1HLccbP3xv327fUZ1QnLapHwFxT1SYNpi
 Tw5qhQN/cwNOX0Pc9uBavYmJzf54OhvPxt2CHHPDShsHBOBc0Gd88gKJr7GWUF5M
 Ri6i20Tfsgq8AopWQj9628TT+y/aN3rVIfYYBiNejxejlFtt1HODkKFX3DuBNPOI
 bZOtQm11cbxmX7/2RI92mI20axUb4UMNIQFDYEl3bVlyPyEhhwKPQMSDxhQQodPg
 8zMY9Fbl4Z4VaOFEDbpiRv/0/HeWoLefmpQ5LZbz35RhKLTkwsWXHUELPUEj3uTr
 7+EnLwuvQdtbT9W2J8btO7v1dHOy86ArlnmqNjB2cEnvGaR3DNM4jxPVLn60SyAc
 N7CFWNU4EoJf02XhwAludYa5pQHEaTFL8ss6TSoRWXuHHg1vNdu2SorOvkcGkg28
 q/t28gZDZaOpXfMmf3ec+PHhO6nxXLXJRbiksVP/rpXQQ42cEI72hr6//UYLRuzg
 BbYPZ8uXmDjsSZIqYceZwc3Vr6oEmD6EAzHM9+zwS5h0IZ12jKTmFiDEAhG2DwoG
 8PCaj5UXkxVK+6iHndz8Qwg4+Fu1j5nodKM+vBNem/iSnxC/OVw=
 =TsFN
 -----END PGP SIGNATURE-----

Merge tag 'drm-next-2023-11-07' of git://anongit.freedesktop.org/drm/drm

Pull more drm updates from Dave Airlie:
 "Geert pointed out I missed the renesas reworks in my main pull, so
  this pull contains the renesas next work for atomic conversion and DT
  support.

  It also contains a bunch of amdgpu and some small ssd13xx fixes.

  renesas:
   - atomic conversion
   - DT support

  ssd13xx:
   - dt binding fix for ssd132x
   - Initialize ssd130x crtc_state to NULL.

  amdgpu:
   - Fix RAS support check
   - RAS fixes
   - MES fixes
   - SMU13 fixes
   - Contiguous memory allocation fix
   - BACO fixes
   - GPU reset fixes
   - Min power limit fixes
   - GFX11 fixes
   - USB4/TB hotplug fixes
   - ARM regression fix
   - GFX9.4.3 fixes
   - KASAN/KCSAN stack size check fixes
   - SR-IOV fixes
   - SMU14 fixes
   - PSP13 fixes
   - Display blend fixes
   - Flexible array size fixes

  amdkfd:
   - GPUVM fix

  radeon:
   - Flexible array size fixes"

* tag 'drm-next-2023-11-07' of git://anongit.freedesktop.org/drm/drm: (83 commits)
  drm/amd/display: Enable fast update on blendTF change
  drm/amd/display: Fix blend LUT programming
  drm/amd/display: Program plane color setting correctly
  drm/amdgpu: Query and report boot status
  drm/amdgpu: Add psp v13 function to query boot status
  drm/amd/swsmu: remove fw version check in sw_init.
  drm/amd/swsmu: update smu v14_0_0 driver if and metrics table
  drm/amdgpu: Add C2PMSG_109/126 reg field shift/masks
  drm/amdgpu: Optimize the asic type fix code
  drm/amdgpu: fix GRBM read timeout when do mes_self_test
  drm/amdgpu: check recovery status of xgmi hive in ras_reset_error_count
  drm/amd/pm: only check sriov vf flag once when creating hwmon sysfs
  drm/amdgpu: Attach eviction fence on alloc
  drm/amdkfd: Improve amdgpu_vm_handle_moved
  drm/amd/display: Increase frame warning limit with KASAN or KCSAN in dml2
  drm/amd/display: Avoid NULL dereference of timing generator
  drm/amdkfd: Update cache info for GFX 9.4.3
  drm/amdkfd: Populate cache info for GFX 9.4.3
  drm/amdgpu: don't put MQDs in VRAM on ARM | ARM64
  drm/amdgpu/smu13: drop compute workload workaround
  ...
2023-11-07 17:10:02 -08:00
Linus Torvalds eaec7c9892 regmap: Fix for v6.7
One fix here, for an interaction between noinc registers and caches - if
 a device uses noinc registers (which is rare) then we could corrupt
 registers after the noinc register in the cache.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmVKGw8ACgkQJNaLcl1U
 h9C8Bwf/U2a00UtJqvg+deoXHQ/7QY8w093DnHxdTLyUcDvwffbfTMrPPOmPtRLh
 1OYTtPPAgcF2PjyMaazHON2Y3a1/jPLEyjfRI3UmMWoVCVObUzh30ARASdRlvZj0
 1bnj88v32W2hFu/TuUPVVii3g2qH3XccEvX/JaNm0yG9lBHfugPGbVOI2S+MzWL9
 iFq+nYyqi6RzD7gq99ZaoA6UdacbCyPWgvHKxoZqhknTlX/KQQDdBlq2alhmbOoU
 lW3t9dwtZlcoskSTmKDI7Ukz0EnRvK1fcrkhZ/3XrQl349eLmtqcG7rM/ZMoORqL
 wx8eoxNCyCDnjxV+QfEL6SSQEX+8Mg==
 =M81g
 -----END PGP SIGNATURE-----

Merge tag 'regmap-fix-v6.7-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

Pull regmap fix from Mark Brown:
 "One fix here, for an interaction between noinc registers and caches.

  If a device uses noinc registers (which is rare) then we could corrupt
  registers after the noinc register in the cache"

* tag 'regmap-fix-v6.7-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: prevent noinc writes from clobbering cache
2023-11-07 16:56:10 -08:00
Namjae Jeon 5a5409d90b ksmbd: handle malformed smb1 message
If set_smb1_rsp_status() is not implemented, It will cause NULL pointer
dereferece error when client send malformed smb1 message.
This patch add set_smb1_rsp_status() to ignore malformed smb1 message.

Cc: stable@vger.kernel.org
Reported-by: Robert Morris <rtm@csail.mit.edu>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2023-11-07 18:54:25 -06:00
Namjae Jeon f6049712e5 ksmbd: fix kernel-doc comment of ksmbd_vfs_kern_path_locked()
Fix argument list that the kdoc format and script verified in
ksmbd_vfs_kern_path_locked().

fs/smb/server/vfs.c:1207: warning: Function parameter or member 'parent_path'
not described in 'ksmbd_vfs_kern_path_locked'

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2023-11-07 18:54:25 -06:00
Namjae Jeon eebff19aca ksmbd: fix slab out of bounds write in smb_inherit_dacl()
slab out-of-bounds write is caused by that offsets is bigger than pntsd
allocation size. This patch add the check to validate 3 offsets using
allocation size.

Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-22271
Cc: stable@vger.kernel.org
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2023-11-07 18:54:25 -06:00
Linus Torvalds b8dd631fca remoteproc updates for v6.7
Support for controlling the second core in Mediatek's SCP dual-core
 setup is introduced.
 
 Support for audio, compute and modem DSPs on Qualcomm SM6375, and the
 audio DSP in SC7180 are introduced. The peripheral NoC clock is
 dropped from MSM8996 modem DSP, as this is handled through the
 interconnect provider.
 
 In the zynqmp driver the setup for TCM memory, and device address
 translation thereof, when operating in lockstep mode is corrected.
 
 A few bug fixes and cleanups are introduces across the ST and STM32
 remoteproc drivers.
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCAAzFiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmVJsOEVHGFuZGVyc3Nv
 bkBrZXJuZWwub3JnAAoJEAsfOT8Nma3FEPAQALOtG4HIK0v1QYntMu5OEcQL3gkG
 l9lXtsPEqU3WJsWTwfrd37tr/njFcqAbtcxcQXYVu8jSjfhr7pAF7nQ0iAXtyAFE
 zePTg5DAaVMdI1l9YQkJNZFJHV4AtYxrT8ADtpmp2NZ+B66yhJNNfX4mwUHKjGlh
 pVf59qDiNcJDwCji8znvMFAO8Hjd+GfN9KztZLjvNvUbN+Sj9sjs3InW6Xqco+ae
 SArjpKDt4z3TVcdryfrHy576xHss12LUBJG7cBnWGIiT5EYOvsLJi8lNM6ytUm1e
 3/VKh+PcChJOerF3RHwBgTZ3A8xtjRb2G19BFIJExWIBx+E+jp+WvnP9yTwKoYu0
 Ow+EDSG/b21Rpcu/PqQASYJypoqPdaId+LDEESJQgWMBATdZ7W4xoYA9jXajnI6q
 JpMuox16cbiYX0R8eTtLWvUWB/zHQXnRc6JrULiOuPkORmTGirxmnrMkS4BOipSH
 dk5WXcyqvJ2A9mYRLfpOy7m5AjO7lRZES+rcNtEA19m5/G0v0cvFBKXPw5UIGwIe
 UAp9pLgXc0DLY0GnptzCGkebd5htH0FXthhbTyRYrzOxE6gTCJVqYOEjFHBu1kPZ
 xiyytZl42DovWY+IGoHRoaI4HMDxnjwzwTOVD/jmy19tl+u45RTY2q6AsRgxkb9a
 Kc5twvl2KNKDd2y9
 =E1ta
 -----END PGP SIGNATURE-----

Merge tag 'rproc-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux

Pull remoteproc updates from Bjorn Andersson:
 "Support for controlling the second core in Mediatek's SCP dual-core
  setup is introduced.

  Support for audio, compute and modem DSPs on Qualcomm SM6375, and the
  audio DSP in SC7180 are introduced. The peripheral NoC clock is
  dropped from MSM8996 modem DSP, as this is handled through the
  interconnect provider.

  In the zynqmp driver the setup for TCM memory, and device address
  translation thereof, when operating in lockstep mode is corrected.

  A few bug fixes and cleanups are introduces across the ST and STM32
  remoteproc drivers"

* tag 'rproc-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (28 commits)
  remoteproc: st: Fix sometimes uninitialized ret in st_rproc_probe()
  remoteproc: st: Use device_get_match_data()
  remoteproc: zynqmp: Change tcm address translation method
  remoteproc: mediatek: Refactor single core check and fix retrocompatibility
  remoteproc: qcom: q6v5-mss: Remove PNoC clock from 8996 MSS
  dt-bindings: remoteproc: qcom,msm8996-mss-pil: Remove PNoC clock
  dt-bindings: remoteproc: qcom,adsp: Remove AGGRE2 clock
  remoteproc: qcom: pas: Add SM6375 MPSS
  remoteproc: qcom: pas: Add SM6375 ADSP & CDSP
  dt-bindings: remoteproc: qcom,sm6375-pas: Document remoteprocs
  dt-bindings: remoteproc: pru: Add Interrupt property
  remoteproc: qcom: pas: Add sc7180 adsp
  dt-bindings: remoteproc: qcom: sc7180-pas: Add ADSP compatible
  arm64: dts: mediatek: Update the node name of SCP rpmsg subnode
  remoteproc: zynqmp: fix TCM carveouts in lockstep mode
  remoteproc: mediatek: Refine ipi handler error message
  remoteproc: mediatek: Report watchdog crash to all cores
  remoteproc: mediatek: Handle MT8195 SCP core 1 watchdog timeout
  remoteproc: mediatek: Setup MT8195 SCP core 1 SRAM offset
  remoteproc: mediatek: Remove dependency of MT8195 SCP L2TCM power control on dual-core SCP
  ...
2023-11-07 16:53:28 -08:00
Linus Torvalds c87271ee86 rpmsg updates for v6.7
This replaces a number of strncpy() instances with strscpy()
 strscpy_pad() through the rpmsg core and virtio implementation.
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCAAzFiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmVJqrMVHGFuZGVyc3Nv
 bkBrZXJuZWwub3JnAAoJEAsfOT8Nma3FY8YP/RsG/00MZdHEIxBO9HrrdMxAtwC5
 4xy0oVq2RJ3J7sOzCLyotFZwt/WOe/5ua+XbCgujvy2wEutdQH+QnnIjVGFZoBao
 QmRiGJe8lNodBE/fcoHE/yPMk7nlQM24E34llN2dth1B1ffjXgZHbbraTrgKtkyl
 gVazDGNdhJ51C1Q2P2KqZKC+RAEztpZtfIS6Y9NulNwWD9dxLJR2oBwjqeILHGkY
 ZIq0eysemxxCmRHz4elQFnN8EHgDw1Iv332pxSp6KbuuBthaqzWPmGDKTWizwukZ
 5cybRdarZ7vU3MfdjX2sIVEVQlYGAC9iDC9NF2wDSvq61aBQJDUXJ2+ObtD6KAru
 6W2TjdTlzKC8VPfNO20Xn1fCQScyXtMmwhwUbN2EfWJhg3WSi0W0tDkiwU0QAr4a
 0YcYc+CcXMs6yx3IwIzTke7InMy1a4Y/TTtenCSyigpOdrXotZaXNYBt6yjwguE0
 Hkd9U0z82I/VkSGvSHVz2rbivXcoOzBytEmzBHMjR6g89vJs3O1Ux1hBO2prDSIa
 LS8TobTfUxjBCYH6X33VYFLJR0li00/guMoNjP8QiMqw7vyhIhj0Fgs6a3ZhHvge
 Kf0scNLmSt803/FuQ906OMXNa75devejV26l8A8JBoWCtwGdlVnhDutkPirNrT/D
 UqPIlge4hMOHO57q
 =i2b6
 -----END PGP SIGNATURE-----

Merge tag 'rpmsg-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux

Pull rpmsg updates from Bjorn Andersson:
 "This replaces a number of strncpy() instances with strscpy() or
  strscpy_pad() through the rpmsg core and virtio implementation"

* tag 'rpmsg-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux:
  rpmsg: virtio: Replace deprecated strncpy with strscpy/_pad
  rpmsg: Replace deprecated strncpy with strscpy_pad
  rpmsg: core: Replace deprecated strncpy with strscpy
2023-11-07 16:50:51 -08:00
Linus Torvalds d3fbdb8ad3 PCMCIA odd cleanups and fixes for v6.7-rc1
Yang Yingliang has fixed a number of resource leaks and Dongliang Mu
 contributed a spelling fix for the PCMCIA core. Also included is a tiny
 clenaup to the tcic PCMCIA socket driver provided by lizhe.
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEmgXaWKgmjrvkPhLCmpdgiUyNow0FAmVJOTobHGxpbnV4QGRv
 bWluaWticm9kb3dza2kubmV0AAoJEJqXYIlMjaMNzmoP/3VRbLdCvs+8DER/Cpe/
 fKZtmO0SndQXHXC853ilSSxiXRcsnLlAa9bC2vydxU/g0csB78nyZhUXysMsB42O
 eOG+hDL5KoG2YeS90wogIVwwdP9LuWvaCbhe0pPdc9/iU9x8fiIx+voPxGu8gV5U
 lmqO2a772IchhejbkX6YQbGmWK/6r81+6nKXisyXwcbBNICyRUFtPRGCySDXTTWM
 d+Nt/8p311YeyVRrRkjb7lUCN5ww1WRLulHrm+3GTInWM/j9jtr/CCj6Czo2ABym
 Mbcbk9oQSE0y/BcsfDqYh8YKPUMqRHss16K3LGRGQbcu6O7XoLwLDAuxxg04eeNL
 QIu2iDnSt3s4L3zUut1TQXjpGccS/s69aQeL/GSTDC7njG+OFR4r62FB2AE+6lRq
 1EaJlwBjTmyeZi8uqWFcli+eO3qYoZXfn3kMABE2Z0JOdJ0YO7Q1dZMOwVj76SbI
 K7oi9DOgmIwVjOyJml4peC7GG4hy4Fad4f7zTdHhPlqpwm40Eh2gQAjM4hj4/eQq
 eGr1dSROzQamuUMv6IATg4syNATszNDk5cEJY0I2HMc3vhyNPx1dUW3jZjzNPb9B
 l08sBASr0PAXc80DPdnO/s2J7VHZjS9x9KBdfYSbOlsYBdi9K/+u3ohb62d2ySBf
 7J4REp30lm6JjWiVhtRMQYOn
 =TMdA
 -----END PGP SIGNATURE-----

Merge tag 'pcmcia-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux

Pull PCMCIA updates from Dominik Brodowski:
 "Cleanups and fixes.

  Yang Yingliang has fixed a number of resource leaks and Dongliang Mu
  contributed a spelling fix for the PCMCIA core. Also included is a
  tiny clenaup to the tcic PCMCIA socket driver provided by lizhe"

* tag 'pcmcia-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux:
  pcmcia: tcic: remove unneeded "&" in call to setup_timer()
  pcmcia: typo fix
  pcmcia: ds: fix possible name leak in error path in pcmcia_device_add()
  pcmcia: ds: fix refcount leak in pcmcia_device_add()
  pcmcia: cs: fix possible hung task and memory leak pccardd()
2023-11-07 16:40:42 -08:00
Linus Torvalds dc1434801d gpio/pinctrl updates for v6.7-rc1
- rework the GPIO-to-pinctrl glue code to stop using the deprecated global
   GPIO numberspace
 - remove now unused wrappers around pinctrl GPIO helpers from drivers
 - remove gpiochip_find() as it has no more users
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmVIp/0ACgkQEacuoBRx
 13I1CA//dC/4whtHH+0J2rTk+f+o/zYG19N4UxOjTbKFBy2gN5Xh5NCjtoFI2dU6
 TI0Cggl6IOaIqenHgy7vhL7n4iaWdvGlQpTVS5a336R8iu6fyinGAcV6Om4Dd/oD
 7GqCLTVYa28KMOMmHgBdSbLpM1VTjBuXmcRwBN33JlIgkAw9yre7dVqKm+uOO3LN
 9ok72NKZ2i/AUqjGV+3LAZf4Vlnj5CasFgQYuHaOXwPxZhAxG2WnxclFs1CRTTt/
 64E9VWlkFfmXkJshCpAyoR3hsVFq+hhxK8YacqAfKpA4o7G2zHB30kqDm79wkmba
 Hp6j4NOw7qdRvGmZhVrRuuABXkgI8R0B4UfT9+0bX17OskwoEKfRdCwZM2CmqATe
 f+4iysHE0Y6jAweGcpE09r01fVqEWVBqWGx8Rdqcwl/Lwz0xZZwaNtdPWXQMAqhj
 h/y39LjrI1cNuoQ8/v+tc0xw0zrJXC/oxlJhkwctv2rarFs0hdEgQkh5ZroUKjRG
 BLIW3XSc98S0Bj9xQ88mLwvSApaNi162PESfeTMpW3RpeexECtH4SgZ/pIR+Lmbs
 9eWksGTgpIqdRMgqRrltDzRYkAhm0vQre/spBooHo5paV3J7BNjaf7gjCoPuhwOO
 0e1Y94UnPvcD6Y3Dcv4PQ3M5YF6QEGX0X3UbmJ4//7aOY9G6VOk=
 =0p0S
 -----END PGP SIGNATURE-----

Merge tag 'gpio-pinctrl-updates-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio/pinctrl updates from Bartosz Golaszewski:
 "The bulk of it is a rework of the glue layer between pinctrl and GPIO.
  We changed the signature of GPIO helpers for pinctrl to taking the
  gpio_chip/offset pair as arguments instead of using the deprecated
  global GPIO numberspace.

  The last little bit is removing the gpiochip_find() function as it now
  has no more users in-tree.

  Summary:

   - rework the GPIO-to-pinctrl glue code to stop using the deprecated
     global GPIO numberspace

   - remove now unused wrappers around pinctrl GPIO helpers from drivers

   - remove gpiochip_find() as it has no more users"

* tag 'gpio-pinctrl-updates-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (70 commits)
  pinctrl: tegra: drop the wrapper around pinctrl_gpio_request()
  pinctrl: em: drop the wrapper around pinctrl_gpio_request()
  pinctrl: nuvoton: npcm8xx: drop wrappers around pinctrl_gpio_request/free()
  pinctrl: nuvoton: npcm7xx: drop wrappers around pinctrl_gpio_request/free()
  pinctrl: stm32: drop wrappers around pinctrl_gpio_free/input()
  pinctrl: starfive: jh7110: drop wrappers around pinctrl_gpio_request/free()
  pinctrl: starfive: jh7100: drop wrappers around pinctrl_gpio_request/free()
  pinctrl: ocelot: drop the wrapper around pinctrl_gpio_direction_input()
  pinctrl: cirrus: drop the wrapper around pinctrl_gpio_direction_input()
  pinctrl: mediatek: common: drop the wrappers around pinctrl_gpio_direction_input()
  pinctrl: mediatek: moore: drop the wrappers around pinctrl_gpio_direction_input()
  pinctrl: rk805: drop the wrapper around pinctrl_gpio_direction_input()
  pinctrl: axp209: drop the wrapper around pinctrl_gpio_direction_input()
  pinctrl: vt8500: drop the wrapper around pinctrl_gpio_direction_input()
  pinctrl: as3722: drop the wrapper around pinctrl_gpio_direction_input()
  pinctrl: ingenic: drop the wrapper around pinctrl_gpio_direction_input()
  pinctrl: st: drop the wrapper around pinctrl_gpio_direction_input()
  pinctrl: change the signature of pinctrl_ready_for_gpio_range()
  pinctrl: change the signature of gpio_to_pin()
  pinctrl: change the signature of pinctrl_match_gpio_range()
  ...
2023-11-07 16:36:25 -08:00
Uwe Kleine-König 99bce5182d ata: pata_gayle: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
2023-11-08 09:00:49 +09:00
Uwe Kleine-König 47d4708dfa ata: pata_falcon: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
2023-11-08 09:00:44 +09:00
Uwe Kleine-König 0b2771dd52 ata: pata_gayle: Stop using module_platform_driver_probe()
On today's platforms the benefit of platform_driver_probe() isn't that
relevant any more. It allows to drop some code after booting (or module
loading) for .probe() and discard the .remove() function completely if
the driver is built-in. This typically saves a few 100k.

The downside of platform_driver_probe() is that the driver cannot be
bound and unbound at runtime which is ancient and so slightly
complicates testing. There are also thoughts to deprecate
platform_driver_probe() because it adds some complexity in the driver
core for little gain. Also many drivers don't use it correctly. This
driver for example misses to mark the driver struct with __ref which is
needed to suppress a (W=1) modpost warning.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
2023-11-08 09:00:37 +09:00
Uwe Kleine-König 36f10a914a ata: pata_falcon: Stop using module_platform_driver_probe()
On today's platforms the benefit of platform_driver_probe() isn't that
relevant any more. It allows to drop some code after booting (or module
loading) for .probe() and discard the .remove() function completely if
the driver is built-in. This typically saves a few 100k.

The downside of platform_driver_probe() is that the driver cannot be
bound and unbound at runtime which is ancient and so slightly
complicates testing. There are also thoughts to deprecate
platform_driver_probe() because it adds some complexity in the driver
core for little gain. Also many drivers don't use it correctly. This
driver for example misses to mark the driver struct with __ref which is
needed to suppress a (W=1) modpost warning.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
2023-11-08 09:00:03 +09:00
Damien Le Moal fd3a6837d8 ata: libata-core: Fix ata_pci_shutdown_one()
This reverts commit 5b6fba546d.

Commit 5b6fba546d ("ata: libata-core: Detach a port devices on
shutdown") modified the function ata_pci_shutdown_one() to stop
(suspend) devices attached to the ports of a PCI AHCI adapter to ensure
that drives are spun down before shutting down a system. However, this
is done only for PCI adapters and not for other types of adapters. This
limitation was addressed with commit 24eca2dce0 ("scsi: sd: Introduce
manage_shutdown device flag"). With this, all ATA disks are spun down on
system shutdown, which make the changes introduced with 5b6fba546d
useless.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
2023-11-08 08:53:55 +09:00
Martin KaFai Lau 8e1b802503 Merge branch 'Let BPF verifier consider {task,cgroup} is trusted in bpf_iter_reg'
Chuyi Zhou says:

====================
The patchset aims to let the BPF verivier consider
bpf_iter__cgroup->cgroup and bpf_iter__task->task is trusted suggested by
Alexei[1].

Please see individual patches for more details. And comments are always
welcome.

Link[1]:https://lore.kernel.org/bpf/20231022154527.229117-1-zhouchuyi@bytedance.com/T/#mb57725edc8ccdd50a1b165765c7619b4d65ed1b0

v2->v1:
 * Patch #1: Add Yonghong's ack and add description of similar case in
   log.
 * Patch #2: Add Yonghong's ack
====================

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
2023-11-07 15:28:06 -08:00
Chuyi Zhou 3c5864ba9c selftests/bpf: get trusted cgrp from bpf_iter__cgroup directly
Commit f49843afde (selftests/bpf: Add tests for css_task iter combining
with cgroup iter) added a test which demonstrates how css_task iter can be
combined with cgroup iter. That test used bpf_cgroup_from_id() to convert
bpf_iter__cgroup->cgroup to a trusted ptr which is pointless now, since
with the previous fix, we can get a trusted cgroup directly from
bpf_iter__cgroup.

Signed-off-by: Chuyi Zhou <zhouchuyi@bytedance.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20231107132204.912120-3-zhouchuyi@bytedance.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
2023-11-07 15:28:06 -08:00
Chuyi Zhou 0de4f50de2 bpf: Let verifier consider {task,cgroup} is trusted in bpf_iter_reg
BTF_TYPE_SAFE_TRUSTED(struct bpf_iter__task) in verifier.c wanted to
teach BPF verifier that bpf_iter__task -> task is a trusted ptr. But it
doesn't work well.

The reason is, bpf_iter__task -> task would go through btf_ctx_access()
which enforces the reg_type of 'task' is ctx_arg_info->reg_type, and in
task_iter.c, we actually explicitly declare that the
ctx_arg_info->reg_type is PTR_TO_BTF_ID_OR_NULL.

Actually we have a previous case like this[1] where PTR_TRUSTED is added to
the arg flag for map_iter.

This patch sets ctx_arg_info->reg_type is PTR_TO_BTF_ID_OR_NULL |
PTR_TRUSTED in task_reg_info.

Similarly, bpf_cgroup_reg_info -> cgroup is also PTR_TRUSTED since we are
under the protection of cgroup_mutex and we would check cgroup_is_dead()
in __cgroup_iter_seq_show().

This patch is to improve the user experience of the newly introduced
bpf_iter_css_task kfunc before hitting the mainline. The Fixes tag is
pointing to the commit introduced the bpf_iter_css_task kfunc.

Link[1]:https://lore.kernel.org/all/20230706133932.45883-3-aspsk@isovalent.com/

Fixes: 9c66dc94b6 ("bpf: Introduce css_task open-coded iterator kfuncs")
Signed-off-by: Chuyi Zhou <zhouchuyi@bytedance.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20231107132204.912120-2-zhouchuyi@bytedance.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
2023-11-07 15:24:25 -08:00
Evan Green 55e0bf49a0
RISC-V: Probe misaligned access speed in parallel
Probing for misaligned access speed takes about 0.06 seconds. On a
system with 64 cores, doing this in smp_callin() means it's done
serially, extending boot time by 3.8 seconds. That's a lot of boot time.

Instead of measuring each CPU serially, let's do the measurements on
all CPUs in parallel. If we disable preemption on all CPUs, the
jiffies stop ticking, so we can do this in stages of 1) everybody
except core 0, then 2) core 0. The allocations are all done outside of
on_each_cpu() to avoid calling alloc_pages() with interrupts disabled.

For hotplugged CPUs that come in after the boot time measurement,
register CPU hotplug callbacks, and do the measurement there. Interrupts
are enabled in those callbacks, so they're fine to do alloc_pages() in.

Reported-by: Jisheng Zhang <jszhang@kernel.org>
Closes: https://lore.kernel.org/all/mhng-9359993d-6872-4134-83ce-c97debe1cf9a@palmer-ri-x1c9/T/#mae9b8f40016f9df428829d33360144dc5026bcbf
Fixes: 584ea6564b ("RISC-V: Probe for unaligned access speed")
Signed-off-by: Evan Green <evan@rivosinc.com>
Link: https://lore.kernel.org/r/20231106225855.3121724-1-evan@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-11-07 15:13:47 -08:00
Evan Green 6eb7a6445b
RISC-V: Remove __init on unaligned_emulation_finish()
This function shouldn't be __init, since it's called during hotplug. The
warning says it well enough:

WARNING: modpost: vmlinux: section mismatch in reference:
check_unaligned_access_all_cpus+0x13a (section: .text) ->
unaligned_emulation_finish (section: .init.text)

Signed-off-by: Evan Green <evan@rivosinc.com>
Fixes: 71c54b3d16 ("riscv: report misaligned accesses emulation to hwprobe")
Link: https://lore.kernel.org/r/20231106231105.3141413-1-evan@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-11-07 15:13:19 -08:00
Evan Green d3d2cf1aca
RISC-V: Show accurate per-hart isa in /proc/cpuinfo
In /proc/cpuinfo, most of the information we show for each processor is
specific to that hart: marchid, mvendorid, mimpid, processor, hart,
compatible, and the mmu size. But the ISA string gets filtered through a
lowest common denominator mask, so that if one CPU is missing an ISA
extension, no CPUs will show it.

Now that we track the ISA extensions for each hart, let's report ISA
extension info accurately per-hart in /proc/cpuinfo. We cannot change
the "isa:" line, as usermode may be relying on that line to show only
the common set of extensions supported across all harts. Add a new "hart
isa" line instead, which reports the true set of extensions for that
hart.

Signed-off-by: Evan Green <evan@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20231106232439.3176268-1-evan@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-11-07 15:13:09 -08:00
Palmer Dabbelt 28ea54bade
RISC-V: Don't rely on positional structure initialization
Without this I get a bunch of warnings along the lines of

    arch/riscv/kernel/module.c:535:26: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
      535 |         [R_RISCV_32] = { apply_r_riscv_32_rela },

This just mades the member initializers explicit instead of positional.
I also aligned some of the table, but mostly just to make the batch
editing go faster.

Fixes: b51fc88cb3 ("Merge patch series "riscv: Add remaining module relocations and tests"")
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20231107155529.8368-1-palmer@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-11-07 15:00:05 -08:00
Palmer Dabbelt b51fc88cb3
Merge patch series "riscv: Add remaining module relocations and tests"
Charlie Jenkins <charlie@rivosinc.com> says:

A handful of module relocations were missing, this patch includes the
remaining ones. I also wrote some test cases to ensure that module
loading works properly. Some relocations cannot be supported in the
kernel, these include the ones that rely on thread local storage and
dynamic linking.

This patch also overhauls the implementation of ADD/SUB/SET/ULEB128
relocations to handle overflow. "Overflow" is different for ULEB128
since it is a variable-length encoding that the compiler can be expected
to generate enough space for. Instead of overflowing, ULEB128 will
expand into the next 8-bit segment of the location.

A psABI proposal [1] was merged that mandates that SET_ULEB128 and
SUB_ULEB128 are paired, however the discussion following the merging of
the pull request revealed that while the pull request was valid, it
would be better for linkers to properly handle this overflow. This patch
proactively implements this methodology for future compatibility.

This can be tested by enabling KUNIT, RUNTIME_KERNEL_TESTING_MENU, and
RISCV_MODULE_LINKING_KUNIT.

[1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/403

* b4-shazam-merge:
  riscv: Add tests for riscv module loading
  riscv: Add remaining module relocations
  riscv: Avoid unaligned access when relocating modules

Link: https://lore.kernel.org/r/20231101-module_relocations-v9-0-8dfa3483c400@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-11-07 14:59:35 -08:00
Charlie Jenkins af71bc1949
riscv: Add tests for riscv module loading
Add test cases for the two main groups of relocations added: SUB and
SET, along with uleb128.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20231101-module_relocations-v9-3-8dfa3483c400@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-11-07 14:59:32 -08:00
Charlie Jenkins 8fd6c51423
riscv: Add remaining module relocations
Add all final module relocations and add error logs explaining the ones
that are not supported. Implement overflow checks for
ADD/SUB/SET/ULEB128 relocations.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20231101-module_relocations-v9-2-8dfa3483c400@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-11-07 14:59:31 -08:00
Emil Renner Berthing 8cbe0accc4
riscv: Avoid unaligned access when relocating modules
With the C-extension regular 32bit instructions are not
necessarily aligned on 4-byte boundaries. RISC-V instructions
are in fact an ordered list of 16bit little-endian
"parcels", so access the instruction as such.

This should also make the code work in case someone builds
a big-endian RISC-V machine.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20231101-module_relocations-v9-1-8dfa3483c400@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-11-07 14:59:30 -08:00
Klaus Kudielka 02d5fdbf4f net: phylink: initialize carrier state at creation
Background: Turris Omnia (Armada 385); eth2 (mvneta) connected to SFP bus;
SFP module is present, but no fiber connected, so definitely no carrier.

After booting, eth2 is down, but netdev LED trigger surprisingly reports
link active. Then, after "ip link set eth2 up", the link indicator goes
away - as I would have expected it from the beginning.

It turns out, that the default carrier state after netdev creation is
"carrier ok". Some ethernet drivers explicitly call netif_carrier_off
during probing, others (like mvneta) don't - which explains the current
behaviour: only when the device is brought up, phylink_start calls
netif_carrier_off.

Fix this for all drivers using phylink, by calling netif_carrier_off in
phylink_create.

Fixes: 089381b27a ("leds: initial support for Turris Omnia LEDs")
Cc: stable@vger.kernel.org
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-11-07 22:32:23 +00:00
David S. Miller 97b9432912 Merge branch 'vsock-fixes'
Filippo Storniolo says:

====================
vsock: fix server prevents clients from reconnecting

This patch series introduce fix and tests for the following vsock bug:
If the same remote peer, using the same port, tries to connect
to a server on a listening port more than once, the server will
reject the connection, causing a "connection reset by peer"
error on the remote peer. This is due to the presence of a
dangling socket from a previous connection in both the connected
and bound socket lists.
The inconsistency of the above lists only occurs when the remote
peer disconnects and the server remains active.
This bug does not occur when the server socket is closed.

More details on the first patch changelog.
The remaining patches are refactoring and test.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2023-11-07 22:27:07 +00:00
Filippo Storniolo d80f63f690 test/vsock: add dobule bind connect test
This add bind connect test which creates a listening server socket
and tries to connect a client with a bound local port to it twice.

Co-developed-by: Luigi Leonardi <luigi.leonardi@outlook.com>
Signed-off-by: Luigi Leonardi <luigi.leonardi@outlook.com>
Signed-off-by: Filippo Storniolo <f.storniolo95@gmail.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-11-07 22:27:07 +00:00
Filippo Storniolo 84d5fb9741 test/vsock: refactor vsock_accept
This is a preliminary patch to introduce SOCK_STREAM bind connect test.
vsock_accept() is split into vsock_listen() and vsock_accept().

Co-developed-by: Luigi Leonardi <luigi.leonardi@outlook.com>
Signed-off-by: Luigi Leonardi <luigi.leonardi@outlook.com>
Signed-off-by: Filippo Storniolo <f.storniolo95@gmail.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-11-07 22:27:07 +00:00
Filippo Storniolo bfada5a767 test/vsock fix: add missing check on socket creation
Add check on socket() return value in vsock_listen()
and vsock_connect()

Co-developed-by: Luigi Leonardi <luigi.leonardi@outlook.com>
Signed-off-by: Luigi Leonardi <luigi.leonardi@outlook.com>
Signed-off-by: Filippo Storniolo <f.storniolo95@gmail.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-11-07 22:27:07 +00:00
Filippo Storniolo 3a5cc90a4d vsock/virtio: remove socket from connected/bound list on shutdown
If the same remote peer, using the same port, tries to connect
to a server on a listening port more than once, the server will
reject the connection, causing a "connection reset by peer"
error on the remote peer. This is due to the presence of a
dangling socket from a previous connection in both the connected
and bound socket lists.
The inconsistency of the above lists only occurs when the remote
peer disconnects and the server remains active.

This bug does not occur when the server socket is closed:
virtio_transport_release() will eventually schedule a call to
virtio_transport_do_close() and the latter will remove the socket
from the bound and connected socket lists and clear the sk_buff.

However, virtio_transport_do_close() will only perform the above
actions if it has been scheduled, and this will not happen
if the server is processing the shutdown message from a remote peer.

To fix this, introduce a call to vsock_remove_sock()
when the server is handling a client disconnect.
This is to remove the socket from the bound and connected socket
lists without clearing the sk_buff.

Fixes: 06a8fc7836 ("VSOCK: Introduce virtio_vsock_common.ko")
Reported-by: Daan De Meyer <daan.j.demeyer@gmail.com>
Tested-by: Daan De Meyer <daan.j.demeyer@gmail.com>
Co-developed-by: Luigi Leonardi <luigi.leonardi@outlook.com>
Signed-off-by: Luigi Leonardi <luigi.leonardi@outlook.com>
Signed-off-by: Filippo Storniolo <f.storniolo95@gmail.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-11-07 22:27:07 +00:00
Nathan Chancellor 7425627b2b tcp: Fix -Wc23-extensions in tcp_options_write()
Clang warns (or errors with CONFIG_WERROR=y) when CONFIG_TCP_AO is set:

  net/ipv4/tcp_output.c:663:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions]
    663 |         }
        |         ^
  1 error generated.

On earlier releases (such as clang-11, the current minimum supported
version for building the kernel) that do not support C23, this was a
hard error unconditionally:

  net/ipv4/tcp_output.c:663:2: error: expected statement
          }
          ^
  1 error generated.

While adding a semicolon after the label would resolve this, it is more
in line with the kernel as a whole to refactor this block into a
standalone function, which means the goto a label construct can just be
replaced with a return statement. Do so to resolve the warning.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1953
Fixes: 1e03d32bea ("net/tcp: Add TCP-AO sign to outgoing packets")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Dmitry Safonov <dima@arista.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-11-07 22:23:56 +00:00
Alex Pakhunov c542b39b60 tg3: Fix the TX ring stall
The TX ring maintained by the tg3 driver can end up in the state, when it
has packets queued for sending but the NIC hardware is not informed, so no
progress is made. This leads to a multi-second interruption in network
traffic followed by dev_watchdog() firing and resetting the queue.

The specific sequence of steps is:

1. tg3_start_xmit() is called at least once and queues packet(s) without
   updating tnapi->prodmbox (netdev_xmit_more() returns true)
2. tg3_start_xmit() is called with an SKB which causes tg3_tso_bug() to be
   called.
3. tg3_tso_bug() determines that the SKB is too large, ...

        if (unlikely(tg3_tx_avail(tnapi) <= frag_cnt_est)) {

   ... stops the queue, and returns NETDEV_TX_BUSY:

        netif_tx_stop_queue(txq);
        ...
        if (tg3_tx_avail(tnapi) <= frag_cnt_est)
                return NETDEV_TX_BUSY;

4. Since all tg3_tso_bug() call sites directly return, the code updating
   tnapi->prodmbox is skipped.

5. The queue is stuck now. tg3_start_xmit() is not called while the queue
   is stopped. The NIC is not processing new packets because
   tnapi->prodmbox wasn't updated. tg3_tx() is not called by
   tg3_poll_work() because the all TX descriptions that could be freed has
   been freed:

        /* run TX completion thread */
        if (tnapi->hw_status->idx[0].tx_consumer != tnapi->tx_cons) {
                tg3_tx(tnapi);

6. Eventually, dev_watchdog() fires triggering a reset of the queue.

This fix makes sure that the tnapi->prodmbox update happens regardless of
the reason tg3_start_xmit() returned.

Signed-off-by: Alex Pakhunov <alexey.pakhunov@spacex.com>
Signed-off-by: Vincent Wong <vincent.wong2@spacex.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-11-07 22:19:16 +00:00
Kuan-Wei Chiu dbc9e341e3 s390/qeth: Fix typo 'weed' in comment
Replace 'weed' with 'we' in the comment.

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-11-07 22:17:20 +00:00
Linus Torvalds 13d88ac54d vfs-6.7.fsid
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCZUpEaAAKCRCRxhvAZXjc
 ounBAQCAoS66gnOZ+k4kOWwB2zZ1Ueh3dPFC7IcEZ+pwFS8hpAEAxUQxV0TSWf5l
 W/1oKRtAJyuSYvehHeMUSJmHVBiM8w4=
 =bNm0
 -----END PGP SIGNATURE-----

Merge tag 'vfs-6.7.fsid' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull vfs fanotify fsid updates from Christian Brauner:
 "This work is part of the plan to enable fanotify to serve as a drop-in
  replacement for inotify. While inotify is availabe on all filesystems,
  fanotify currently isn't.

  In order to support fanotify on all filesystems two things are needed:

   (1) all filesystems need to support AT_HANDLE_FID

   (2) all filesystems need to report a non-zero f_fsid

  This contains (1) and allows filesystems to encode non-decodable file
  handlers for fanotify without implementing any exportfs operations by
  encoding a file id of type FILEID_INO64_GEN from i_ino and
  i_generation.

  Filesystems that want to opt out of encoding non-decodable file ids
  for fanotify that don't support NFS export can do so by providing an
  empty export_operations struct.

  This also partially addresses (2) by generating f_fsid for simple
  filesystems as well as freevxfs. Remaining filesystems will be dealt
  with by separate patches.

  Finally, this contains the patch from the current exportfs maintainers
  which moves exportfs under vfs with Chuck, Jeff, and Amir as
  maintainers and vfs.git as tree"

* tag 'vfs-6.7.fsid' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
  MAINTAINERS: create an entry for exportfs
  fs: fix build error with CONFIG_EXPORTFS=m or not defined
  freevxfs: derive f_fsid from bdev->bd_dev
  fs: report f_fsid from s_dev for "simple" filesystems
  exportfs: support encoding non-decodeable file handles by default
  exportfs: define FILEID_INO64_GEN* file handle types
  exportfs: make ->encode_fh() a mandatory method for NFS export
  exportfs: add helpers to check if filesystem can encode/decode file handles
2023-11-07 12:11:26 -08:00
Linus Torvalds 062cca8915 vfs-6.7.iomap
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCZUoJCwAKCRCRxhvAZXjc
 op1dAQCyPoR7cEU1ThHfBkUFso/M10izobPmBy9g+mdZavxqQgEApFxbbUqPP2R8
 6qe6VFDSQKu5S3sf8IgUMQqkzHnOcwg=
 =qMvH
 -----END PGP SIGNATURE-----

Merge tag 'vfs-6.7.iomap' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull iomap maintainership rotation from Christian Brauner:
 "As discussed on list last week this makes fs/iomap part of vfs.git
  with Darrick as main reviewer"

* tag 'vfs-6.7.iomap' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
  iomap: rename iomap entry
  iomap: rotate maintainers
2023-11-07 12:03:54 -08:00
Linus Torvalds 1a0507d878 gfs2 fixes
- Don't update inode timestamps for direct writes (performance regression fix).
 
 - Skip no-op quota records instead of panicing.
 
 - Fix a RCU race in gfs2_permission().
 
 - Various other smaller fixes and cleanups all over the place.
 -----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCAAyFiEEJZs3krPW0xkhLMTc1b+f6wMTZToFAmVKReAUHGFncnVlbmJh
 QHJlZGhhdC5jb20ACgkQ1b+f6wMTZTqZ0Q//RigZFdejtWEJ2GnrZfHCRxXXjF7A
 uXyK8PKv6xaHmF+I4PcEr/5yBkOxPhld0sBcsqdNUlvFbEl4AqLrXoSTMB2Fbq2h
 ycPTSPdGTFWjFJBIpN5F1LOQ0urxuS+fKkmxruaFwNywZqbPY0fYs7ZN5K76y0cL
 OKBcbOg5Q39Z+fqrxB0mf7WNIBfUxAsdelGQM3VK1ptNNxebmvBdNaWIhG7vWyWm
 MpWpPRwm906tOrMwhmy1oCCY6RrVC2naLlROOi58iodQ9sIF4MqmKOoejbbll6BH
 1XMtOPQfO+IWWhq0/AX/xBL+nxuukko6V72Qg15e4sDhbla+vYrYEs4P+MZ5UU0u
 dM1MxnmV3xjKBw8KrnwMZL88ExuBhm6HLzKWlshJ4wye21Y3s2OKA2zCK2u3NBc3
 GwYtNLBidoe8TjVD0ZeKeQJt2nZeKRrIWqQteaTHYpLHlRzCajEpmFS+ejEu59WC
 8qw8MjTR2P6m8bPYNTbvxh6Lw4cE6ZHCj71nSPwrEDeU2QPQAmMKQg0bgTM7vpU7
 HKl92Av20xhM+vyb/N670KcR/4yXEkUtbOzazyj/r/XB361luCFP9D9dRiNl7tOo
 TU0otksrkjJ7QrnVd3XUrA2N7iQEIeCVcx0k+KTGrJh7+yVzbUKaJ5W4Tsd+TVzB
 h/lfHAYS4FTd8nA=
 =YfOA
 -----END PGP SIGNATURE-----

Merge tag 'gfs2-v6.6-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2

Pull gfs2 updates from Andreas Gruenbacher:

 - Don't update inode timestamps for direct writes (performance
   regression fix)

 - Skip no-op quota records instead of panicing

 - Fix a RCU race in gfs2_permission()

 - Various other smaller fixes and cleanups all over the place

* tag 'gfs2-v6.6-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: (24 commits)
  gfs2: don't withdraw if init_threads() got interrupted
  gfs2: remove dead code in add_to_queue
  gfs2: Fix slab-use-after-free in gfs2_qd_dealloc
  gfs2: Silence "suspicious RCU usage in gfs2_permission" warning
  gfs2: fs: derive f_fsid from s_uuid
  gfs2: No longer use 'extern' in function declarations
  gfs2: Rename gfs2_lookup_{ simple => meta }
  gfs2: Convert gfs2_internal_read to folios
  gfs2: Convert stuffed_readpage to folios
  gfs2: Minor gfs2_write_jdata_batch PAGE_SIZE cleanup
  gfs2: Get rid of gfs2_alloc_blocks generation parameter
  gfs2: Add metapath_dibh helper
  gfs2: Clean up quota.c:print_message
  gfs2: Clean up gfs2_alloc_parms initializers
  gfs2: Two quota=account mode fixes
  gfs2: Stop using GFS2_BASIC_BLOCK and GFS2_BASIC_BLOCK_SHIFT
  gfs2: setattr_chown: Add missing initialization
  gfs2: fix an oops in gfs2_permission
  gfs2: ignore negated quota changes
  gfs2: Don't update inode timestamps for direct writes
  ...
2023-11-07 11:54:17 -08:00
Linus Torvalds 7f851936a0 overlayfs update for 6.7-rc1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE9zuTYTs0RXF+Ke33EVvVyTe/1WoFAmVIg7wACgkQEVvVyTe/
 1WpPtw//WiQc+gwGvLEyi9YFZWTuAOO8ZGSxF7t+CU2SYy9d91s3K8dNRx2kWBh0
 ycsFIYhTyq6BrHqlg1JpI4WW8S9SW7BkXbE4f5Lm/kiiGqlJn+eCA+aR8AqPMpVx
 KemCHJQj2WwcjlHRonAYIyQOApNePwy7EPPDlk+TlVEgMRtDHW+CY1ftChqi8bVf
 /aYoFdJIbliIUWNKzBeje/Hypz1a3aUrMitquoK3A91RgIgQQmnWN6yirT4Z4gKB
 Vd9vnnFPu9LWjCv+RUuP3C0G4zHkP92sfbEIulKqml0Vx68JZyTy5jsUzxaGmXaQ
 im4neCEUV88PZoAJgGFcBHbi4y0bt5WDIf7kdZGheZJv8H/X5TQTxlXle3h0qHEp
 Rx65OjPGzZjfia1nFzNjUCd+jCtdp02H1WxchfsRpwmXqGPYBLsNPWN+BoSaLjtL
 gbEMRMAs4mAJObnhAIOZclzh0boLi4IWz0yNkBoZRxkUOAUDV7UaICQoSneWj36j
 OH75cNrRV7vZeMQy2aLWkxGm2LabhjzDZXwO9zwHZFMKIpGg7zko10Fko9qS+20p
 BHe+aqWgr0qxcY41fpKzu0ftSuNs9Jsn1/I/jqmgwFw+ogRwjuxgl2LkCHOPh3cS
 AMwd1ZahQDQKq6Wgh1WCOi31n1d8+/Gy74IojwSC++XaPMqYB0I=
 =MPCb
 -----END PGP SIGNATURE-----

Merge tag 'ovl-update-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs

Pull overlayfs updates from Amir Goldstein:

 - Overlayfs aio cleanups and fixes

   Cleanups and minor fixes in preparation for factoring out of
   read/write passthrough code.

 - Overlayfs lock ordering changes

   Hold mnt_writers only throughout copy up instead of a long lived
   elevated refcount.

 - Add support for nesting overlayfs private xattrs

   There are cases where you want to use an overlayfs mount as a
   lowerdir for another overlayfs mount. For example, if the system
   rootfs is on overlayfs due to composefs, or to make it volatile (via
   tmpfs), then you cannot currently store a lowerdir on the rootfs,
   because the inner overlayfs will eat all the whiteouts and overlay
   xattrs. This means you can't e.g. store on the rootfs a prepared
   container image for use with overlayfs.

   This adds support for nesting of overlayfs mounts by escaping the
   problematic features and unescaping them when exposing to the
   overlayfs user.

 - Add new mount options for appending lowerdirs

* tag 'ovl-update-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs:
  ovl: add support for appending lowerdirs one by one
  ovl: refactor layer parsing helpers
  ovl: store and show the user provided lowerdir mount option
  ovl: remove unused code in lowerdir param parsing
  ovl: Add documentation on nesting of overlayfs mounts
  ovl: Add an alternative type of whiteout
  ovl: Support escaped overlay.* xattrs
  ovl: Add OVL_XATTR_TRUSTED/USER_PREFIX_LEN macros
  ovl: Move xattr support to new xattrs.c file
  ovl: do not encode lower fh with upper sb_writers held
  ovl: do not open/llseek lower file with upper sb_writers held
  ovl: reorder ovl_want_write() after ovl_inode_lock()
  ovl: split ovl_want_write() into two helpers
  ovl: add helper ovl_file_modified()
  ovl: protect copying of realinode attributes to ovl inode
  ovl: punt write aio completion to workqueue
  ovl: propagate IOCB_APPEND flag on writes to realfile
  ovl: use simpler function to convert iocb to rw flags
2023-11-07 11:46:31 -08:00
Rafael J. Wysocki 36cbb924d6 Merge branch 'pm-tools'
Merge cpupower utility update for 6.7-rc1:

 - Fix a reference to a removed document in the cpupower utility
   documentation (Vegard Nossum).

* pm-tools:
  cpupower: fix reference to nonexistent document
2023-11-07 20:46:13 +01:00
Rafael J. Wysocki d53f7f7a74 Merge branch 'pm-cpufreq'
Merge branch 'pm-cpufreq'

Merge additional Qualcomm cpufreq driver updates for 6.7-rc1:

 - Add support for several Qualcomm SoC versions (Robert Marko,
   Varadarajan Narayanan).

* pm-cpufreq:
  cpufreq: qcom-nvmem: Introduce cpufreq for ipq95xx
  cpufreq: qcom-nvmem: Enable cpufreq for ipq53xx
  cpufreq: qcom-nvmem: add support for IPQ8074
2023-11-07 20:45:12 +01:00
Linus Torvalds c9d01179e1 Second bcachefs pull request for 6.7-rc1
Here's the second big bcachefs pull request. This brings your tree up to
 date with my master branch, which is what existing bcachefs users are
 currently running.
 
 All but the last few patches have been in linux-next, those being small
 fixes. Test results from my dashboard:
   https://evilpiepirate.org/~testdashboard/ci?commit=c7046ed0cf9bb33599aa7e72e7b67bba4be42d64
 
 New features:
  - rebalance_work btree (and metadata version 1.3): the rebalance thread
    no longer has to scan to find extents that need processing - big
    scalability improvement.
  - sb_errors superblock section: this adds counters for each fsck error
    type, since filesystem creation, along with the date of the most
    recent error. It'll get us better bug reports (since users do not
    typically report errors that fsck was able to fix), and I might add
    telemetry for this in the future.
 
 Fixes include:
  - multiple snapshot deletion fixes
  - members_v2 fixups
  - deleted_inodes btree fixes
  - copygc thread no longer spins when a device is full but has no
    fragmented buckets (i.e. rebalance needs to move data around instead)
  - a fix for a memory reclaim issue with the btree key cache: we're now
    careful not to hold the srcu read lock that blocks key cache reclaim
    for too long
  - an early allocator locking fix, from Brian
  - endianness fixes, from Brian
  - CONFIG_BCACHEFS_DEBUG_TRANSACTIONS no longer defaults to y, a big
    performance improvement on multithreaded workloads
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEKnAFLkS8Qha+jvQrE6szbY3KbnYFAmVH9xYACgkQE6szbY3K
 bnahLRAAiNRZL73SQ+MW79o4yPqGwt0Eyy/mvoiGpZf1B8uXp0oZ55j2w3l887Uf
 LeM03mInAYCPdyp/d4vxqIr96j9BODmRRl8sEkkGdJDzokLG+22F0ovOe45KWTxL
 kBoNdng/O/oeOe/1K7taP3KzBvMx2nOF6oA+xfgyCjECMArAIXek0iocyEUR4Ywd
 vGKhLNn1k2c+94wacnDYwjjdcLBxoqxsFXlpu6V0BcaY+DX4J3aBaGmj75KEoCI0
 VbBOzxrOO4QzJrzW2+hxZZWgGyvReCkBJvqfORfuPxiSbFobTim10MdfZOAMQA1U
 Xr1FTEpK1wMX0/pPVgZRqaOsttC+yc/SsfPNgSxybgHPbDlMLaakDHjvYssbKOYG
 urDWSMG5yCsktSLj95SXsvUFKZaZFD72SKBNdgdt/nZjwTHuNQ7IkdrMwIrCQ/PT
 Ifn50UrR/Ahd8RAd5tyNCPw6U9VfwnxACSNl2KA7ONKpvHb+gSt1JsJTDyz1+gN9
 nFVrw1SHKQ6EIV6XhVon/5DEuRTzqoYGWoN08FHEUq9fBlvnVpmbJErCQMplOjz9
 OQnAfpJH4YqkpXyjFAjP1V0An+RUn8QvDgXNqC9TyvCYuOliVFuil4y7/c+7oIQU
 NEoz+jVLenqsGOGAbduI4/Q567COojRgwEvbebSIxSImXuhCNj4=
 =Lo4N
 -----END PGP SIGNATURE-----

Merge tag 'bcachefs-2023-11-5' of https://evilpiepirate.org/git/bcachefs

Pull more bcachefs updates from Kent Overstreet:
 "Here's the second big bcachefs pull request. This brings your tree up
  to date with my master branch, which is what existing bcachefs users
  are currently running.

  New features:
   - rebalance_work btree (and metadata version 1.3): the rebalance
     thread no longer has to scan to find extents that need processing -
     big scalability improvement.
   - sb_errors superblock section: this adds counters for each fsck
     error type, since filesystem creation, along with the date of the
     most recent error. It'll get us better bug reports (since users do
     not typically report errors that fsck was able to fix), and I might
     add telemetry for this in the future.

  Fixes include:
   - multiple snapshot deletion fixes
   - members_v2 fixups
   - deleted_inodes btree fixes
   - copygc thread no longer spins when a device is full but has no
     fragmented buckets (i.e. rebalance needs to move data around
     instead)
   - a fix for a memory reclaim issue with the btree key cache: we're
     now careful not to hold the srcu read lock that blocks key cache
     reclaim for too long
   - an early allocator locking fix, from Brian
   - endianness fixes, from Brian
   - CONFIG_BCACHEFS_DEBUG_TRANSACTIONS no longer defaults to y, a big
     performance improvement on multithreaded workloads"

* tag 'bcachefs-2023-11-5' of https://evilpiepirate.org/git/bcachefs: (70 commits)
  bcachefs: Improve stripe checksum error message
  bcachefs: Simplify, fix bch2_backpointer_get_key()
  bcachefs: kill thing_it_points_to arg to backpointer_not_found()
  bcachefs: bch2_ec_read_extent() now takes btree_trans
  bcachefs: bch2_stripe_to_text() now prints ptr gens
  bcachefs: Don't iterate over journal entries just for btree roots
  bcachefs: Break up bch2_journal_write()
  bcachefs: Replace ERANGE with private error codes
  bcachefs: bkey_copy() is no longer a macro
  bcachefs: x-macro-ify inode flags enum
  bcachefs: Convert bch2_fs_open() to darray
  bcachefs: Move __bch2_members_v2_get_mut to sb-members.h
  bcachefs: bch2_prt_datetime()
  bcachefs: CONFIG_BCACHEFS_DEBUG_TRANSACTIONS no longer defaults to y
  bcachefs: Add a comment for BTREE_INSERT_NOJOURNAL usage
  bcachefs: rebalance_work btree is not a snapshots btree
  bcachefs: Add missing printk newlines
  bcachefs: Fix recovery when forced to use JSET_NO_FLUSH journal entry
  bcachefs: .get_parent() should return an error pointer
  bcachefs: Fix bch2_delete_dead_inodes()
  ...
2023-11-07 11:38:38 -08:00
Helge Deller 166b0110d1 parisc/pgtable: Do not drop upper 5 address bits of physical address
When calculating the pfn for the iitlbt/idtlbt instruction, do not
drop the upper 5 address bits. This doesn't seem to have an effect
on physical hardware which uses less physical address bits, but in
qemu the missing bits are visible.

Signed-off-by: Helge Deller <deller@gmx.de>
Cc:  <stable@vger.kernel.org>
2023-11-07 19:48:30 +01:00
Arnd Bergmann 6affe08aea nvme: common: make keyring and auth separate modules
When only the keyring module is included but auth is not, modpost
complains about the lack of a module license tag:

ERROR: modpost: missing MODULE_LICENSE() in drivers/nvme/common/nvme-common.o

Address this by making both modules buildable standalone,
removing the now unnecessary CONFIG_NVME_COMMON symbol
in the process.

Also, now that NVME_KEYRING config symbol can be either a module or
built-in, the stubs need to check for '#if IS_ENABLED' rather than a
simple '#ifdef'.

Fixes: 9d77eb5277 ("nvme-keyring: register '.nvme' keyring")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
2023-11-07 10:05:15 -08:00
Christoph Hellwig 946bb33d33
riscv: split cache ops out of dma-noncoherent.c
The cache ops are also used by the pmem code which is unconditionally
built into the kernel.  Move them into a separate file that is built
based on the correct config option.

Fixes: fd96278127 ("riscv: RISCV_NONSTANDARD_CACHE_OPS shouldn't depend on RISCV_DMA_NONCOHERENT")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Tested-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> #
Link: https://lore.kernel.org/r/20231028155101.1039049-1-hch@lst.de
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-11-07 09:37:42 -08:00
Tao Zhou 20238a2cc9 drm/amdgpu: add RAS reset/query operations for XGMI v6_4
Reset/query RAS error status and count.

v2: use XGMI IP version instead of WAFL version.

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2023-11-07 12:03:31 -05:00
Tao Zhou 61fe5536d0 drm/amdgpu: handle extra UE register entries for gfx v9_4_3
The UE registe list is larger than CE list.

Reported-by: yipeng.chai@amd.com
Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Stanley.Yang <Stanley.Yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2023-11-07 12:03:31 -05:00
Tim Huang d78fa1c309 drm/amd/pm: not stop rlc for IMU enabled APUs when suspend
For IMU enabled APUs, after sending the PrepareMp1ForUnload message
to SMU in system_features_control, the RLC registers can't be touched.
The driver to stop the rlc in suspending is no longer required.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2023-11-07 12:03:31 -05:00