Commit Graph

1294397 Commits

Author SHA1 Message Date
Linus Torvalds
28bbe4ea68 I2C for 6.11-rc1 second batch
The I2C core has two header documentation updates to be applied as the
 dependecies are in now.
 
 The I2C host drivers add some patches which nearly fell through the
 cracks, namely:
 
 Added descriptions in the DTS for the Qualcomm SM8650 and SM8550
 Camera Control Interface (CCI).
 
 Added support for the "settle-time-us" property, which allows the
 gpio-mux device to switch from one bus to another with a configurable
 delay. The time can be set in the DTS. The latest change also includes
 file sorting.
 
 Fixed slot numbering in the SMBus framework to prevent failures
 when more than 8 slots are occupied. It now enforces a a maximum
 of 8 slots to be used. This ensures that the Intel PIIX4 device
 can register the SPDs correctly without failure, even if other
 slots are populated but not used.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmafkDoACgkQFA3kzBSg
 KbZxGA//UDwQSEmkzlkoUV2i3bAgVTVgoG6IPPNfbwnOo8aUS6uV85yPrbEejenU
 OPVMtieZzRyLAYQOSvzj/a4Cqrhsvryo82hLD1l4TtSoZgxPYRjM5j0TPk4mGHTx
 8sfH5WmZ0yssvaK738/4Q7MfDjPTa/yBQ/cbiPHbGczBcqKidX9ExPQHGraZzbGb
 VQK7rSwy8qnDlz/9U/fmV1J4CPJufQrmD/tz/Ws2uyH49M9YSYpDkCwCEGE2OX9E
 v4nMQyFnL7c7SmF5NuLQecvJYnndy0vbnRr14kloFg2BdGE4rjSrgtUIWSZshgoQ
 kustbUdDD6W1QohpHUNc/sYIt1pwF4BkVyRzf99HaX3dsWmS5FgWoITyH+2OMcCz
 1QVOtgAVw37Hg0oQMwDOuvBFyVa7aU3mvcB0/v+glaDnmVATgssXcZmhTPOv/Vg2
 sgpirkVB3xrfG6qbi1g0nM9JuDuR/qYrgKa6aoXVO/xeKwv9+sH7GqK4iTc+t60G
 hciJ11iPnnING9O5zCrpKpZxXkGFlncGaay9eEEJ1qtdDQk9ZBEh1+hYaGwDvvWL
 eehkZBjWQG83rhaeSbnilrbsrRcQRBhp6SrXojL3oqOgxzNkEnuX8HdKEfhFTHkR
 g2sIwfRO+wXggn7RiGqbOMeMwfM2heHB9qKaqxRPKvuzNgDgIxg=
 =WgDo
 -----END PGP SIGNATURE-----

Merge tag 'i2c-for-6.11-rc1-second-batch' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull more i2c updates from Wolfram Sang:
 "The I2C core has two header documentation updates as the dependecies
  are in now.

  The I2C host drivers add some patches which nearly fell through the
  cracks:

   - Added descriptions in the DTS for the Qualcomm SM8650 and SM8550
     Camera Control Interface (CCI).

   - Added support for the "settle-time-us" property, which allows the
     gpio-mux device to switch from one bus to another with a
     configurable delay. The time can be set in the DTS. The latest
     change also includes file sorting.

   - Fixed slot numbering in the SMBus framework to prevent failures
     when more than 8 slots are occupied. It now enforces a a maximum of
     8 slots to be used. This ensures that the Intel PIIX4 device can
     register the SPDs correctly without failure, even if other slots
     are populated but not used"

* tag 'i2c-for-6.11-rc1-second-batch' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: header: improve kdoc for i2c_algorithm
  i2c: header: remove unneeded stuff regarding i2c_algorithm
  i2c: piix4: Register SPDs
  i2c: smbus: remove i801 assumptions from SPD probing
  i2c: mux: gpio: Add support for the 'settle-time-us' property
  i2c: mux: gpio: Re-order #include to match alphabetic order
  dt-bindings: i2c: mux-gpio: Add 'settle-time-us' property
  dt-bindings: i2c: qcom-cci: Document sm8650 compatible
  dt-bindings: i2c: qcom-cci: Document sm8550 compatible
