Commit graph

1,264,717 commits

Author SHA1 Message Date
Krzysztof Kozlowski
b5a1f7513a iommu: re-use local fwnode variable in iommu_ops_from_fwnode()
iommu_ops_from_fwnode() stores &iommu_spec->np->fwnode in local
variable, so use it to simplify the code (iommu_spec is not changed
between these dereferences).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240216144027.185959-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2024-03-01 13:47:01 +01:00
Krzysztof Kozlowski
5896e6e39b iommu: constify fwnode in iommu_ops_from_fwnode()
Make pointer to fwnode_handle a pointer to const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240216144027.185959-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2024-03-01 13:47:01 +01:00
Krzysztof Kozlowski
b42a905b6a iommu: constify of_phandle_args in xlate
The xlate callbacks are supposed to translate of_phandle_args to proper
provider without modifying the of_phandle_args.  Make the argument
pointer to const for code safety and readability.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240216144027.185959-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2024-03-01 13:46:57 +01:00
Krzysztof Kozlowski
e70e9ecd7c iommu: constify pointer to bus_type
Make pointer to bus_type a pointer to const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20240216144027.185959-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2024-03-01 13:46:57 +01:00
Arnd Bergmann
b797b9cde4 arm64: ZynqMP DT changes for 6.9
dt-bindings:
 - Describe firmware for Versal NET
 - Describe all firmware child nodes
 - Align versal-fpga node name with dt schema
 - Describe k26 rev2 and kv260
 
 DTs:
 - Align firmware node with dt schema
 - Add an optee node
 - Describe reset for CANs
 - Update ECAM size to discover up to 256 buses
 - Describe assigned-clocks for uarts
 - Add u-boot node
 - Comment SMMU entries
 - Align dwc3 nodes with dt schema
 - Rename i2c groups to match dt schema
 - Small DT updates (comments)
 - Fix default clock frequency for si570 (zcu102, zcu106)
 - Add output-enable pins and cover MIO38 (SOM)
 -----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQQbPNTMvXmYlBPRwx7KSWXLKUoMIQUCZdyDIwAKCRDKSWXLKUoM
 IRTlAKCBnBVaSTKA2VR6roEHzjsg2ri+jgCfcnNnm1wc5KdnKsW17kHmKGjTFaI=
 =0Qlr
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmXhzg8ACgkQYKtH/8kJ
 UieZLRAA2UvwLSnLB49ByEj1y0jLCqjWBxAdivzi/hAq3XTw7+CljUupWBggYIYG
 Y3P1Md26+LbUNvlIeEMP/HCznJC3tQiuVmPtpGAJXJoRbFNgpSxqn76Q+FQ03mLc
 UBAtybk9DXxqxqx5lIYbLQ5CtZMPdUObN+kXksu/Uw27vUVjDWsKOIfwpK+D04aj
 req2R6dWEp6diP94++oH33PQPn3i5EeAXM8nN3mDpuS+ffLqdnAhvhb3s2xHNi8m
 B+gpGP59lTRC0AGmoh9TJo+ErEogMDW5PTA3GKlhlZVXNFxkyA2W1tkiVyhvBfu9
 3TrC+pmZeofB3n0d68ekJ5gt8TNeecjvM09DgO6K7imPLXkR5aMagyx+WJHU06O6
 0naQzCYwsMQuDKnspFWYviszk648fvQqNpcU5A/rHkm2mFUTFGV2ZNLRh9YA6UfO
 vRDr7iIQ3N3F0kDmiPBbKoMKEu5o+WFWc8YgjnHbLTThalsGACzHYYyFjQdcnkh7
 9cnG9qdb/dduFFtrp54Uk2I/DF+tBTaiYWvWCHbNDw23nu5u4mLS3t9ORhXPyg7k
 KKikhRXhCjab2hFMGtC7zhiUnGpoK4BPckJSYPCXVNM55qkZO0PgKr7W5Ieor0BM
 XRK4UqbkX8e0knxF0YIGsESno6876hrL1T5E+jO4ldhNUR9nu7U=
 =dkX9
 -----END PGP SIGNATURE-----

Merge tag 'zynqmp-dt-for-6.9' of https://github.com/Xilinx/linux-xlnx into soc/dt

arm64: ZynqMP DT changes for 6.9

dt-bindings:
- Describe firmware for Versal NET
- Describe all firmware child nodes
- Align versal-fpga node name with dt schema
- Describe k26 rev2 and kv260

DTs:
- Align firmware node with dt schema
- Add an optee node
- Describe reset for CANs
- Update ECAM size to discover up to 256 buses
- Describe assigned-clocks for uarts
- Add u-boot node
- Comment SMMU entries
- Align dwc3 nodes with dt schema
- Rename i2c groups to match dt schema
- Small DT updates (comments)
- Fix default clock frequency for si570 (zcu102, zcu106)
- Add output-enable pins and cover MIO38 (SOM)

* tag 'zynqmp-dt-for-6.9' of https://github.com/Xilinx/linux-xlnx: (21 commits)
  dt-bindings: firmware: xilinx: Describe soc-nvmem subnode
  dt-bindings: soc: xilinx: Add support for KV260 CC
  dt-bindings: soc: xilinx: Add support for K26 rev2 SOMs
  arm64: zynqmp: Align usb clock nodes with binding
  arm64: zynqmp: Comment all smmu entries
  arm64: zynqmp: Rename i2c?-gpio to i2c?-gpio-grp
  arm64: zynqmp: Disable Tri-state for MIO38 Pin
  arm64: zynqmp: Remove incorrect comment from kv260s
  arm64: zynqmp: Introduce u-boot options node with bootscr-address
  arm64: zynqmp: Fix comment to be aligned with board name.
  arm64: zynqmp: Update ECAM size to discover up to 256 buses
  arm64: zynqmp: Describe assigned-clocks for uarts
  arm64: zynqmp: Setup default si570 frequency to 156.25MHz
  arm64: zynqmp: Add resets property for CAN nodes
  arm64: zynqmp: Add an OP-TEE node to the device tree
  arm64: zynqmp: Add output-enable pins to SOMs
  arm64: zynqmp: Rename zynqmp-power node to power-management
  dt-bindings: firmware: xilinx: Sort node names (clock-controller)
  dt-bindings: firmware: xilinx: Describe missing child nodes
  dt-bindings: firmware: xilinx: Fix versal-fpga node name
  ...

Link: https://lore.kernel.org/r/CAHTX3dLEoFMTGg1Q4+OuOwWYd8N73YBTXki8Vvj3cGHUpLJ0=A@mail.gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-03-01 13:46:07 +01:00
Arnd Bergmann
b339605081 Add PowerVR Series5 SGX GPUs for the TI SoCs
With the Imagination Rogue GPU binding added, let's also add the devicetree
 binding for earlier SGX GPUs. Let's also patch the TI SoCs for the related
 SGX GPU nodes.
 
 Based on the mailing list discussions, the conclusion was that we need two
 separate device tree bindings, one for Rogue and upcoming GPUS, and one for
 the older SGX GPUs.
 
 For merging the changes, I applied the binding changes together with the
 TI SoC related changes into a branch leaving out the sun6i and mips changes
 as suggested by Rob.
 
 These changes are mostly 32-bit SoCs, but also contains one arm64 change.
 It does not cause any merge conflicts.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEkgNvrZJU/QSQYIcQG9Q+yVyrpXMFAmXcZiwRHHRvbnlAYXRv
 bWlkZS5jb20ACgkQG9Q+yVyrpXNyoBAAgI4qgIZWMNuccDnSwn+UCTDySqa+EBCK
 l7M9jrrLJ8Z+8Wz498lGp6hMD+3fa1bUHYmf8WE9+hWvUL4YcTpAxueTMJ8lvQE0
 b6SM85G08p8Golm+PNXjz+JrJed83bfjZeZQJZqYZsrRyS8fw1Q/dpilydZhURpR
 gm8Sh7V1Q1FXHyh/j3C4Yo5m048bG50PmAp3Cqw8Pu5UvW+mNPMFc+3c06O6wtWy
 jgNb6JiNFkRlNkpnnx+JTjXaZcrsB2k1uodOMYBJjc8fndRlhKPuNYvA9ZEAhgQU
 W4L4BL/uJODciRY9yIciB8Qn5ulsjTJOW+pwQfhRnPAjf4h5/Dw68GJLLtBAtSbt
 2Kt2t+Ma1CBDxumvCpj6FK48rmCKeF3i+HVbgQyqMjh3izDvXLlMCaDXuw5ema3j
 7ihNEw+am0Upy84meT4qzksX73QnVF/3reWGnH97I+fpxW/ec4UcjeU1zEJvSwZ1
 +GwEzl4eufFyBph70pJrU7RUpI52kMm8gdM3Wlcr4I+IkSQITx8pm0ed+l4lKJTI
 YFCZq9RZaf8uGPIi6fUXBeZOHjEJRVpqyrMIBI8Vb4KZAMk8tj1o0UjmxLiU2pLF
 tOzd0s/LJrsKOCDDXWVxk2Y33L+mPm65LV0U3ZJA3k3BVi8k+n/FGqxaSIKmrsEd
 eWjzriVh43w=
 =4Z+H
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmXhzNQACgkQYKtH/8kJ
 UicMlBAA1NuNlFF56ckjDUWXLtL2oQlS/0Wi1uiqCJ6SjvGgly5STBOgLphKfZr2
 tdv43qJf9c8lfseZR6KzEirjc21Lk615jJkXq5Qh6P9FnhvyL6WfZ0XvKkSYZ06e
 sFCfLuFeehaR0i7gN0hFq+4tybotoJS29iu5HYPcDuD+dsNn71B73TmhzWvo6bSd
 ELCjftUkgZWPxHsG+oSDrhmuGSYLCSaDAmJvhCE8hwHLQ7b4ukwGHHu3iLGHJN+e
 vgyviRCYiknGSS1T6I5OHZWUySu3fExexpxtUkSlMsnkDXqGExjD/nanKeQ3nQJp
 ilmJ7jxS/or3Y28PYwDWwRX715FkoBfrPlzNDAFW4QVTNxspYbL1akhdnafofvC2
 ehSpCHW4C8FR04Ias4ofzPPDAPTEzszxpeFHJcYdfSpIv48PHOkHgRuQta0iv8S7
 jP46Q4hMUf+8qZT3MArmN9IjcSW3zVJDO4alWPmBRwUjOQw8vXSx3XrzHQF0Ivmb
 J6AGb/higgCSMrYBBhsnpbXmbBCems/mh4IO/6Ni5hWoX86Qj4Hz1+8qbG5A4aeL
 HM0lujl0ufnHNzIJKlsE/mJhE20fQgHsEkkRDpexDtyYq7B1Vmjx7pJweZyiss67
 j0yWw/6RvUfe/17XI33r2qqtiwr2fZfg2PNPIV1Dr0qXQftB/PA=
 =PpqJ
 -----END PGP SIGNATURE-----

Merge tag 'sgx-for-v6.9-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into soc/dt

Add PowerVR Series5 SGX GPUs for the TI SoCs

With the Imagination Rogue GPU binding added, let's also add the devicetree
binding for earlier SGX GPUs. Let's also patch the TI SoCs for the related
SGX GPU nodes.

Based on the mailing list discussions, the conclusion was that we need two
separate device tree bindings, one for Rogue and upcoming GPUS, and one for
the older SGX GPUs.

For merging the changes, I applied the binding changes together with the
TI SoC related changes into a branch leaving out the sun6i and mips changes
as suggested by Rob.

These changes are mostly 32-bit SoCs, but also contains one arm64 change.
It does not cause any merge conflicts.

* tag 'sgx-for-v6.9-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  arm64: dts: ti: k3-am654-main: Add device tree entry for SGX GPU
  ARM: dts: DRA7xx: Add device tree entry for SGX GPU
  ARM: dts: AM437x: Add device tree entry for SGX GPU
  ARM: dts: AM33xx: Add device tree entry for SGX GPU
  ARM: dts: omap5: Add device tree entry for SGX GPU
  ARM: dts: omap4: Add device tree entry for SGX GPU
  ARM: dts: omap3: Add device tree entry for SGX GPU
  dt-bindings: gpu: Add PowerVR Series5 SGX GPUs
  dt-bindings: gpu: Rename img,powervr to img,powervr-rogue

Link: https://lore.kernel.org/r/pull-1708943489-872615@atomide.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-03-01 13:40:52 +01:00
Arnd Bergmann
06d179e31c i.MX arm64 device tree for 6.9:
- New board support: Apalis eval v1.2 carrier board, Variscite
   VAR-SOM-MX93, phyBOARD-Segin-i.MX93.
 - A series from Adam Ford to enable bluetooth, configure multiple queues
   on eqos, remove unnecessary clock configuration for i.MX8 Beacon boards.
 - Several changesets from Alexander Stein to add i.MX8DXP support, enable
   audio and GPU for i.MX8QXP, re-parent MEDIA_MIPI_PHY1_REF clock for
   i.MX8MP, and improve MBA8xx board description.
 - A few dt-schema fixes from Fabio Estevam for i.MX8MM and i.MX93 devices.
 - A bunch of changes from Frank Li to improve i.MX8QM and i.MX8DXL
   support, correcting edma3 power-domains and interrupt numbers, adding
   I2C, FlexCAN and SMMU devices, etc.
 - A series from Frieder Schrempf to improve imx8mm-kontron board
   descriptions, disabling pulls, fixing up RTC device, adding EEPROM,
   and refactoring OSM-S module, etc.
 - A set of Data Modul i.MX8M Plus eDM SBC improvements from Marek Vasut.
 - A series from Shengjiu Wang to add PDM micphone and SPDIF sound card
   support for imx8mm-evk board.
 - A series of imx8mm-venice boards improvement from Tim Harvey to add
   TPM device, fix USB OTG VBUS etc.
 - Other small and random improvements on various boards.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmXb+44UHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM7XrggAlnkIk0aNw4wTD2OLflPHgE0gD3PR
 D2kn+tXx7iUEIv0JM7x4I4aOUOmZIKKSPn1KdJa1kyUAOxgrQR7bs80jsmmmSi57
 GvVsAR7F/a7enOW1rQXqrCmWJgckD1d5Lb+z5b4JnkQsqQSbTwiyHwIzkRvlAGHK
 zmuN5JSgYt0PKNYd5YylP0uvbnE0aYsDFyRhMxvRYNayb0t1w2gMoGDKc7mHrhXb
 84hU9koauUNtzVH2xGH6G2P6PmdOJ6OhQoPIQ+ZCOWvBlAtKzelGGgaySFO3EKAu
 RkZXqFi1RDofabwZq+aEXFFY7aNEHwkjLdYj0pFiAPRIhJ7cIrRUAGD+tg==
 =7WYT
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmXhzCUACgkQYKtH/8kJ
 UieNgBAAmcz37LIo3ZP1W99t4DNw8lc+TtWLW8dIw1Vew5pojRTIh9docQB+o+Ge
 7W/GTY1DZ2gO8k3V9WQBsHSk6OTumikBRtuPzQKsrL9SR99MkOzCdPMkuXxfUnD5
 WFnzBH/pLr/CmHG+ID8QwWcEDpPwItJWGoK9JtRDeINJEADQuUDAxeW9jeuDihMn
 g3aC/DvhO02LyoY/3Jn5JgZVPl4ZdJBUR04O7VesEn/ktupVJ3QM0FZUFfm1Cinx
 7aivbuf6v4kiQIDmtjR8AmkuJ1vkYCVAMRyNdGnQ04fMn2mXnzH/5cMveH+QSFcl
 6/7EU7R2J/nJZAHAuvsEkrz5b1fXsivE+Z9OTGDeqXB1+BuSmDmCUWlkkrRQaTiO
 ifieyIAtRIeK5py0FNlHNDMA+oQo8oORzOhnP4FhxaSX1G6hpNkYMB1y95TVlcP2
 Z0F486eLr+tyPn97eTK57b47/a2YHBywKFktSF75tVv60QM4fZEtOev2PzEvQqIy
 jLWfp1dMyX8sguNvw2swJ/6rYRVyCGsj6ImvcwR5J7EnhQZKSw4mHFZ0rhaFSioQ
 mh9RxVoaLY17k1N82nOinkgnv5/jODYLXfo1dl3tAqxjiq6QVosVOQ2rxVLhF9fP
 yTfoxPl48a9CGISFwtMjvtmg7baCS92unbN0D8Zp7+UZ2IBwmIU=
 =ZRvF
 -----END PGP SIGNATURE-----