2024-07-23 09:59:20 -07:00
Linus Torvalds
d51f8f63f7 broadcom: remove unused pdc_dma_map
imx: fix TXDB_V2 channel race condition
 mediatek: cleanup and refactor driver
       add bindings for gce-props
 omap: fix mailbox interrupt sharing
 qcom: add bindings for SA8775p
       add CPUCP driver
 zynqmp: make polling period configurable
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE6EwehDt/SOnwFyTyf9lkf8eYP5UFAmadSsUACgkQf9lkf8eY
 P5XSXg/9GDhIXf3nfqfRbuIA29tWwEPDBZJ4KTtiuW0lNrk2x+VyEo90xvLly4vZ
 h/AbZLDjnWE+Tfbht7dDrbXMcmpDAsRKhoQ6dDbz9leOMGDBMGwAqXOKim7SCY38
 SqgPwR1LHXoJRBoD7Qa91PNcScCF6his5T+bTSLsJCJ9CL8wzh8OrADIJSCS7Qpi
 ubBuV4sOey9SCnfdxn/TR4sfaJw1cu8DPSWUXEoAkvFkOt4SxZZZSVdb0JgnCm6y
 rEhp4E3j5YlVbSR382WoXmXijo3hl9NY3vI3180rE9Bu1F/c8au3cP0gHKnsFYBd
 trLamCYMAsBzRYQCmTKqIhS87b//5MiCQIMmid4UrtItRZlrK2dJV6fRT1fHhfq9
 ZrErep6x0Sr0qSIUgqcRHIaBdSxRRg63vfHcWRjvpsjwaKXW/vJQhWMFXceIuxi7
 YrfuoogoCkydYjUoU9lJN0rLBmZF5ak88rf/KCRbYxRLOxFsJrNd81Dy1mkqCSAl
 oG3p+D7znKbgVsdLktGihk3UpkTRS09hD//FSncktFPIa8nuesY9hKe2RfFbqk3b
 HhPvhPz04Sig/DPnQNzNcxS9TCCbMLdS+9x+YVMTYamFGjbSAo4Jkczd1ttERqXI
 BPhTHvNpqqwgEmQWCVOzEiJMCtlomP+D0gezZM8iOlTrej3zOak=
 =JTUn
 -----END PGP SIGNATURE-----

Merge tag 'mailbox-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox

Pull mailbox updates from Jassi Brar:
 "broadcom:
   - remove unused pdc_dma_map

  imx:
   - fix TXDB_V2 channel race condition

  mediatek:
   - cleanup and refactor driver
   - add bindings for gce-props

  omap:
   - fix mailbox interrupt sharing

  qcom:
   - add bindings for SA8775p
   - add CPUCP driver

  zynqmp:
   - make polling period configurable"

* tag 'mailbox-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox:
  mailbox: mtk-cmdq: Move devm_mbox_controller_register() after devm_pm_runtime_enable()
  mailbox: zynqmp-ipi: Make polling period configurable
  mailbox: qcom-cpucp: fix 64BIT dependency
  mailbox: Add support for QTI CPUCP mailbox controller
  dt-bindings: mailbox: qcom: Add CPUCP mailbox controller bindings
  dt-bindings: remoteproc: qcom,sa8775p-pas: Document the SA8775p ADSP, CDSP and GPDSP
  mailbox: mtk-cmdq: add missing MODULE_DESCRIPTION() macro
  mailbox: bcm-pdc: remove unused struct 'pdc_dma_map'
  mailbox: imx: fix TXDB_V2 channel race condition
  mailbox: omap: Fix mailbox interrupt sharing
  mailbox: mtk-cmdq: Dynamically allocate clk_bulk_data structure
  mailbox: mtk-cmdq: Move and partially refactor clocks probe
  mailbox: mtk-cmdq: Stop requiring name for GCE clock
  dt-bindings: mailbox: Add mediatek,gce-props.yaml
2024-07-23 09:55:27 -07:00
Linus Torvalds
71bed1ec0f PCMCIA: improvements for v6.11-rc1
A number of tiny cleanups of the PCMCIA subsystem by Jeff Johnson,
 Jules Irenge, and Krzysztof Kozlowski.
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEmgXaWKgmjrvkPhLCmpdgiUyNow0FAmaeqv8bHGxpbnV4QGRv
 bWluaWticm9kb3dza2kubmV0AAoJEJqXYIlMjaMNvv4P/1oHh6odH9EVTlnVPAGb
 BY+oRMCooVDqHZBhKQHURPQ9FcGXUArmQUxp212qugUTQNHgfgQbDsN4YpnLvCe9
 1M5QSLuWBqFv1YkZDpWf13HZ/cVycA3FSYYz2GC2RtXLeAhAkh97q634gEAxsFQ3
 DOutFbP9GzBP7F16gmGth6AXEwCZdHTXymfcZ6zu+b8cirmDzVFtpWMaAyILXngV
 LD0IzZ9/gl04va/Zztc6GkFnHtHO8ar83DDiZRr5kmQtLEchQJgvlaqa6XnlTFTd
 66yCFuI7YkSgIil/qVFWS7eZ7yBzNQNM8GxWTbXXa5ORp8TATvFeAl/JM+Vv7EXW
 MxRDWc+PAIsp3Gf+EWP5ooTk1Cg7bTMlPhvsSm8qT0QQ9FNW+jNj9toTigSfAQ/q
 tljxKTajA90oFlsh0Fp/JcgNJrNsn5gk/1ZfDn4zqlLq2Zw4UrIxguJNcDs8+kk+
 KlvpTmzNFvALhiIetXXm0AifMPfLlNwpqI8nbMOWd+LqQBZLHHl9kq4plpxeoUx7
 gg7ORAayIYYI345jMDdTYGlLYj2WB1QO7kKpmpRFPaiar5CGmm5jPhu8eEkAB27B
 YlcP/vtZRL3MXrhN8+AWTF0+WE94wymknAhOtX6xXGcz6Ybs/2np7g46eBxYE/au
 vHXFFzX9deg/AHbkZuRsZxvr
 =JwCl
 -----END PGP SIGNATURE-----

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

Pull PCMCIA updates from Dominik Brodowski:
 "A number of tiny cleanups of the PCMCIA subsystem by Jeff Johnson,
  Jules Irenge, and Krzysztof Kozlowski"

* tag 'pcmcia-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux:
  pcmcia: add missing MODULE_DESCRIPTION() macros
  pcmcia: Use resource_size function on resource object
  pcmcia: bcm63xx: drop driver owner assignment
2024-07-23 09:46:17 -07:00
Linus Torvalds
fd71b9a07b power supply and reset changes for the 6.11 series
* power-supply core
    - new charging_orange_full_green RGB LED trigger
    - simplify and cleanup power-supply LED trigger code
    - expose power information via hwmon compatibility layer
  * new hardware support
    - enable battery support for Qualcomm Snapdragon X Elite
    - new battery driver for Maxim MAX17201/MAX17205
    - new battery driver for Lenovo Yoga C630 laptop (custom EC)
  * cleanup 'struct i2c_device_id' initializations
  * misc. small battery driver cleanups and fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmadpdQACgkQ2O7X88g7
 +poOIBAAm8B28rdJc35M0qj4akFp67z84wxGs0yR3KmwwUyIv5bHMZKXuSgOdMJ7
 bVA/W5Lvzi/Mp6bF5lt4EbFt3QGIEG2odWMWcoc/PTdKaPYC7CcDBVGCZr7hQFJS
 2THzaUuLVDQzVwBc62YcFh7AB+xQmJ/SaX+Ci2k//vFyQJ1EfBiOkoq6MjJXCPcT
 hz21hXCQjGirNSsV4gxK1EwefrRomj4MVCHCf/E5i2tM2lNtO+HPu28UznJYEh9S
 NB+M4Z0EADnfPWoBmB3emonYYlGlYC34kYb6nqcn6sUm9usU9JUMeZBT1yOstUMd
 3p5V+uvUFQ9MGqXUgN8Qd5/ZfszCZzX2TaHDnWWRF4g7KTdSpcXOXrLW4gEO3TFf
 BtUU0WvZLiwXjMPrtvdTIPJCFTStfLcIAtWEyUhdCLouR2nJsAIYyfMm5OOyktqK
 KGeRaJhBp8c2bJTU1Xxj4FkO07z0iSY2EGDFCuEe4sBCN5EMA/ClwN/35P7Fwv30
 0sRjzwS/gRkT1IiLRjqu8We3dVUxclkgsXhZ/5UuOzRqTzV7VH0xYdgn6iCOs0nz
 RSLFo37DqjIYbAJGcv9E6/7TSy+lB1RVHQL1DsQVKOMTf4NW5REfSoMzbjPClj8u
 qYTVoONCXLQEzo8oxuIly9m6eeExA3+2ulvDq00FuDb+pCVZ1ig=
 =+h6p
 -----END PGP SIGNATURE-----

Merge tag 'for-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply

Pull power supply and reset updates from Sebastian Reichel:
 "Power-supply core:
   - new charging_orange_full_green RGB LED trigger
   - simplify and cleanup power-supply LED trigger code
   - expose power information via hwmon compatibility layer

  New hardware support:
   - enable battery support for Qualcomm Snapdragon X Elite
   - new battery driver for Maxim MAX17201/MAX17205
   - new battery driver for Lenovo Yoga C630 laptop (custom EC)

  Cleanups:
   - cleanup 'struct i2c_device_id' initializations
   - misc small battery driver cleanups and fixes"