Merge tag 'imx-dt64-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/dt

i.MX arm64 device tree for 6.9:

- New board support: Apalis eval v1.2 carrier board, Variscite
  VAR-SOM-MX93, phyBOARD-Segin-i.MX93.
- A series from Adam Ford to enable bluetooth, configure multiple queues
  on eqos, remove unnecessary clock configuration for i.MX8 Beacon boards.
- Several changesets from Alexander Stein to add i.MX8DXP support, enable
  audio and GPU for i.MX8QXP, re-parent MEDIA_MIPI_PHY1_REF clock for
  i.MX8MP, and improve MBA8xx board description.
- A few dt-schema fixes from Fabio Estevam for i.MX8MM and i.MX93 devices.
- A bunch of changes from Frank Li to improve i.MX8QM and i.MX8DXL
  support, correcting edma3 power-domains and interrupt numbers, adding
  I2C, FlexCAN and SMMU devices, etc.
- A series from Frieder Schrempf to improve imx8mm-kontron board
  descriptions, disabling pulls, fixing up RTC device, adding EEPROM,
  and refactoring OSM-S module, etc.
- A set of Data Modul i.MX8M Plus eDM SBC improvements from Marek Vasut.
- A series from Shengjiu Wang to add PDM micphone and SPDIF sound card
  support for imx8mm-evk board.
- A series of imx8mm-venice boards improvement from Tim Harvey to add
  TPM device, fix USB OTG VBUS etc.
- Other small and random improvements on various boards.

* tag 'imx-dt64-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (77 commits)
  arm64: dts: imx8mm-kontron-bl-osm-s: Fix Ethernet PHY compatible
  arm64: dts: imx8-apalis-v1.1: Remove reset-names from ethernet-phy
  arm64: dts: imx8mp-evk: Fix hdmi@3d node
  arm64: dts: imx93-var-som: Remove phy-supply from eqos
  arm64: dts: imx8mp-phyboard-pollux: Disable pull-up for CD GPIO
  arm64: dts: imx8mp-phyboard-pollux: Reduce drive strength for eqos tx lines
  arm64: dts: imx8mp-phyboard-pollux: Set debug uart muxing to 0x140
  arm64: dts: imx8mp-phyboard-pollux: Add and update rtc devicetree node
  arm64: dts: imx8mm-evk: Add spdif sound card support
  arm64: dts: mba8xx: Add missing #interrupt-cells
  arm64: dts: imx8mp: Set SPI NOR to max 40 MHz on Data Modul i.MX8M Plus eDM SBC
  arm64: dts: imx8mn: tqma8mqnl-mba8mx: Add USB DR overlay
  arm64: dts: imx8mq: tqma8mq-mba8mx: Add missing USB vbus supply
  arm64: dts: freescale: imx8mm/imx8mq: mba8mx: Use PCIe clock generator
  arm64: dts: imx8mn-beacon: Remove unnecessary clock configuration
  arm64: dts: imx8mn: Slow default video_pll clock rate
  arm64: dts: imx8mp-beacon: Configure multiple queues on eqos
  arm64: dts: imx8mp-beacon: Enable Bluetooth
  arm64: dts: freescale: minor whitespace cleanup
  arm64: dts: lx2160a: Fix DTS for full PL011 UART
  ...

Link: https://lore.kernel.org/r/20240226034147.233993-4-shawnguo2@yeah.net
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-03-01 13:37:57 +01:00
Jens Axboe
86b1e613eb Merge tag 'md-6.9-20240301' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-6.9/block
Pull MD updates from Song:

"The major changes are:

 1. Refactor raid1 read_balance, by Yu Kuai and Paul Luse.
 2. Clean up and fix for md_ioctl, by Li Nan.
 3. Other small fixes, by Gui-Dong Han and Heming Zhao."

* tag 'md-6.9-20240301' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: (22 commits)
  md/raid1: factor out helpers to choose the best rdev from read_balance()
  md/raid1: factor out the code to manage sequential IO
  md/raid1: factor out choose_bb_rdev() from read_balance()
  md/raid1: factor out choose_slow_rdev() from read_balance()
  md/raid1: factor out read_first_rdev() from read_balance()
  md/raid1-10: factor out a new helper raid1_should_read_first()
  md/raid1-10: add a helper raid1_check_read_range()
  md/raid1: fix choose next idle in read_balance()
  md/raid1: record nonrot rdevs while adding/removing rdevs to conf
  md/raid1: factor out helpers to add rdev to conf
  md: add a new helper rdev_has_badblock()
  md/raid5: fix atomicity violation in raid5_cache_count
  md/md-bitmap: fix incorrect usage for sb_index
  md: check mddev->pers before calling md_set_readonly()
  md: clean up openers check in do_md_stop() and md_set_readonly()
  md: sync blockdev before stopping raid or setting readonly
  md: factor out a helper to sync mddev
  md: Don't clear MD_CLOSING when the raid is about to stop
  md: return directly before setting did_set_md_closing
  md: clean up invalid BUG_ON in md_ioctl
  ...
2024-03-01 05:37:13 -07:00
Uros Bizjak
ce3576ebd6 locking/rtmutex: Use try_cmpxchg_relaxed() in mark_rt_mutex_waiters()
Use try_cmpxchg() instead of cmpxchg(*ptr, old, new) == old.

The x86 CMPXCHG instruction returns success in the ZF flag, so this change
saves a compare after CMPXCHG (and related move instruction in front of CMPXCHG).

Also, try_cmpxchg() implicitly assigns old *ptr value to "old" when CMPXCHG
fails. There is no need to re-read the value in the loop.

Note that the value from *ptr should be read using READ_ONCE() to prevent
the compiler from merging, refetching or reordering the read.

No functional change intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Waiman Long <longman@redhat.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@kernel.org>
Link: https://lore.kernel.org/r/20240124104953.612063-1-ubizjak@gmail.com
2024-03-01 13:02:05 +01:00
Arnd Bergmann
a634daed69 i.MX ARM device tree for 6.9:
- New board support: Sielaff i.MX6 Solo, Apalis Evaluation Board v1.2.
 - A bunch of i.MX7 TQMA7/MBA7 updates from Alexander Stein that add
   various devices, improve hardware descriptions and fix dt-schema
   warnings, etc.
 - Correct touchscreen rotation for imx6sl-tolino-shine2hd board.
 - An imx53-qsb update from Dmitry Baryshkov to add HDMI expander support.
 - A couple of i.MX1 and i.MX28 device node name fixes from Fabio Estevam.
 - Enable usb3-lpm-capable for LS1021A usb3 node.
 - A couple of imx6dl-yapp4 board improvements from Michal Vokáč.
 - A series from Sebastian Reichel to improve imx6ull descriptions.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmXb9SsUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM5mZggAn8fEfOw9G4uRmOQFee2aEtofqu48
 bwd3dZyQVShJgJh6AgEQ1QeEvYOvpzIOmugleDMrcxAINuJ3YJfAPtY8dtrIcx88
 0ZRiceeRKQVqI4h2HpJ/t0HRs8XsjadnnFtEtiJXt6YYmALk4cBVGzGbuDI6au66
 HZ4HGqM4LGQUSVclV43vt7rZdXxewcLkBgQ5hOsQwQ2rzAWF5uTPRQF8I1kXkBN4
 gHRamiwV6fqttHimMZNOhvLzl4Hmv5gcAWCIs9iD7nDLIY5VN0j9aiNunynWmA83
 A7zGea4Sb/vbHt0dCcCDFwZ4z8rAewoSrCguaJ7h5xugjUWjckkPyQ/JYg==
 =+Fvs
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmXhw1oACgkQYKtH/8kJ
 UidaMw//Q2rzALCWUvO8Neee9IBzyiC5D+tb66a2olkeR+4hYNuMnyVGBP5c3uwk
 eXAptmVel2dGdeoJ7W9MMcaAER7K/r9jHCWtSW9rJt7eHPBqsZVxlwfhztaJzGvQ
 VxOX2yXdrcBLw+X7hBSKrjqCXnwSVlBW0e8Bh5KPfxUowr40V5PArGT9bpt0cPDi
 lW0HQvjnaocA0gJwXmtaVvoSg6C0F9iMYvzB+7aEAcH31unaeu64jRt+LZlDQlvr
 dyfI1jEKBOMncfJ4YaXi+eB0yQadv4Cw8agN7AqStXAT1oJNestZCKe1o3C2yZij
 Spaz1ydjukRwlU7oKU0b/BKZQxEB2yMDzCURkXpNAm9+TkruidD7xtyOJ7O9T/uz
 2F3qwc7oQu0EBX1/Uj7ruEadrKMKHm8/P8K4ojXZ3kTv05I7YvXekAvoGhaJ8wrv
 2ou4+MjScpbSrOONtMRoCMBWWYNFBF1j9TmQtgmhf7afcO918f1jqmvt3OvRI7pr
 wAKt/aTlHWIP62GfxDyLOXp3QQdq/I9xqUkagxUYowHCWuSoEMC68ZxKCVs7Ut7e
 XEcqTTrizyx6k3ErRhznfZSGOfkH48moGl20yjYM+GLl/zLFcwlwyKkiSPpPubND
 KUGY9+9EEtIHxHnoLSQW/zzWSHAonsq/ojCkUvIerld4jA68Ce4=
 =iYGr
 -----END PGP SIGNATURE-----

Merge tag 'imx-dt-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/dt

i.MX ARM device tree for 6.9:

- New board support: Sielaff i.MX6 Solo, Apalis Evaluation Board v1.2.
- A bunch of i.MX7 TQMA7/MBA7 updates from Alexander Stein that add
  various devices, improve hardware descriptions and fix dt-schema
  warnings, etc.
- Correct touchscreen rotation for imx6sl-tolino-shine2hd board.
- An imx53-qsb update from Dmitry Baryshkov to add HDMI expander support.
- A couple of i.MX1 and i.MX28 device node name fixes from Fabio Estevam.
- Enable usb3-lpm-capable for LS1021A usb3 node.
- A couple of imx6dl-yapp4 board improvements from Michal Vokáč.
- A series from Sebastian Reichel to improve imx6ull descriptions.

* tag 'imx-dt-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (43 commits)
  ARM: dts: nxp: imx: fix weim node name
  ARM: dts: nxp: imx6ul: fix touchscreen node name
  ARM: dts: nxp: imx6ul: xnur-gpio -> xnur-gpios
  ARM: dts: imx6ul: Remove fsl,anatop from usbotg1
  ARM: dts: imx6ull: fix pinctrl node name
  ARM: dts: imx1-apf9328: Fix Ethernet node name
  ARM: dts: imx28-evk: Use 'eeprom' as the node name
  ARM: dts: ls1021a: Enable usb3-lpm-capable for usb3 node
  ARM: dts: imx6dl-yapp4: Move the internal switch PHYs under the switch node
  ARM: dts: imx6dl-yapp4: Fix typo in the QCA switch register address
  ARM: dts: imx6ul: Set macaddress location in ocotp
  ARM: dts: imx53-qsb: add support for the HDMI expander
  ARM: dts: imx6ull-dhcom: Remove /omit-if-no-ref/ from node usdhc1-pwrseq
  ARM: dts: imx: Add support for Apalis Evaluation Board v1.2
  ARM: dts: imx6: skov: add aliases for all ethernet nodes
  ARM: dts: imx6qdl-hummingboard: Add rtc0 and rtc1 aliases to fix hctosys
  ARM: dts: imx6dl: Add support for Sielaff i.MX6 Solo board
  ARM: dts: imx6ul: Add missing #thermal-sensor-cells to tempmon
  ARM: dts: imx6sl-tolino-shine2hd: fix touchscreen rotation
  ARM: dts: imx6ull-dhcor: Remove 900MHz operating point
  ...

Link: https://lore.kernel.org/r/20240226034147.233993-3-shawnguo2@yeah.net
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-03-01 13:00:26 +01:00
Arnd Bergmann
911c87949c i.MX dt-bindings for 6.9:
- New compatibles for boards: TQMa8Xx, Sielaff i.MX6 Solo, Toradex Apalis
   imx6q-eval-v1.2, VAR-SOM-MX93, phyBOARD-Segin-i.MX93, UNI-T UTi260B.
 - Add vendor prefix for UNI-T.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmXb72cUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM7xowf9HXigQ2XniaCjTcDJSWCs7ZI8STfj
 fmGIOvmf/dHLbDtDILAOptbAfKAEf7WI7n4lrCDLnZ0JQ66PxwzSPlelv2KMhQ+G
 8yg8sUT3KRySjQHA/pJPplRC4CgqlzqQ/5AdVHIdvtCzCYtbOnPtvGLMUPLrrMes
 fm8I9PD8dIrCuHV/Ab+9gLTM9UWcDD/yT3OWYkC9nj9xA0COjJTWNAKsHf3McMX2
 dXf0EmOdRJBsvVWPJKdfdP5aa968phxTac6TpTFSPNLPiuHryhP5VGD8/KvPC/yY
 AF8EhxEhEkFzkv0X6LkkqyaflWanm13HaFu53NmUQmqCXQtVT6rdAH9Kbg==
 =DRG4
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmXhwmoACgkQYKtH/8kJ
 Uie5Gg//RlarXzla5HxbtVdfQGzn0rCBYRZ2e7Y/HzPa/Z5h1Y6MlmnqN/RsrmHg
 FPeAu0LZKnKGlmFlYbxcuBlKhXPpJpJ1C8BFb4dExE0p8vdvu3sG7pFpxt+graWn
 fB6GiJ9myUeLkQM2I91tw0nt5UJGsDRrimf5bmGNaRj+PCgLlERJ22KlbSQYftYT
 s1fzMoQG5UlMNrafPknMMwR9aigzZsmUq6v8YOLHXuxmJEZALcTwRBJHq6i+sA/L
 6QFQgdLQipotSBJsxw+/gWuzgQ74rdNl9uLLnz3Sb8zm5m4WdOnObpQZddjD3Kg2
 QCRLbA/cYkupD1NtWlLtEqgWpKe5LpHPnc4n0GHxiipf+1ba/jFoUKHPv+mhrUFb
 2svXC8FUqJs0re2G+tSV8ZSdLb7wXLHPdjjeOUFp0ivgKzFPPrbu5GAdOhw+QsFW
 Om31bXUO3fTXBXUhO+IoNzEPNj6ncQ/T3hLCTGcPhEX9Xtp+cil1LUHFUZf2ZzD7
 O5sixglE2e50rs52hHHeDqEisNcDA0dQ9zUkp4P8cnxV6ot3VE8QSNlMYT2vBa2m
 tKih0QaUwraESOgycurz5n6uTzfDAb5an5caVjTDoxU9HztY0MxcDTLY7H+ki46c
 zo+l2N0DlQFIPSVm+4qEI2j9niEQ0EBM9MO6XyY9IJs39ZvIUuY=
 =zd5N
 -----END PGP SIGNATURE-----

Merge tag 'imx-bindings-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/dt

i.MX dt-bindings for 6.9:

- New compatibles for boards: TQMa8Xx, Sielaff i.MX6 Solo, Toradex Apalis
  imx6q-eval-v1.2, VAR-SOM-MX93, phyBOARD-Segin-i.MX93, UNI-T UTi260B.
- Add vendor prefix for UNI-T.

* tag 'imx-bindings-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  dt-bindings: arm: add UNI-T UTi260B
  dt-bindings: vendor-prefixes: add UNI-T
  dt-bindings: arm: fsl: remove redundant company name
  dt-bindings: arm: fsl: add imx8qm apalis eval v1.2 carrier board
  dt-bindings: arm: fsl: Add toradex,apalis_imx6q-eval-v1.2 board
  dt-bindings: arm: fsl: Add phyBOARD-Segin-i.MX93
  dt-bindings: arm: fsl: Add Sielaff i.MX6 Solo board
  dt-bindings: arm: fsl: Add VAR-SOM-MX93 with Symphony
  dt-bindings: arm: add TQMa8Xx boards