* tag 'for-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply:
  power: supply: sysfs: use power_supply_property_is_writeable()
  power: supply: qcom_battmgr: Enable battery support on x1e80100
  power: supply: add support for MAX1720x standalone fuel gauge
  dt-bindings: power: supply: add support for MAX17201/MAX17205 fuel gauge
  power: reset: piix4: add missing MODULE_DESCRIPTION() macro
  power: supply: samsung-sdi-battery: Constify struct power_supply_maintenance_charge_table
  power: supply: samsung-sdi-battery: Constify struct power_supply_vbat_ri_table
  power: supply: lenovo_yoga_c630_battery: add Lenovo C630 driver
  power: supply: ingenic: Fix some error handling paths in ingenic_battery_get_property()
  power: supply: ab8500: Clean some error messages
  power: supply: ab8500: Use iio_read_channel_processed_scale()
  power: supply: ab8500: Fix error handling when calling iio_read_channel_processed()
  power: supply: hwmon: Add support for power sensors
  power: supply: ab8500: remove unused struct 'inst_curr_result_list'
  power: supply: bd99954: remove unused struct 'battery_data'
  power: supply: leds: Add activate() callback to triggers
  power: supply: leds: Share trig pointer for online and charging_full
  power: supply: leds: Add power_supply_[un]register_led_trigger()
  power: supply: Drop explicit initialization of struct i2c_device_id::driver_data to 0
2024-07-23 09:38:27 -07:00
Linus Torvalds
c5d2be6670 HSI changes for the 6.11 series
* drop unused gpio.h header from SSI McSAAB protocol driver
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmadj9oACgkQ2O7X88g7
 +pq3xg/8CIGEukHo0Su5pKUFewaZCJrz4LO+kHiF1aN2tkTMB3jC0nuYVvcpInYw
 3CBKCUGL4QO3UWopEijHbIey2wi3/qcHgBvOohM7AtFqLBI7u4bK5fdhbphISGIi
 XqODEdJH7N+BeQnyze8eGFVMGWGN9GGmY3FA8CrVukVnot01jcV3swIEVVaJnNZ3
 kIP/i+YtcqJCq4tvberYo0wO5fdyOVUGhtb5ZqcaTeiBMulelZREdB7ajGBYdGjN
 zXg18UlYdt4+7EYYUOti2lJBAiL7c90UAxSwOJ/v6SGPTegr462WS2h7v9wlAymm
 U11HSzIxxEHSXsmOrZUcPG9FZ6AVa8+9uO68pCuiClhibR+JB0NytSa+liPnObmw
 2zKu7YQooSBrPtK+gSSlhLv4LCheldv2yxXZAgp3U9++T+gh1PfzE3tRZVepdQQT
 EgJnYmkDa26CIOLOFwfxqA6AIACSOf5p0xfsdViDnVHvaliC5CCaVSBAzDPSKyaB
 y93iQMTCP60OtCFcxQeSKy1zSqELIXdpgjBR2tcmwIZJE/BYCaOaNfELWV6wkRda
 YKEJXiVxqXPDtAZChXXfUleERte/NRaKDGOsv6Iq7A5qxXmL3lf2hm6PcD2E4GUN
 FN6DIR8nEx0jnpGpsD0XKfIoAOXZ3N6XZpgpc34aJTZrfYliSmI=
 =tEqg
 -----END PGP SIGNATURE-----

Merge tag 'hsi-for-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi

Pull HSI update from Sebastian Reichel:

 - drop unused gpio.h header from SSI McSAAB protocol driver

* tag 'hsi-for-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi:
  HSI: ssi_protocol: Remove unused linux/gpio.h
2024-07-23 09:37:33 -07:00
Ivan Davydov
13c239a2c0 kbuild: doc: gcc to CC change
In this part of the documentation, $(CC) is meant, but gcc is written.

Signed-off-by: Ivan Davydov <davydoff33@yandex.ru>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2024-07-24 01:18:25 +09:00
Chen Ni
86c5eac3c4 iommu/amd: Convert comma to semicolon
Replace a comma between expression statements by a semicolon.