Link: https://lore.kernel.org/r/20240226034147.233993-2-shawnguo2@yeah.net
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-03-01 12:56:26 +01:00
Arnd Bergmann
fe37e5cb49 SoCFPGA DTS updates for v6.9
- Drop the "master" suffix in I3C controller node name
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEoHhMeiyk5VmwVMwNGZQEC4GjKPQFAmXb5p4ACgkQGZQEC4Gj
 KPTPag//a2kJliXMJ+uRLOhjV/hWgT5k3JJpPKRP+i7rgXEgGdup2mIrv1sVFIsX
 LLF1IUm9GeAhl80W7PFwLydMHMpQN81VmNTBjwCZXLlJ5x5gSCQwdukIqws9b/Yq
 nd0djDvY/HkmIgA1JR0YQqa8UByDQduG7B8uMny35amt1d1q4LEqyi+OaURtioBR
 /3lybf6lP1GClmKUJAmtec9wA8s+hNg/21uT4lhGXXGMqWlZpCCMUHfFqIhJ5/0r
 LVCslZEph90pjKO84h4xomaXZerujiJx7Fcyc6Xx1DJx1KpNueircsD2jMPKAvcQ
 y72RyTRFd1ntV8rbUXtBh7kXnPPC5tx8Xj1a0XtiNe1MVRrUti9deuYVvEr8SAXZ
 iy6RbFkK+CHM+0pkbNNWri/GSoLc3wQ+OKIV7T/83ht97A3AtkqZKElVQfAXK+dL
 6qZom9J7LA8danrkHtZqSMaL3381V06osfAcyAqDp6R3/z14SRdCdbg2mU4zyTcn
 Oyxz9i+PUqkwHUkYpzEB8mUMd3Q0WnkKwPZ0+fryjB/4arvXFCby40Iy3toIqW7v
 5WdcgoNpcKhZid8ZfNIxg/RpUgJvFcdJo2WPSJSblAOK/CTezR2JEfOLekX0ern3
 ByDt90q1Fbk2U6k1FitjrsAqh2X9D0SiDrv5XSmV4N9Cfu1cypA=
 =W+lw
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmXhwj0ACgkQYKtH/8kJ
 UicjwA/9GvwZCOY5BanSlv9euvSh4KPUHw4SqoCA03tYVQGwdimz3mVeZM1oDRpe
 GC24ZNg35zlcHi1+lvA7yvvZHmv26iHgaP0r2uipSV0yD/6NXHuODYyOANCc++K0
 IwD/7SHrLj825144pTz8603Q2wFDM2SyZKNPa1VmiPFtRYaG/LSq7qqKvj3N4Gbj
 X64vQVJAokj9Z08sWMwfkawZ7OWtZ5rWWukGU96Or32GhT+2EHSyRqDgD7w6Dt79
 7j7ntsnQcAieX9qE2Um/d4ojz/G8Bmyx622gG8fy5pDzKy3cvB2sf+2TOCHss6S0
 u2zZOkKoo4IblIslUL5TAgFleha08NGjK+hGg7RcyXT+2r2p+d162ZRMVzdGGBHP
 IgxwenCVBlDxhhlmxi3VmK35EZ5dl+y6NGLtMLhfkQvBBQ3eSt5N7CuGyuApdiKE
 v4VoXgC656dLklV3ffY/ETxHNDX60Zc9wZtZbqGTrxgn4/RDiaWZCmPjs75NAPyJ
 SoPO3amXP+vgTG8pQDuUO7+lvJZXn4M9CBR9OZRHTegVzlPLSow7Df5XjhiWpO0z
 wUmpPfqbSx2Me0FQgzrsuS1WSKXwS2MQf1Oxn62YjLGaETzn36jIzx2WApER5Nso
 lsRvW/jq1kq0v7k4kLxoaYEvENuWqlhb/em1Qf/QKgRr65OqT20=
 =rvLj
 -----END PGP SIGNATURE-----

Merge tag 'socfpga_dts_updates_for_v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into soc/dt

SoCFPGA DTS updates for v6.9
- Drop the "master" suffix in I3C controller node name

* tag 'socfpga_dts_updates_for_v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux:
  arm64: dts: intel: agilex5: drop "master" I3C node name suffix

Link: https://lore.kernel.org/r/20240226012528.20380-1-dinguyen@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-03-01 12:55:40 +01:00
Uros Bizjak
e807c2a370 locking/x86: Implement local_xchg() using CMPXCHG without the LOCK prefix
Implement local_xchg() using the CMPXCHG instruction without the LOCK prefix.
XCHG is expensive due to the implied LOCK prefix.  The processor
cannot prefetch cachelines if XCHG is used.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Waiman Long <longman@redhat.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: https://lore.kernel.org/r/20240124105816.612670-1-ubizjak@gmail.com
2024-03-01 12:54:25 +01:00
Uros Bizjak
721f791ce1 x86/boot: Use 32-bit XOR to clear registers
x86_64 zero extends 32-bit operations, so for 64-bit operands,
XORL r32,r32 is functionally equal to XORQ r64,r64, but avoids
a REX prefix byte when legacy registers are used.

Slightly smaller code generated, no change in functionality.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20240124103859.611372-1-ubizjak@gmail.com
2024-03-01 12:47:37 +01:00
Christian Brauner
2558e3b231
libfs: add stashed_dentry_prune()
Both pidfs and nsfs use a memory location to stash a dentry for reuse by
concurrent openers. Right now two custom
dentry->d_prune::{ns,pidfs}_prune_dentry() methods are needed that do
the same thing. The only thing that differs is that they need to get to
the memory location to store or retrieve the dentry from differently.
Fix that by remember the stashing location for the dentry in
dentry->d_fsdata which allows us to retrieve it in dentry->d_prune. That
in turn makes it possible to add a common helper that pidfs and nsfs can
both use.

Link: https://lore.kernel.org/r/CAHk-=wg8cHY=i3m6RnXQ2Y2W8psicKWQEZq1=94ivUiviM-0OA@mail.gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
2024-03-01 12:26:29 +01:00
Christian Brauner
159a0d9fd5
libfs: improve path_from_stashed() helper
In earlier patches we moved both nsfs and pidfs to path_from_stashed().
The helper currently tries to add and stash a new dentry if a reusable
dentry couldn't be found and returns EAGAIN if it lost the race to stash
the dentry. The caller can use EAGAIN to retry.

The helper and the two filesystems be written in a way that makes
returning EAGAIN unnecessary. To do this we need to change the
dentry->d_prune() implementation of nsfs and pidfs to not simply replace
the stashed dentry with NULL but to use a cmpxchg() and only replace
their own dentry.

Then path_from_stashed() can then be changed to not just stash a new
dentry when no dentry is currently stashed but also when an already dead
dentry is stashed. If another task managed to install a dentry in the
meantime it can simply be reused. Pack that into a loop and call it a
day.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/CAHk-=wgtLF5Z5=15-LKAczWm=-tUjHO+Bpf7WjBG+UU3s=fEQw@mail.gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
2024-03-01 12:26:23 +01:00
Christian Brauner
b28ddcc32d
pidfs: convert to path_from_stashed() helper
Moving pidfds from the anonymous inode infrastructure to a separate tiny
in-kernel filesystem similar to sockfs, pipefs, and anon_inodefs causes
selinux denials and thus various userspace components that make heavy
use of pidfds to fail as pidfds used anon_inode_getfile() which aren't
subject to any LSM hooks. But dentry_open() is and that would cause
regressions.

The failures that are seen are selinux denials. But the core failure is
dbus-broker. That cascades into other services failing that depend on
dbus-broker. For example, when dbus-broker fails to start polkit and all
the others won't be able to work because they depend on dbus-broker.

The reason for dbus-broker failing is because it doesn't handle failures
for SO_PEERPIDFD correctly. Last kernel release we introduced
SO_PEERPIDFD (and SCM_PIDFD). SO_PEERPIDFD allows dbus-broker and polkit
and others to receive a pidfd for the peer of an AF_UNIX socket. This is
the first time in the history of Linux that we can safely authenticate
clients in a race-free manner.

dbus-broker immediately made use of this but messed up the error
checking. It only allowed EINVAL as a valid failure for SO_PEERPIDFD.
That's obviously problematic not just because of LSM denials but because
of seccomp denials that would prevent SO_PEERPIDFD from working; or any
other new error code from there.