Fixes: c9b258c6be ("iommu/amd: Prepare for generic IO page table framework")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Link: https://lore.kernel.org/r/20240716072545.968690-1-nichen@iscas.ac.cn
Signed-off-by: Will Deacon <will@kernel.org>
2024-07-23 17:10:07 +01:00
Artem Chernyshev
630482ee06 iommu: sprd: Avoid NULL deref in sprd_iommu_hw_en
In sprd_iommu_cleanup() before calling function sprd_iommu_hw_en()
dom->sdev is equal to NULL, which leads to null dereference.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 9afea57384 ("iommu/sprd: Release dma buffer to avoid memory leak")
Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Reviewed-by: Chunyan Zhang <zhang.lyra@gmail.com>
Link: https://lore.kernel.org/r/20240716125522.3690358-1-artem.chernyshev@red-soft.ru
Signed-off-by: Will Deacon <will@kernel.org>
2024-07-23 17:09:28 +01:00
Petr Mladek
ea5377ec49 Merge branch 'for-6.11/sysfs-patch-replace' into for-linus 2024-07-23 17:13:10 +02:00
Raghavendra Rao Ananta
f3dfcd2545 arm64/sysreg: Correct the values for GICv4.1
Currently, sysreg has value as 0b0010 for the presence of GICv4.1 in
ID_PFR1_EL1 and ID_AA64PFR0_EL1, instead of 0b0011 as per ARM ARM.
Hence, correct them to reflect ARM ARM.

Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240718215532.616447-1-rananta@google.com
Signed-off-by: Will Deacon <will@kernel.org>
2024-07-23 15:29:20 +01:00
Fangrui Song
48f6430505 arm64/vdso: Remove --hash-style=sysv
glibc added support for .gnu.hash in 2006 and .hash has been obsoleted
for more than one decade in many Linux distributions.  Using
--hash-style=sysv might imply unaddressed issues and confuse readers.

Just drop the option and rely on the linker default, which is likely
"both", or "gnu" when the distribution really wants to eliminate sysv
hash overhead.

Similar to commit 6b7e26547f ("x86/vdso: Emit a GNU hash").

Signed-off-by: Fangrui Song <maskray@google.com>
Link: https://lore.kernel.org/r/20240718173423.1574395-1-maskray@google.com
Signed-off-by: Will Deacon <will@kernel.org>
2024-07-23 15:28:23 +01:00
Remington Brasga
0c35e3bd41 kselftest: missing arg in ptrace.c
The string passed to ksft_test_result_skip is missing the `type_name`

Signed-off-by: Remington Brasga <rbrasga@uci.edu>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/20240712231730.2794-1-rbrasga@uci.edu
Signed-off-by: Will Deacon <will@kernel.org>
2024-07-23 15:27:16 +01:00
Anshuman Khandual
add6128fc7 arm64/Kconfig: Remove redundant 'if HAVE_FUNCTION_GRAPH_TRACER'
Since the commit 819e50e25d ("arm64: Add ftrace support"),
HAVE_FUNCTION_GRAPH_TRACER has always been enabled. Although a subsequent
commit 3646970322 ("arm64: ftrace: Enable HAVE_FUNCTION_GRAPH_RETVAL")
redundantly added check on HAVE_FUNCTION_GRAPH_TRACER, while enabling the
config HAVE_FUNCTION_GRAPH_RETVAL. Let's just drop this redundant check.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
CC: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20240716050915.2657694-1-anshuman.khandual@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2024-07-23 15:24:02 +01:00
Masahiro Yamada
62e2397c22 arm64: remove redundant 'if HAVE_ARCH_KASAN' in Kconfig
Since commit 0383808e4d ("arm64: kasan: Reduce minimum shadow
alignment and enable 5 level paging"), HAVE_ARCH_KASAN is always 'y'.

The condition 'if HAVE_ARCH_KASAN' is always met.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/20240715192843.2201439-1-masahiroy@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
2024-07-23 15:23:26 +01:00
Janosch Frank
6dc2e98d5f s390: Remove protvirt and kvm config guards for uv code
Removing the CONFIG_PROTECTED_VIRTUALIZATION_GUEST ifdefs and config
option as well as CONFIG_KVM ifdefs in uv files.

Having this configurable has been more of a pain than a help.
It's time to remove the ifdefs and the config option.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:33 +02:00
Sven Schnelle
8f1e70adb1 s390/boot: Add cmdline option to relocate lowcore
Now that everything has been converted, add the option
'relocate_lowcore' to enable relocating the lowcore.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Sven Schnelle
97cee3dd4a s390/kdump: Make kdump ready for lowcore relocation
In preparation of having lowcore at different address than zero,
add the base register to all lowcore accesses in store_status()
and __do_machine_kdump().

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Sven Schnelle
361f6ec2fe s390/entry: Make system_call() ready for lowcore relocation
In preparation of having lowcore at different address than zero,
add the base register to all lowcore accesses in system_call().

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Sven Schnelle
9b3dcae128 s390/entry: Make ret_from_fork() ready for lowcore relocation
In preparation of having lowcore at different address than zero,
add the base register to all lowcore accesses in ret_from_fork().

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Sven Schnelle
7cc86dee44 s390/entry: Make __switch_to() ready for lowcore relocation
In preparation of having lowcore at different address than zero,
add the base register to all lowcore accesses in __switch_to().

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Sven Schnelle
4064b71112 s390/entry: Make restart_int_handler() ready for lowcore relocation
In preparation of having lowcore at different address than zero,
add the base register to all lowcore accesses in restart_int_handler().

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Sven Schnelle
0001b7bbc5 s390/entry: Make mchk_int_handler() ready for lowcore relocation
In preparation of having lowcore at different address than zero,
add the base register to all lowcore accesses in mcck_int_handler().

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Sven Schnelle
bd2c55b307 s390/entry: Make int handlers ready for lowcore relocation
In preparation of having lowcore at different address than zero,
add the base register to all lowcore accesses in the ext/io interrupt
handlers.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Sven Schnelle
9e1e275fa2 s390/entry: Make pgm_check_handler() ready for lowcore relocation
In preparation of having lowcore at different address than zero,
add the base register to all lowcore accesses in pgm_check_handler().

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Sven Schnelle
86e08d64ee s390/entry: Add base register to CHECK_VMAP_STACK/CHECK_STACK macro
In preparation of having lowcore at different address than zero,
add the base register to CHECK_VMAP_STACK and CHECK_STACK. No
functional change, because %r0 is passed to the macro.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Sven Schnelle
6908f8f916 s390/entry: Add base register to SIEEXIT macro
In preparation of having lowcore at different address than zero,
add the base register to SIEEXIT. No functional change, because
%r0 is passed to the macro.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Sven Schnelle
ca2f0a26c4 s390/entry: Add base register to MBEAR macro
In preparation of having lowcore at different address than zero,
add the base register to MBEAR. No functional change, because
%r0 is passed to the macro.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Sven Schnelle
12184a4676 s390/entry: Make __sie64a() ready for lowcore relocation
In preparation of having lowcore at different address than zero,
add the base register to all lowcore accesses in __sie64a().

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Sven Schnelle
39e8c5d6a4 s390/head64: Make startup code ready for lowcore relocation
In preparation of having lowcore at different address than zero,
add the base register to all lowcore accesses in startup_continue().

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Sven Schnelle
5ade5be4ed s390: Add infrastructure to patch lowcore accesses
The s390 architecture defines two special per-CPU data pages
called the "prefix area". In s390-linux terminology this is usually
called "lowcore". This memory area contains system configuration
data like old/new PSW's for system call/interrupt/machine check
handlers and lots of other data. It is normally mapped to logical
address 0. This area can only be accessed when in supervisor mode.

This means that kernel code can dereference NULL pointers, because
accesses to address 0 are allowed. Parts of lowcore can be write
protected, but read accesses and write accesses outside of the write
protected areas are not caught.

To remove this limitation for debugging and testing, remap lowcore to
another address and define a function get_lowcore() which simply
returns the address where lowcore is mapped at. This would normally
introduce a pointer dereference (=memory read). As lowcore is used
for several very often used variables, add code to patch this function
during runtime, so we avoid the memory reads.

For C code get_lowcore() has to be used, for assembly code it is
the GET_LC macro. When using this macro/function a reference is added
to alternative patching. All these locations will be patched to the
actual lowcore location when the kernel is booted or a module is loaded.

To make debugging/bisecting problems easier, this patch adds all the
infrastructure but the lowcore address is still hardwired to 0. This
way the code can be converted on a per function basis, and the
functionality is enabled in a patch after all the functions have
been converted.

Note that this requires at least z16 because the old lpsw instruction
only allowed a 12 bit displacement. z16 introduced lpswey which allows
20 bits (signed), so the lowcore can effectively be mapped from
address 0 - 0x7e000. To use 0x7e000 as address, a 6 byte lgfi
instruction would have to be used in the alternative. To save two
bytes, llilh can be used, but this only allows to set bits 16-31 of
the address. In order to use the llilh instruction, use 0x70000 as
alternative lowcore address. This is still large enough to catch
NULL pointer dereferences into large arrays.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:32 +02:00
Heiko Carstens
13be21f39a s390/atomic_ops: Disable flag outputs constraint for GCC versions below 14.2.0
GCC may die with an ICE if the flag outputs constraint is used in
combination with other inline assemblies. This will be fixed with
GCC 14.2.0.

Therefore disable the use of the constraint for now.

Link: https://gcc.gnu.org/git?p=gcc.git;a=commit;h=cd11413ff7c4353a3e336db415304f788d23a393
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Heiko Carstens
fc8eac33ad s390/entry: Move SIE indicator flag to thread info
CIF_SIE indicates if a thread is running in SIE context. This is the
state of a thread and not the CPU. Therefore move this indicator to
thread info.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Heiko Carstens
213400c4af s390/nmi: Simplify ptregs setup
The low level machine check handler code fills the ptregs structure
partially with the register contents present at machine check handler
entry and partially with contents from the machine check save area.

In case of a machine check the contents of all general purpose
registers are saved by the CPU to the machine check save area.
Therefore simplify the code and fill the ptregs structure by only
using the machine check save area as source.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Heiko Carstens
beb8cee06f s390/alternatives: Remove alternative facility list
The alternative and the normal facility list are always identical. Remove
the alternative facility list, which allows to simplify the alternatives
code.

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Tested-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Heiko Carstens
47837a5c74 s390/nospec: Push down alternative handling
The nospec implementation is deeply integrated into the alternatives
code: only for nospec an alternative facility list is implemented and
used by the alternative code, while it is modified by nospec specific
needs.

Push down the nospec alternative handling into the nospec by
introducing a new alternative type and a specific nospec callback to
decide if alternatives should be applied.

Also introduce a new global nobp variable which together with facility
82 can be used to decide if nobp is enabled or not.

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Tested-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Sven Schnelle
7f9d85998f s390/alternatives: Allow early alternative patching in decompressor
Add the required code to patch alternatives early in the decompressor.
This is required for the upcoming lowcore relocation changes, where
alternatives for facility 193 need to get patched before lowcore
alternatives.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Co-developed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Heiko Carstens
b3e0c5f734 s390/alternatives: Rework to allow for callbacks
Rework alternatives to allow for callbacks. With this every
alternative entry has additional data encoded:

- When (aka context) an alternative is supposed to be applied

- The type of an alternative, which allows for type specific handling
  and callbacks

- Extra type specific payload (patch information), which can be passed
  to callbacks in order to decide if an alternative should be applied
  or not

With this only the "late" context is implemented, which means there is
no change to the previous behaviour. All code is just converted to the
more generic new infrastructure.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Tested-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Heiko Carstens
030f7951c5 s390/uaccess: Make s390_kernel_write() usable for decompressor
To avoid lots of ifdefs in C code make s390_kernel_write() usable for
the decompressor: simply use memcpy() for this case since there is no
write protection enabled that early.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Tested-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Heiko Carstens
ace76fac94 s390/alternatives: Move text sync functions
Move all text sync functions from alternative.c to processor.c. This
way there is only minimal code left in alternative.c left, which is a
prerequisite to use the C file within boot code as well.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Tested-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Heiko Carstens
c77f7354c4 s390/alternatives: Merge both alternative header files
The two alternative header files must stay in sync. This is easier to
achieve within one header file. Therefore merge both of them and have
only one file, like most other architectures.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Tested-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Heiko Carstens
9be999a612 s390/alternatives: Use consistent naming
The alternative code is using the words facility and feature for the
same. Rename facility to more generic feature everywhere to have
consistent naming.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Tested-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Sven Schnelle
035248a784 s390/alternatives: Remove noaltinstr option
The current Kernel doesn't boot without alternative patching on
z16 machines. To avoid such bugs in the future, remove the option
disable alternative patching.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Sven Schnelle
d3604ffba1 s390: Move CIF flags to struct pcpu
To allow testing flags for offline CPUs, move the CIF flags
to struct pcpu. To avoid having to calculate the array index
for each access, add a pointer to the pcpu member for the current
cpu to lowcore.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Sven Schnelle
90fc5ac282 s390/smp: Switch pcpu_devices to percpu
In preparation of moving the CIF flags from lowcore to pcpu_devices,
convert the pcpu_devices array to use the percpu infrastructure.
This is required because using the pcpu_devices array as it is would
introduce a performance penalty due to the fact that CPU flags for
multiple CPUs would end up in the same cacheline.

Note that a pointer to the pcpu struct of the IPL CPU is still required.
This is because a restart interrupt can be triggered on an offline CPU.
s390 stores the percpu offset in lowcore, but offline CPUs have no
lowcore area allocated. So percpu data cannot be used from an offline
CPU and we need to get the pcpu pointer for the IPL cpu from somewhere
else.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Sven Schnelle
a795eeaf85 s390/smp: Handle restart interrupt on ipl cpu
The current smp code allows to trigger a restart interrupt on CPUs
offline in linux. To allow using the percpu infrastructure instead
of the pcpu_devices array, switch to the ipl cpu which is always
online before calling do_restart().

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:31 +02:00
Alexander Gordeev
b798b685b4 s390/boot: Do not assume the decompressor range is reserved
When allocating a random memory range for .amode31 sections
the minimal randomization address is 0. That does not lead
to a possible overlap with the decompressor image (which also
starts from 0) since by that time the image range is already
reserved.

Do not assume the decompressor range is reserved and always
provide the minimal randomization address for .amode31
sections beyond the decompressor. That is a prerequisite
for moving the lowcore memory address from NULL elsewhere.

Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:30 +02:00
Thomas Richter
e6ce1f12d7 s390/cpum_cf: Fix endless loop in CF_DIAG event stop
Event CF_DIAG reads out complete counter sets using stcctm
instruction. This is done at event start time when the process
starts execution and at event stop time when the process is
removed from the CPU. During removal the difference of each
counter in the counter sets is calculated and saved as raw data
in the ring buffer. This works fine unless the number of counters
in a counter set is zero. This may happen for the extended counter
set. This set is machine specific and the size of the counter
set can be zero even when extended counter set is authorized for
read access.

This case is not handled. cfdiag_diffctr() checks authorization
of the extended counter set. If true the functions assumes
the extended counter set has been saved in a data buffer. However
this is not the case, cfdiag_getctrset() does not save a counter
set with counter set size of zero. This mismatch causes an endless
loop in the counter set readout during event stop handling.

The calculation of the difference of the counters in each counter
now verifies the size of the counter set is non-zero. A counter set
with size zero is skipped.

Fixes: a029a4eab3 ("s390/cpumf: Allow concurrent access for CPU Measurement Counter Facility")
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:02:30 +02:00
Ilya Leoshkevich
19af288706 s390/ptdump: Add KMSAN page markers
Add KMSAN vmalloc metadata areas to
/sys/kernel/debug/kernel_page_tables. Example output:

    0x000003a95fff9000-0x000003a960000000        28K PTE I
    ---[ vmalloc Area End ]---
    ---[ Kmsan vmalloc Shadow Start ]---
    0x000003a960000000-0x000003a960010000        64K PTE RW NX
    [...]
    0x000003d3dfff9000-0x000003d3e0000000        28K PTE I
    ---[ Kmsan vmalloc Shadow End ]---
    ---[ Kmsan vmalloc Origins Start ]---
    0x000003d3e0000000-0x000003d3e0010000        64K PTE RW NX
    [...]
    0x000003fe5fff9000-0x000003fe60000000        28K PTE I
    ---[ Kmsan vmalloc Origins End ]---
    ---[ Kmsan Modules Shadow Start ]---
    0x000003fe60000000-0x000003fe60001000         4K PTE RW NX
    [...]
    0x000003fe60100000-0x000003fee0000000      2047M PMD I
    ---[ Kmsan Modules Shadow End ]---
    ---[ Kmsan Modules Origins Start ]---
    0x000003fee0000000-0x000003fee0001000         4K PTE RW NX
    [...]
    0x000003fee0100000-0x000003ff60000000      2047M PMD I
    ---[ Kmsan Modules Origins End ]---
    ---[ Modules Area Start ]---
    0x000003ff60000000-0x000003ff60001000         4K PTE RO X

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/20240723124441.120044-3-iii@linux.ibm.com
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:01:51 +02:00
Ilya Leoshkevich
ec25f99cc8 s390/kmsan: Fix merge conflict with get_lowcore() introduction
Resolve the conflict between commit 2a48c8c9cf ("s390/kmsan:
implement the architecture-specific functions") and commit 39976f1278
("s390: Remove S390_lowcore").

Fixes: 2a48c8c9cf ("s390/kmsan: implement the architecture-specific functions")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/20240723124441.120044-2-iii@linux.ibm.com
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 16:01:51 +02:00
Vasily Gorbik
e188e5d5ff s390/setup: Fix __pa/__va for modules under non-GPL licenses
The struct vm_layout contains fields used in __pa/__va calculations. Such
fundamental things have to be exported with EXPORT_SYMBOL to avoid
breakages of out-of-tree modules under non-GPL licenses.

Fixes: 7de0446f0b ("s390/boot: Make identity mapping base address explicit")
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-23 15:54:58 +02:00