So this is catching a flawed implementation in dbus-broker as well. It
has to fallback to the old pid-based authentication when SO_PEERPIDFD
doesn't work no matter the reasons otherwise it'll always risk such
failures. So overall that LSM denial should not have caused dbus-broker
to fail. It can never assume that a feature released one kernel ago like
SO_PEERPIDFD can be assumed to be available.

So, the next fix separate from the selinux policy update is to try and
fix dbus-broker at [3]. That should make it into Fedora as well. In
addition the selinux reference policy should also be updated. See [4]
for that. If Selinux is in enforcing mode in userspace and it encounters
anything that it doesn't know about it will deny it by default. And the
policy is entirely in userspace including declaring new types for stuff
like nsfs or pidfs to allow it.

For now we continue to raise S_PRIVATE on the inode if it's a pidfs
inode which means things behave exactly like before.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2265630
Link: https://github.com/fedora-selinux/selinux-policy/pull/2050
Link: https://github.com/bus1/dbus-broker/pull/343 [3]
Link: https://github.com/SELinuxProject/refpolicy/pull/762 [4]
Reported-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20240222190334.GA412503@dev-arch.thelio-3990X
Link: https://lore.kernel.org/r/20240218-neufahrzeuge-brauhaus-fb0eb6459771@brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
2024-03-01 12:24:53 +01:00
Christian Brauner
1fa08aece4
nsfs: convert to path_from_stashed() helper
Use the newly added path_from_stashed() helper for nsfs.

Link: https://lore.kernel.org/r/20240218-neufahrzeuge-brauhaus-fb0eb6459771@brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
2024-03-01 12:23:44 +01:00
Christian Brauner
07fd7c3298
libfs: add path_from_stashed()
Add a helper for both nsfs and pidfs to reuse an already stashed dentry
or to add and stash a new dentry.

Link: https://lore.kernel.org/r/20240218-neufahrzeuge-brauhaus-fb0eb6459771@brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
2024-03-01 12:23:44 +01:00
Christian Brauner
cb12fd8e0d
pidfd: add pidfs
This moves pidfds from the anonymous inode infrastructure to a tiny
pseudo filesystem. This has been on my todo for quite a while as it will
unblock further work that we weren't able to do simply because of the
very justified limitations of anonymous inodes. Moving pidfds to a tiny
pseudo filesystem allows:

* statx() on pidfds becomes useful for the first time.
* pidfds can be compared simply via statx() and then comparing inode
  numbers.
* pidfds have unique inode numbers for the system lifetime.
* struct pid is now stashed in inode->i_private instead of
  file->private_data. This means it is now possible to introduce
  concepts that operate on a process once all file descriptors have been
  closed. A concrete example is kill-on-last-close.
* file->private_data is freed up for per-file options for pidfds.
* Each struct pid will refer to a different inode but the same struct
  pid will refer to the same inode if it's opened multiple times. In
  contrast to now where each struct pid refers to the same inode. Even
  if we were to move to anon_inode_create_getfile() which creates new
  inodes we'd still be associating the same struct pid with multiple
  different inodes.

The tiny pseudo filesystem is not visible anywhere in userspace exactly
like e.g., pipefs and sockfs. There's no lookup, there's no complex
inode operations, nothing. Dentries and inodes are always deleted when
the last pidfd is closed.

We allocate a new inode for each struct pid and we reuse that inode for
all pidfds. We use iget_locked() to find that inode again based on the
inode number which isn't recycled. We allocate a new dentry for each
pidfd that uses the same inode. That is similar to anonymous inodes
which reuse the same inode for thousands of dentries. For pidfds we're
talking way less than that. There usually won't be a lot of concurrent
openers of the same struct pid. They can probably often be counted on
two hands. I know that systemd does use separate pidfd for the same
struct pid for various complex process tracking issues. So I think with
that things actually become way simpler. Especially because we don't
have to care about lookup. Dentries and inodes continue to be always
deleted.

The code is entirely optional and fairly small. If it's not selected we
fallback to anonymous inodes. Heavily inspired by nsfs which uses a
similar stashing mechanism just for namespaces.

Link: https://lore.kernel.org/r/20240213-vfs-pidfd_fs-v1-2-f863f58cfce1@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
2024-03-01 12:23:37 +01:00
Michael Ellerman
380cb2f4df selftests/powerpc: Fix fpu_signal failures
My recent commit e5d00aaac6 ("selftests/powerpc: Check all FPRs in
fpu_preempt") inadvertently broke the fpu_signal test.

It needs to take into account that fpu_preempt now loads 32 FPRs, so
enlarge darray.

Also use the newly added randomise_darray() to properly randomise darray.

Finally the checking done in signal_fpu_sig() needs to skip checking
f30/f31, because they are used as scratch registers in check_all_fprs(),
called by preempt_fpu(), and so could hold other values when the signal
is taken.

Fixes: e5d00aaac6 ("selftests/powerpc: Check all FPRs in fpu_preempt")
Reported-by: Spoorthy <spoorthy@linux.ibm.com>
Depends-on: 2ba107f679 ("selftests/powerpc: Generate better bit patterns for FPU tests")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240301101035.1230024-1-mpe@ellerman.id.au
2024-03-01 22:15:30 +11:00
David S. Miller
e960825709 Merge branch 'inet_dump_ifaddr-no-rtnl'
Eric Dumazet says:

====================
inet: no longer use RTNL to protect inet_dump_ifaddr()

This series convert inet so that a dump of addresses (ip -4 addr)
no longer requires RTNL.
====================

Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 11:09:40 +00:00
Eric Dumazet
cdb2f80f1c inet: use xa_array iterator to implement inet_dump_ifaddr()
1) inet_dump_ifaddr() can can run under RCU protection
   instead of RTNL.

2) properly return 0 at the end of a dump, avoiding an
   an extra recvmsg() system call.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 11:09:39 +00:00
Eric Dumazet
590e92cdc8 inet: prepare inet_base_seq() to run without RTNL
In the following patch, inet_base_seq() will no longer be called
with RTNL held.

Add READ_ONCE()/WRITE_ONCE() annotations in dev_base_seq_inc()
and inet_base_seq().

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 11:09:39 +00:00
Eric Dumazet
3ddc2231c8 inet: annotate data-races around ifa->ifa_flags
ifa->ifa_flags can be read locklessly.

Add appropriate READ_ONCE()/WRITE_ONCE() annotations.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 11:09:39 +00:00
Eric Dumazet
9f6fa3c4e7 inet: annotate data-races around ifa->ifa_preferred_lft
ifa->ifa_preferred_lft can be read locklessly.

Add appropriate READ_ONCE()/WRITE_ONCE() annotations.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 11:09:39 +00:00
Eric Dumazet
a5fcf74d80 inet: annotate data-races around ifa->ifa_valid_lft
ifa->ifa_valid_lft can be read locklessly.

Add appropriate READ_ONCE()/WRITE_ONCE() annotations.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 11:09:39 +00:00
Eric Dumazet
3cd3e72ccb inet: annotate data-races around ifa->ifa_tstamp and ifa->ifa_cstamp
ifa->ifa_tstamp can be read locklessly.

Add appropriate READ_ONCE()/WRITE_ONCE() annotations.

Do the same for ifa->ifa_cstamp to prepare upcoming changes.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 11:09:39 +00:00
songxiebing
642b02b45d ALSA: hda: optimize the probe codec process
In azx_probe_codecs function, when bus->codec_mask is becomes to 0(no codecs),
execute azx_init_chip, bus->codec_mask will be initialized to a value again,
this causes snd_hda_codec_new function to run, the process is as follows:
-->snd_hda_codec_new
-->snd_hda_codec_device_init
-->snd_hdac_device_init---snd_hdac_read_parm(...AC_PAR_VENDOR_ID) 2s
		       ---snd_hdac_read_parm(...AC_PAR_VENDOR_ID) 2s
		       ---snd_hdac_read_parm(...AC_PAR_SUBSYSTEM_ID) 2s
		       ---snd_hdac_read_parm(...AC_PAR_REV_ID) 2s
		       ---snd_hdac_read_parm(...AC_PAR_NODE_COUNT) 2s
when no codecs, read communication is error, each command will be polled for
2 second, a total of 10s, it is easy to some problem.
like this:
  2 [   14.833404][ 6] [  T164] hda 0006:00: Codec #0 probe error; disabling it...
  3 [   14.844178][ 6] [  T164] hda 0006:00: codec_mask = 0x1
  4 [   14.880532][ 6] [  T164] hda 0006:00: too slow response, last cmd=0x0f0000
  5 [   15.891988][ 6] [  T164] hda 0006:00: too slow response, last cmd=0x0f0000
  6 [   16.978090][ 6] [  T164] hda 0006:00: too slow response, last cmd=0x0f0001
  7 [   18.140895][ 6] [  T164] hda 0006:00: too slow response, last cmd=0x0f0002
  8 [   19.135516][ 6] [  T164] hda 0006:00: too slow response, last cmd=0x0f0004
 10 [   19.900086][ 6] [  T164] hda 0006:00: no codecs initialized
 11 [   45.573398][ 2] [    C2] watchdog: BUG: soft lockup - CPU#2 stuck for 22s! [kworker/2:0:25]

Here, when bus->codec_mask is 0, use a direct break to avoid execute snd_hda_codec_new function.

Signed-off-by: songxiebing <songxiebing@kylinos.cn>
Link: https://lore.kernel.org/r/20240301011841.7247-1-soxiebing@163.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-03-01 11:46:30 +01:00
Kailang Yang
d397b6e561 ALSA: hda/realtek - Fix headset Mic no show at resume back for Lenovo ALC897 platform
Headset Mic will no show at resume back.
This patch will fix this issue.

Fixes: d7f32791a9 ("ALSA: hda/realtek - Add headset Mic support for Lenovo ALC897 platform")
Cc: <stable@vger.kernel.org>
Signed-off-by: Kailang Yang <kailang@realtek.com>
Link: https://lore.kernel.org/r/4713d48a372e47f98bba0c6120fd8254@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-03-01 11:44:28 +01:00
David S. Miller
76f06cbd7b Merge branch 'netdevsim-link'
David Wei says:

====================
netdevsim: link and forward skbs between ports

This patchset adds the ability to link two netdevsim ports together and
forward skbs between them, similar to veth. The goal is to use netdevsim
for testing features e.g. zero copy Rx using io_uring.

This feature was tested locally on QEMU, and a selftest is included.

I ran netdev selftests CI style and all tests but the following passed:
- gro.sh
- l2tp.sh
- ip_local_port_range.sh

gro.sh fails because virtme-ng mounts as read-only and it tries to write
to log.txt. This issue was reported to virtme-ng upstream.

l2tp.sh and ip_local_port_range.sh both fail for me on net-next/main as
well.

---
v13->v14:
- implement ndo_get_iflink()
- fix returning 0 if peer is already linked during linking or not linked
  during unlinking
- bump dropped counter if nsim_ipsec_tx() fails and generally reorder
  nsim_start_xmit()
- fix overflowing lines and indentations

v12->v13:
- wait for socat listening port to be ready before sending data in
  selftest

v11->v12:
- fix leaked netns refs
- fix rtnetlink.sh kci_test_ipsec_offload() selftest

v10->v11:
- add udevadm settle after creating netdevsims in selftest

v9->v10:
- fix not freeing skb when not there is no peer
- prevent possible id clashes in selftest
- cleanup selftest on error paths

v8->v9:
- switch to getting netns using fd rather than id
- prevent linking a netdevsim to itself
- update tests

v7->v8:
- fix not dereferencing RCU ptr using rcu_dereference()
- remove unused variables in selftest

v6->v7:
- change link syntax to netnsid:ifidx
- replace dev_get_by_index() with __dev_get_by_index()
- check for NULL peer when linking
- add a sysfs attribute for unlinking
- only update Tx stats if not dropped
- update selftest

v5->v6:
- reworked to link two netdevsims using sysfs attribute on the bus
  device instead of debugfs due to deadlock possibility if a netdevsim
  is removed during linking
- removed unnecessary patch maintaining a list of probed nsim_devs
- updated selftest

v4->v5:
- reduce nsim_dev_list_lock critical section
- fixed missing mutex unlock during unwind ladder
- rework nsim_dev_peer_write synchronization to take devlink lock as
  well as rtnl_lock
- return err msgs to user during linking if port doesn't exist or
  linking to self
- update tx stats outside of RCU lock

v3->v4:
- maintain a mutex protected list of probed nsim_devs instead of using
  nsim_bus_dev
- fixed synchronization issues by taking rtnl_lock
- track tx_dropped skbs

v2->v3:
- take lock when traversing nsim_bus_dev_list
- take device ref when getting a nsim_bus_dev
- return 0 if nsim_dev_peer_read cannot find the port
- address code formatting
- do not hard code values in selftests
- add Makefile for selftests

v1->v2:
- renamed debugfs file from "link" to "peer"
- replaced strstep() with sscanf() for consistency
- increased char[] buf sz to 22 for copying id + port from user
- added err msg w/ expected fmt when linking as a hint to user
- prevent linking port to itself
- protect peer ptr using RCU

====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 10:43:11 +00:00
David Wei
8ee60f9c41 netdevsim: fix rtnetlink.sh selftest
I cleared IFF_NOARP flag from netdevsim dev->flags in order to support
skb forwarding. This breaks the rtnetlink.sh selftest
kci_test_ipsec_offload() test because ipsec does not connect to peers it
cannot transmit to.

Fix the issue by adding a neigh entry manually. ipsec_offload test now
successfully pass.

Signed-off-by: David Wei <dw@davidwei.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 10:43:10 +00:00
David Wei
dfb429ea4f netdevsim: add selftest for forwarding skb between connected ports
Connect two netdevsim ports in different namespaces together, then send
packets between them using socat.

Signed-off-by: David Wei <dw@davidwei.uk>
Reviewed-by: Maciek Machnikowski <maciek@machnikowski.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 10:43:10 +00:00
David Wei
8debcf5832 netdevsim: add ndo_get_iflink() implementation
Add an implementation for ndo_get_iflink() in netdevsim that shows the
ifindex of the linked peer, if any.

Signed-off-by: David Wei <dw@davidwei.uk>
Reviewed-by: Maciek Machnikowski <maciek@machnikowski.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 10:43:10 +00:00
David Wei
9eb95228a7 netdevsim: forward skbs from one connected port to another
Forward skbs sent from one netdevsim port to its connected netdevsim
port using dev_forward_skb, in a spirit similar to veth.

Add a tx_dropped variable to struct netdevsim, tracking the number of
skbs that could not be forwarded using dev_forward_skb().

The xmit() function accessing the peer ptr is protected by an RCU read
critical section. The rcu_read_lock() is functionally redundant as since
v5.0 all softirqs are implicitly RCU read critical sections; but it is
useful for human readers.

If another CPU is concurrently in nsim_destroy(), then it will first set
the peer ptr to NULL. This does not affect any existing readers that
dereferenced a non-NULL peer. Then, in unregister_netdevice(), there is
a synchronize_rcu() before the netdev is actually unregistered and
freed. This ensures that any readers i.e. xmit() that got a non-NULL
peer will complete before the netdev is freed.

Any readers after the RCU_INIT_POINTER() but before synchronize_rcu()
will dereference NULL, making it safe.

The codepath to nsim_destroy() and nsim_create() takes both the newly
added nsim_dev_list_lock and rtnl_lock. This makes it safe with
concurrent calls to linking two netdevsims together.

Signed-off-by: David Wei <dw@davidwei.uk>
Reviewed-by: Maciek Machnikowski <maciek@machnikowski.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 10:43:10 +00:00
David Wei
f532957d76 netdevsim: allow two netdevsim ports to be connected
Add two netdevsim bus attribute to sysfs:
/sys/bus/netdevsim/link_device
/sys/bus/netdevsim/unlink_device

Writing "A M B N" to link_device will link netdevsim M in netnsid A with
netdevsim N in netnsid B.

Writing "A M" to unlink_device will unlink netdevsim M in netnsid A from
its peer, if any.

rtnl_lock is taken to ensure nothing changes during the linking.

Signed-off-by: David Wei <dw@davidwei.uk>
Reviewed-by: Maciek Machnikowski <maciek@machnikowski.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 10:43:10 +00:00
Tom Zanussi
cdb083e73d crypto: iaa - Fix comp/decomp delay statistics
The comp/decomp delay statistics currently have no callers; somehow
they were dropped during refactoring. There originally were also two
sets, one for the async algorithm, the other for the synchronous
version. Because the synchronous algorithm was dropped, one set should
be removed. To keep it consistent with the rest of the stats, and
since there's no ambiguity, remove the acomp/adecomp versions.  Also
add back the callers.

Reported-by: Rex Zhang <rex.zhang@intel.com>
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2024-03-01 18:35:40 +08:00
Tom Zanussi
262534ddc8 crypto: iaa - Fix async_disable descriptor leak
The disable_async paths of iaa_compress/decompress() don't free idxd
descriptors in the async_disable case. Currently this only happens in
the testcases where req->dst is set to null. Add a test to free them
in those paths.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2024-03-01 18:35:40 +08:00
Varshini Rajendran
7248e523a0 dt-bindings: rng: atmel,at91-trng: add sam9x7 TRNG
Add compatbile for Microchip sam9x7 TRNG.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2024-03-01 18:35:40 +08:00
Varshini Rajendran
1e45f6051f dt-bindings: crypto: add sam9x7 in Atmel TDES
Add DT bindings for atmel TDES.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2024-03-01 18:35:40 +08:00
Varshini Rajendran
4234f365eb dt-bindings: crypto: add sam9x7 in Atmel SHA
Add DT bindings for atmel SHA.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2024-03-01 18:35:40 +08:00
Varshini Rajendran
7bb9f42d9e dt-bindings: crypto: add sam9x7 in Atmel AES
Add DT bindings for atmel AES.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2024-03-01 18:35:40 +08:00
Eric Biggers
2beb81fbf0 crypto: remove CONFIG_CRYPTO_STATS
Remove support for the "Crypto usage statistics" feature
(CONFIG_CRYPTO_STATS).  This feature does not appear to have ever been
used, and it is harmful because it significantly reduces performance and
is a large maintenance burden.

Covering each of these points in detail:

1. Feature is not being used

Since these generic crypto statistics are only readable using netlink,
it's fairly straightforward to look for programs that use them.  I'm
unable to find any evidence that any such programs exist.  For example,
Debian Code Search returns no hits except the kernel header and kernel
code itself and translations of the kernel header:
https://codesearch.debian.net/search?q=CRYPTOCFGA_STAT&literal=1&perpkg=1

The patch series that added this feature in 2018
(https://lore.kernel.org/linux-crypto/1537351855-16618-1-git-send-email-clabbe@baylibre.com/)
said "The goal is to have an ifconfig for crypto device."  This doesn't
appear to have happened.

It's not clear that there is real demand for crypto statistics.  Just
because the kernel provides other types of statistics such as I/O and
networking statistics and some people find those useful does not mean
that crypto statistics are useful too.

Further evidence that programs are not using CONFIG_CRYPTO_STATS is that
it was able to be disabled in RHEL and Fedora as a bug fix
(https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2947).

Even further evidence comes from the fact that there are and have been
bugs in how the stats work, but they were never reported.  For example,
before Linux v6.7 hash stats were double-counted in most cases.

There has also never been any documentation for this feature, so it
might be hard to use even if someone wanted to.

2. CONFIG_CRYPTO_STATS significantly reduces performance

Enabling CONFIG_CRYPTO_STATS significantly reduces the performance of
the crypto API, even if no program ever retrieves the statistics.  This
primarily affects systems with large number of CPUs.  For example,
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2039576 reported
that Lustre client encryption performance improved from 21.7GB/s to
48.2GB/s by disabling CONFIG_CRYPTO_STATS.

It can be argued that this means that CONFIG_CRYPTO_STATS should be
optimized with per-cpu counters similar to many of the networking
counters.  But no one has done this in 5+ years.  This is consistent
with the fact that the feature appears to be unused, so there seems to
be little interest in improving it as opposed to just disabling it.

It can be argued that because CONFIG_CRYPTO_STATS is off by default,
performance doesn't matter.  But Linux distros tend to error on the side
of enabling options.  The option is enabled in Ubuntu and Arch Linux,
and until recently was enabled in RHEL and Fedora (see above).  So, even
just having the option available is harmful to users.

3. CONFIG_CRYPTO_STATS is a large maintenance burden

There are over 1000 lines of code associated with CONFIG_CRYPTO_STATS,
spread among 32 files.  It significantly complicates much of the
implementation of the crypto API.  After the initial submission, many
fixes and refactorings have consumed effort of multiple people to keep
this feature "working".  We should be spending this effort elsewhere.

Cc: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2024-03-01 18:35:40 +08:00
Herbert Xu
f66a211e8c crypto: dh - Make public key test FIPS-only
The function dh_is_pubkey_valid was added to for FIPS but it was
only partially conditional to fips_enabled.

In particular, the first test in the function relies on the last
test to work properly, but the last test is only run in FIPS mode.

Fix this inconsistency by making the whole function conditional
on fips_enabled.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2024-03-01 18:35:40 +08:00
Herbert Xu
c0afb6b88f crypto: rk3288 - Fix use after free in unprepare
The unprepare call must be carried out before the finalize call
as the latter can free the request.

Fixes: c66c17a0f6 ("crypto: rk3288 - Remove prepare/unprepare request")
Reported-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2024-03-01 18:33:29 +08:00
Masahisa Kojima
1c61728be2 MAINTAINERS: net: netsec: add myself as co-maintainer
Add myself as co-maintainer for Socionext netsec driver.
This commit also removes Jassi from maintainer since he
no longer has a Developerbox.

Cc: Jassi Brar <jaswinder.singh@linaro.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Masahisa Kojima <kojima.masahisa@socionext.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 10:33:20 +00:00
David S. Miller
e2d890afba Merge branch 'selftests-xfail'
Jakub Kicinski says:

====================
selftests: kselftest_harness: support using xfail

When running selftests for our subsystem in our CI we'd like all
tests to pass. Currently some tests use SKIP for cases they
expect to fail, because the kselftest_harness limits the return
codes to pass/fail/skip. XFAIL which would be a great match
here cannot be used.

Remove the no_print handling and use vfork() to run the test in
a different process than the setup. This way we don't need to
pass "failing step" via the exit code. Further clean up the exit
codes so that we can use all KSFT_* values. Rewrite the result
printing to make handling XFAIL/XPASS easier. Support tests
declaring combinations of fixture + variant they expect to fail.

Merge plan is to put it on top of -rc6 and merge into net-next.
That way others should be able to pull the patches without
any networking changes.

v4:
 - rebase on top of Mickael's vfork() changes
v3: https://lore.kernel.org/all/20240220192235.2953484-1-kuba@kernel.org/
 - combine multiple series
 - change to "list of expected failures" rather than SKIP()-like handling
v2: https://lore.kernel.org/all/20240216002619.1999225-1-kuba@kernel.org/
 - fix alignment
follow up RFC: https://lore.kernel.org/all/20240216004122.2004689-1-kuba@kernel.org/
v1: https://lore.kernel.org/all/20240213154416.422739-1-kuba@kernel.org/
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 10:30:30 +00:00
Jakub Kicinski
c05bf0e933 selftests: ip_local_port_range: use XFAIL instead of SKIP
SCTP does not support IP_LOCAL_PORT_RANGE and we know it,
so use XFAIL instead of SKIP.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 10:30:29 +00:00
Jakub Kicinski
2709473c93 selftests: kselftest_harness: support using xfail
Currently some tests report skip for things they expect to fail
e.g. when given combination of parameters is known to be unsupported.
This is confusing because in an ideal test environment and fully
featured kernel no tests should be skipped.

Selftest summary line already includes xfail and xpass counters,
e.g.:

  Totals: pass:725 fail:0 xfail:0 xpass:0 skip:0 error:0

but there's no way to use it from within the harness.

Add a new per-fixture+variant combination list of test cases
we expect to fail.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 10:30:29 +00:00
Jakub Kicinski
378193eff3 selftests: kselftest_harness: let PASS / FAIL provide diagnostic
Switch to printing KTAP line for PASS / FAIL with ksft_test_result_code(),
this gives us the ability to report diagnostic messages.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-01 10:30:29 +00:00