Commit Graph

386 Commits

Author SHA1 Message Date
Linus Torvalds
70cb95c736 soc: drivers for 7.2
There are a few added drivers, but mostly the normal maintenance to drivers
 for firmware, memory controller and other soc specific hadware:
 
  - The NXP QuickEngine gets modern MSI support, which allows some cleanups to
    the GICv3 irqchip chip driver
 
  - A new SoC specific driver for the Renesas R-Car MFIS unit is added,
    encapsulating support for the on-chip mailbox and hwspinlock
    implementations that are not easily separated into individual
    drivers
 
  - The Qualcomm SoC drivers add support for additional SoC implementations,
    and flexiblity around power managedment for the serial-engine driver
    as well as probing the LLCC driver using custom hardware descriptions
    inside of the device itself.
 
  - Added support for the Samsung thermal management unit
 
  - A cleanup to the Tegra 'PMC' driver interfaces to remove legacy
    APIs and allow multiple PMC instances everywhere.
 
  - Updates to the TI SCI and KNAS drivers to improve suspend/resume
    support.
 
  - Minor driver changes for mediatek, xilinx, allwinner, aspeed, tegra,
    broadcom, amd, microchip and starfive specific drivers
 
  - Memory controller updates for Tegra and Renesas for additional SoC
    types and other improvements.
 
  - Firmware driver updates for Arm FF-A, SMCCC and SCMI interfaces,
    to update driver probing, object lifetimes and address minor bugs.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmow8HMACgkQmmx57+YA
 GNmV4A//WYorQo+qes020w70BAc67/CCVsYpDLDz0mWD5G/uQoQkmyqJTA/b2VnM
 iBzrxJ5lGRP7xkhfDVCfb3wsMNsJV9X4QRLGB13XkXA/vRMZxBd3xKV0K/CWUJYo
 0YJV/BeFDonhbIjTyeZ0ddUvkdOtqn7tua+YiVpRLL4lqV0JzwzQ1mrqKuJ1EFk0
 LWw/oLf+xhcY9X6lae0kranLcR6wauGVu9FLXu2nMtGnn1ErkUfywmd8C1mZ8yLk
 QCEjSNdvjXQKSAFhNhAcNPxEDFqvNqKQEXfa62i3m8rM8mX1/ZJUd49NCEQaOnXm
 ZbeZVHLATf8ut6WKvAwOdtcmvY2HAvBy9xyU7mdiYw3+3hDHQWU068bqYcEbfY6O
 04vhYjnvYnYCZNifH3MvsdMteILN5Eja+dNq7Li2LbnMqbSUHr4gJm0nQcbvsbs0
 x42GsuqtmPy1PL4/9hlwN/eDj+Bce4O2x1ZXl8VoChGRUD1JJXzr4NGDumBv03hA
 eqja4VdMWb9Z/w7y6nlXkx48DibpBJJCgotbYl6DSfJjfGX+jnYrHHcZg5BCIvUc
 X1Fy6236sWBQsj1crNcm2QZ2JWJE28HRYcDq3JGDDGvWkcrkB4c1H0N/rIkO4H5F
 nTW5LgJDTd/KEzq3WOKN+gcHoLjXWl0wKJpb4WQ7sdvcYUTdHx8=
 =27+M
 -----END PGP SIGNATURE-----

Merge tag 'soc-drivers-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull SoC driver updates from Arnd Bergmann:
 "There are a few added drivers, but mostly the normal maintenance to
  drivers for firmware, memory controller and other soc specific
  hardware:

   - The NXP QuickEngine gets modern MSI support, which allows some
     cleanups to the GICv3 irqchip chip driver

   - A new SoC specific driver for the Renesas R-Car MFIS unit is added,
     encapsulating support for the on-chip mailbox and hwspinlock
     implementations that are not easily separated into individual
     drivers

   - The Qualcomm SoC drivers add support for additional SoC
     implementations, and flexibility around power management for the
     serial-engine driver as well as probing the LLCC driver using
     custom hardware descriptions inside of the device itself.

   - Added support for the Samsung thermal management unit

   - A cleanup to the Tegra 'PMC' driver interfaces to remove legacy
     APIs and allow multiple PMC instances everywhere.

   - Updates to the TI SCI and KNAS drivers to improve suspend/resume
     support.

   - Minor driver changes for mediatek, xilinx, allwinner, aspeed,
     tegra, broadcom, amd, microchip and starfive specific drivers

   - Memory controller updates for Tegra and Renesas for additional SoC
     types and other improvements.

   - Firmware driver updates for Arm FF-A, SMCCC and SCMI interfaces, to
     update driver probing, object lifetimes and address minor bugs"

* tag 'soc-drivers-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (189 commits)
  Revert "firmware: zynqmp: Add dynamic CSU register discovery and sysfs interface"
  Revert "Documentation: ABI: add sysfs interface for ZynqMP CSU registers"
  memory: tegra234: drop dead NULL check in tegra234_mc_icc_aggregate()
  memory: tegra264: drop redundant tegra264_mc_icc_aggregate()
  memory: tegra186-emc: stop borrowing MC aggregate hook for EMC
  soc: aspeed: cleanup dead default for ASPEED_SOCINFO
  firmware: tegra: bpmp: Add support for multi-socket platforms
  firmware: tegra: bpmp: Propagate debugfs errors
  soc/tegra: pmc: Add Tegra238 support
  soc/tegra: pmc: Restrict power-off handler to Nexus 7
  soc/tegra: pmc: Populate powergate debugfs only when needed
  soc/tegra: pmc: Move legacy code behind CONFIG_ARM guard
  soc/tegra: pmc: Remove unused legacy functions
  soc/tegra: pmc: Create PMC context dynamically
  firmware: samsung: acpm: remove compile-testing stubs
  firmware: samsung: acpm: Add devm_acpm_get_by_phandle helper
  firmware: samsung: acpm: Add TMU protocol support
  firmware: samsung: acpm: Make acpm_ops const and access via pointer
  firmware: samsung: acpm: Drop redundant _ops suffix in acpm_ops members
  firmware: samsung: acpm: Annotate rx_data->cmd with __counted_by_ptr
  ...
2026-06-17 11:21:40 -07:00
Arnd Bergmann
1f512d1f74 OP-TEE updates for 7.2
- Fix kernel-doc warnings in optee_private.h and optee_msg.h
 - Allow MT_NORMAL_TAGGED shared memory to support ARM64 MTE buffers
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEE0qerISgy2SKkqO79Wr/6JGat8H4FAmoZYygaHGplbnMud2lr
 bGFuZGVyQGxpbmFyby5vcmcACgkQWr/6JGat8H53ew//TRKAo3lNtl0qpGNg/WKQ
 Js1g9Yr4CrvgH2LbjLTUxARkYjAofy82XuYrQUXX39HeWZLyrebe1o+NTdFo3fhs
 Z7fw8K+krwFe5+xI450E6jVwUnDEhzhroLC2SqC7GeaeIWCQfZxJU5TgTVqeGa2q
 SBG7pJG9w89ICvdMZtepuz5AHBmoX02lCywPYV/5yeOQ8+mitBvGdLFXtR0sGPo3
 AfQ2SsnrzhB+MVj28jjY1/lB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1BrgjZI/oIN+XjomkM5OYT8BT5XF4H9H0DyW
 s1EN5HynPwbANUyWuo6d08C8ZNVzvI9dykoG4ZMS/KXgc2QTqa78vzWsV5U5Gd4Y
 wNKXww4bBIKDvn7aCJrpHzrwOot0hbkjUS88W1YBL9sm2fflSUHJ1UhnhUkNsuSU
 6rR/FX2BsF9ClNvDfEvtilrQZiheivgJhX7nuB6iPZZ/63yFFkg=
 =EMFT
 -----END PGP SIGNATURE-----

Merge tag 'optee-for-v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into soc/drivers

OP-TEE updates for 7.2

- Fix kernel-doc warnings in optee_private.h and optee_msg.h
- Allow MT_NORMAL_TAGGED shared memory to support ARM64 MTE buffers

* tag 'optee-for-v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
  tee: optee: fix kernel-doc warnings
  tee: optee: Allow MT_NORMAL_TAGGED shared memory

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2026-05-30 00:25:12 +02:00
Arnd Bergmann
1e09b55daf AMD-TEE update for 7.2
Store buffer ID in tee_shm->sec_world_id and remove internal tracking
 structures to align with other TEE drivers
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEE0qerISgy2SKkqO79Wr/6JGat8H4FAmoZY4waHGplbnMud2lr
 bGFuZGVyQGxpbmFyby5vcmcACgkQWr/6JGat8H42Cg//fPRFZ8igbCvGZMmfkUrc
 jLJfplUW3sLPONEC5/j3mzgrtK5bCkGqh2PYCfbtVYfW67fuGzA2BJXDSrPtIaiH
 tkwXL1vzTGZHHGfUpV8fHEsQM75jSyeXumptY/aIr9FkaLsaOIxz+YRbyzMAuOYn
 aP3wPy3ORCgbhd51mJ+aQvbu0xC7C/JJuWGfv+UmdVFaGLUYIzLp8pzJ3LESnHQq
 R8lqDUfLxu2NXmGRSZkxNQYRx9yxosmxraVSEpQYjlihz0urwQrXI55NFiHT2VRx
 mks6k/ykCKHDCszYnbWIrDtuhQ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OMtKy84MMbuUGYXVY4ExMz3jTw9XztJ07s
 rwdY2LNVPan2bqZXkhJjBW++LMpAC/JQfsSnOtv2KPAE2X7wHi4UM61WWgv0IOxc
 yu6v7asMca4Ie15IV0u7684xiaRNH9OzP2hYY43vrS4QpmhTwoE=
 =pc2V
 -----END PGP SIGNATURE-----

Merge tag 'amdtee-for-v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into soc/drivers

AMD-TEE update for 7.2

Store buffer ID in tee_shm->sec_world_id and remove internal tracking
structures to align with other TEE drivers

* tag 'amdtee-for-v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
  tee: amdtee: store buffer ID in tee_shm->sec_world_id

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2026-05-30 00:23:15 +02:00
Arnd Bergmann
c6066e3295 QCOMTEE fix for v7.1
Adding a missing va_end in early return qcomtee_object_user_init()
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEE0qerISgy2SKkqO79Wr/6JGat8H4FAmoPEU4aHGplbnMud2lr
 bGFuZGVyQGxpbmFyby5vcmcACgkQWr/6JGat8H6ZURAAjCri3rT6c+r96CdEDJoY
 /3KobFqqfWIg8F4owuzS2mctyAcyM8mtRDmXK1bNNYhfPV4xecydZ2VRpD0BGjHD
 SDze0lnj2hY4UOnumUlWcSkdthmM9ejdQlcWupT66E5kGZpRyTH2w9p5Od69Pt3s
 5/z39jlRPu1+HIK1+1Sxh4kUdTnJvG4uUFQppnIkDLxh0leHoe1B98P6FLcpIFOq
 j+KFL1l5SiIJ2yvGu4qQoX3MB1QY8vpHTSQjik5kretAMwAZRYWH3pbKi8H8ekG+
 xmm64YBa7dRGMPohicllKrvtYUbzZMJ2I33QG16RmgeTy3J3rVOeN4WDXbDLlZrO
 BkJ7pH2dQzTuEWkRVCM8uWtCRUjZB9asCvP+nl5rHO3TsW2rZ63IOdeR+1gDoxqb
 Wsx20S0vDJUEN+1ZMYwSlW9x7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GbH+IERysh2gnav71srI=
 =aUkT
 -----END PGP SIGNATURE-----

Merge tag 'qcomtee-fix-for-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into arm/fixes

QCOMTEE fix for v7.1

Adding a missing va_end in early return qcomtee_object_user_init()

* tag 'qcomtee-fix-for-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
  tee: qcomtee: add missing va_end in early return qcomtee_object_user_init()

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2026-05-28 15:31:48 +02:00
Arnd Bergmann
56d5829720 OP-TEE fix for v7.1
Prevent possible use after free in supplicant communication.
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEE0qerISgy2SKkqO79Wr/6JGat8H4FAmoPEQQaHGplbnMud2lr
 bGFuZGVyQGxpbmFyby5vcmcACgkQWr/6JGat8H6i7g/+IKeDvegjBiud2okBgEq3
 5yMYhmHP/ycgnAaQkpqvtZP41I4ar0LAbresNWEvmuAR71rirWSCDKRHbm0xv8Ww
 UJ1xyDxnIdNQe8sBBqrYe4QBq80l9gKpX5Tmi8eQkFGfDX+DWet0fdYBW/pKoSaI
 M/ciBORdbwYFPPb7hGBpuZ/tUuFNlRo4tcW14mM9v64m5pOe94RR92Dshf8fCwWk
 +4HmMBldBCUHz1j4hjzwEunq3aMVFHobUozssk3A0eLIpEPla0OqeO4vT1UpskfL
 nXiJCvioKH/X6/xKzhuumPN7Bvkq1eMZAQy+4N4wNJShzJJtqokAjDBUjc42576l
 7xKoNNa+mSNfrpu9RABC0hdpcTRxIbcgE70tViyeUIPOfhryAAlhaUe/iN1O4HYf
 dfwqWVGwosGUbXb8vZUvggR1GmLSLrN5H/PhXg7hb6RDveDD2eSgHWsh/+CGDrYq
 quWOamOeodblIrjOnRKsBVLuBLXJ3muIsED9HrCfChlS/EMGQYSWqr7KP+MIBQuQ
 Q9TzrBZ0j7m2MOwEzmLssa5nmbIxB7bnVOO/46xqQv4ktRC335/IYVpsQrD0AJ2B
 XM4raWikXLNIxNAwkzzDzP2Tu67zKxNtiPi1z4S0UeMY90NSJZ5Z4E7AEe8iSL1P
 Z3oXjhxDyv7aJFzYnxBApgI=
 =aOSI
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmoYQvUACgkQmmx57+YA
 GNkRcxAAjiVXyEFwLErRTJlQ9Tq00axugkt0YJW5LxDixuqXjfmPp6TpsATm1Np7
 Xx2eplkEhMZiIgP0nDQkT/31kFlLUd3nOQiJv9Cz8ZwwZulCWMlMeTPZ773MwlmO
 rIuo+cBaQhkYp3e3mglWLuAXR4MtW4GQzZ42jRXYvOz+3HrG3Zb8C/CfOQfMlFU0
 17M+HMBq6FAGjJEhH1sZEb19WEE87ZiH2aee1+HQ+FgzfDtW0QD+9bhlxpIsFkak
 NRKoD58ixobSy1SuMSPQ4liK76VEdP6UQDZ2R4IyhO6/QM1ZE5JRpAf9RWAy4Mqi
 4gcHrBXdME2hJUrXLtV6PdQMXPq9+/yphs+JWXwRfns+uL9ltDYwxk14Tc+hshGk
 jM0qcfPvF/s/6Med+oCnSGQn8CYYOblwi/qhpWLqyl6Rrpag1kkTqVXmOsJ0J71m
 J59fIEjqcYkv8y+46Pj3ZxNXVgXlhREpsp/gg/FAkJ5bNpKxWqdqPba4gy/rhZFh
 x2TOpfzMHMQS9MrfbLtlu4HshbwDqEyiThTgUc5c1njYwb3Mao//QxwmjLBQesWY
 sZSfl+26rF/fyPcaHne5nZ3JSKE0FGxnHot+jPDS6OURAhF8AwhKFjLnzIFnmWhy
 kqsrVQCrDySP1rzm23A9pFcpx7mlR4tZM4q4xRb4DujPHiIYK9w=
 =jbl0
 -----END PGP SIGNATURE-----

Merge tag 'optee-fix-for-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into arm/fixes

OP-TEE fix for v7.1

Prevent possible use after free in supplicant communication.

* tag 'optee-fix-for-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
  tee: optee: prevent use-after-free when the client exits before the supplicant

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2026-05-28 15:28:19 +02:00
Arnd Bergmann
9193ffe5b4 TEE fixes for v7.1
Fixing:
 - params_from_user() cleanup in error path in tee_ioctl_supp_recv()
 - possible tee_shm leak in error path in register_shm_helper()
 - padding in struct tee_ioctl_object_invoke_arg
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEE0qerISgy2SKkqO79Wr/6JGat8H4FAmoNXF4aHGplbnMud2lr
 bGFuZGVyQGxpbmFyby5vcmcACgkQWr/6JGat8H7G0xAA4+Rytz+NnQJk/qh+6crH
 so6W3QtQPOlPcXRbiUO/eYQLiuhxP3OHvy1v+FGk9/InRDIL2WEPaglKzeHw1k7Z
 dtHc3fte9+rMpXQi0VpWle+iIDmbcSZo6i0LEq4K6K0zR+uHLvDiye31SN7Xh9y+
 M2kmu3EYEuCnYcLScJASWXFh8zkBuE3ouxlRd237qy1ZaqirPSIBLfukES2/nKnd
 q16nSAb55oASCFE1tAJ/7p7ADIogYwY8zdIC9wPidcmCLC43cBpKcGMVukXY1TM/
 H8qjY+eNQXu5wZbs08DXAFZcqfoPykUKtN66gaKj+eHfEuu/y67Fs1RV/L1fY4ER
 82S69KGUY+uh9xBLV4WIAmF79VZLtFX9y55DyfzPIC7PLlu0/ov2+1pWcy5h/5Xl
 W2gQOTap0MnhTBPOzBN2kFArkC/lmgoufUGifIKGbxYw06ZaORUnIAUOorcItoq4
 Sl1Yl48hQ5Wr1J6N++sa75O7cvoNX3zgLSEfJkZv8IvebZH2U8coTJBdmr1lD7pI
 6W/QwQ4ZbNN2fhmQ1262coDddMEUFbDe60bKWDfnO9gCCvYtRSbWxX5j2ksclRw2
 gr6t9giURM9H2IYMEDA5UaXH7WRCmKU1Mu3SqdsklHCwoXA6ie3gg1xRn3gY1Bw+
 mGG1LrAIVXbVuDvoLEa2PE8=
 =iyqH
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmoYQSwACgkQmmx57+YA
 GNltaw/8CTK3hikzjTaIbJBDsXE46oNAn244rAYo8HXMM64sqrPHyEBIKPfdRpEp
 /jshVeNAfT6nA7qnt+PLPfB3w45L0Ugl29DmSIc2Drsb7Mzs0TCVfiW4tkBITbd5
 9/n7FKNnIMvtEpUhZRSvgGZiJ98dC16R5aTmnCgXNSild6VLpu3sCrResX15Mkj5
 SbKjOZmv7NziUEWAROrnznYZV+VIQiXLbYV5a66NxgSUptud55dcJWoyXXqTczzj
 +mA7RVPErcbNOCtBRzLmPVN0J9bIFQg8HGqacEhwQtslixkz2zcriNLQN/KjtXtF
 TDs3vy0LFb8TCYbe9P8QJHAuoKSVhCuifLy0v28Z7ozf5cIZ4nEPuvjomC8Mcr6e
 MjArB4Zb8QGk9MVAKg0Pt6a1tkA+5Ij1sxHJks4n3hGw0O1WJAH65VI2q53FoHPq
 7isFbT5DS21OuoxUSZF+i+VacDsD5HEOfQVuoD3LNhKyRAlhaLA2ytf37ZOQtTAQ
 RR8ccjyssZbCqXMvyjcOiIgNwAmRQ/KkDNzWLNTdCPp7lZ6OzNfWKG5ljx9QG4zV
 qzcE8GgUjZnyuy+C8yN15vGhvXW6WSYfSQBzN7lpJI0Crq9IoUTch2aKjxBiXlhD
 MpXD/8FVueRXtLRj7h8nmVGSFP82lR15EPfYImpSe8WXVIs7Tyw=
 =CNbC
 -----END PGP SIGNATURE-----

Merge tag 'tee-fixes-for-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into arm/fixes

TEE fixes for v7.1

Fixing:
- params_from_user() cleanup in error path in tee_ioctl_supp_recv()
- possible tee_shm leak in error path in register_shm_helper()
- padding in struct tee_ioctl_object_invoke_arg

* tag 'tee-fixes-for-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
  tee: fix params_from_user() error path in tee_ioctl_supp_recv
  tee: shm: fix shm leak in register_shm_helper()
  tee: fix tee_ioctl_object_invoke_arg padding

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2026-05-28 15:20:37 +02:00
Robertus Diawan Chris
471c18323d tee: qcomtee: add missing va_end in early return qcomtee_object_user_init()
qcomtee_object_user_init() is a variadic function and when the function
return because there's no dispatch callback in QCOMTEE_OBJECT_TYPE_CB
case, there's no va_end to cleanup "ap" object initialized by va_start
and that can cause undefined behavior. So make sure to use va_end before
returning the error code when there's no dispatch callback.

This is reported by Coverity Scan as "Missing varargs init or cleanup".

Fixes: d6e290837e ("tee: add Qualcomm TEE driver")
Signed-off-by: Robertus Diawan Chris <robertusdchris@gmail.com>
Reviewed-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-05-20 09:22:52 +02:00
Qihang
6fa9b543f6 tee: fix params_from_user() error path in tee_ioctl_supp_recv
params_from_user() may acquire tee_shm references for MEMREF parameters
before failing after partially processing the supplied parameter array.

In tee_ioctl_supp_recv(), those references are currently not released on
that error path.

Fix this by freeing MEMREF references before returning when
params_from_user() fails.

Keep the final cleanup path in tee_ioctl_supp_recv() unchanged since
supp_recv() may consume and replace the supplied parameters, unlike the
other TEE ioctl callback paths.

Signed-off-by: Qihang <q.h.hack.winter@gmail.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-05-20 08:49:09 +02:00
Georgiy Osokin
26682f5efc tee: shm: fix shm leak in register_shm_helper()
register_shm_helper() allocates shm before calling
iov_iter_npages(). If iov_iter_npages() returns 0, the function
jumps to err_ctx_put and leaks shm.

This can be triggered by TEE_IOC_SHM_REGISTER with
struct tee_ioctl_shm_register_data where length is 0.

Jump to err_free_shm instead.

Fixes: 7bdee41575 ("tee: Use iov_iter to better support shared buffer registration")
Cc: stable@vger.kernel.org
Cc: lvc-project@linuxtesting.org
Signed-off-by: Georgiy Osokin <g.osokin@auroraos.dev>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-05-20 08:49:09 +02:00
Rodrigo Zaiden
3faa6774ff tee: optee: fix kernel-doc warnings
Fix kernel-doc issues in optee_private.h and optee_msg.h:

- Add missing documentation for struct members: optee_msg_param_value,
  optee_msg_param, optee_msg_arg, optee, and optee_ffa;
- Ensure member descriptions follow the order of declaration;
- Use consistent formatting (lowercase descriptions and ':' after
  member names);
- Adjust indentation for better alignment;

This resolves kernel-doc warnings such as missing member descriptions
and incorrect prototype documentation.
No functional changes.

Signed-off-by: Rodrigo Zaiden <rodrigoffzz@gmail.com>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-04-27 14:13:14 +02:00
Hirokazu Honda
1a6e94a8ff tee: optee: Allow MT_NORMAL_TAGGED shared memory
On ARM64, shared memory can have MT_NORMAL_TAGGED attribute when using
the Memory Tagging Extension (MTE). The OP-TEE driver needs to
recognize this as normal memory to allow sharing such buffers with the
Secure World.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-04-27 14:13:14 +02:00
Rijo Thomas
84a1e6179b tee: amdtee: store buffer ID in tee_shm->sec_world_id
Drop struct amdtee_shm_data and the per-context shm_list. In
handle_map_shmem() save the returned buf_id in shm->sec_world_id
instead of allocating a list node. Use shm->sec_world_id (with
get_buffer_id() removed) in amdtee_unmap_shmem() and in call.c when
building memref params. Remove shm_list and shm_mutex from
amdtee_context_data.

Aligns amdtee with other TEE drivers (optee, tstee, qcomtee) that use
tee_shm->sec_world_id for the secure-world handle.

Signed-off-by: Rijo Thomas <Rijo-john.Thomas@amd.com>
Reviewed-by: Devaraj Rangasamy <Devaraj.Rangasamy@amd.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-04-27 14:13:08 +02:00
Linus Torvalds
31b43c079f soc: drivers for 7.1
The driver updates again are all over the place with many minor fixes
 going into platform specific code. The most notable changes are:
 
  - Support for Microchip pic64gx system controllers
  - Work on cleaning up devicetree bindings for SoC drivers, and
    converting them into the new format
  - Lots of smaller changes for Qualcomm SoC drivers, including support
    for a number of newly supported chips
  - reset controller API cleanups and a new driver for Cix Sky1
  - Reworks of the Tegra PMC and CBB drivers, along with a change
    to how individual Tegra SoCs get selected in Kconfig and
    BPMP firmware driver updates including a refresh of the ABI
    header to match the version used by firmware
  - STM32 updates to the firewall bus driver and support for
    the debug bus through OP-TEE
  - SCMI firmware driver improvements for reliability, in particular
    for dealing with broken firmware interrupts
  - Memory driver updates for Tegra, and a patch to remove the
    unused Baikal T1 driver
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmnhCSYACgkQmmx57+YA
 GNl2ow/+Pti7qbBE34WNyIuWOgZEzjo1OeLe/Y4LqkQmHcM9FJV3/rCadA/FkmD9
 nH85WiRuUjIjzUiAl24SP2nkEcIU/yv8ECvROX46uAjhTByVHkaCedwl3ECW9RPA
 IAYiTJPrQBNCmWZuGO4bZ3go6hHn4q4RSd2V8vrCw/J3b+wBSAPTPzsaWnWg4MiL
 QYz7sBTwcNJaJuwJ7ZnHN/VgEOs9OgY6ejGJImiaVzBbsH7rNp7Cbs6t88X5rCXS
 mbgMvVlYKbsOWj3kNyv98YFAGgzo59uEL+m+846U32w9o0nIgkmIS60RQ5k73JV4
 QlhV1uT7PPtu7y7VbxfJ8KISxaRoex/+AZShmAWCul4YK75hEWT3mWGhM8cqeMUQ
 U0ogpbekRjKdn2Bgfl6kHf38smusjJ1fOBr8QIZcdDJpEtxYtRmNpLUNNSc5vO+T
 HvA79C8I8ydWGyqr1wRP1gDRBNc1BDYKxJO4ohvjnAPIeC01zArXCOyf0F3VtPzH
 XSycnyW7eRUVi+4C3/cF8qzhW2y7Wx03ui5mCDIEcOzyVoGNqTrPNsbCvkNkyrdc
 jqvWagZ4Ci8jaRxLAawnqHI/stvsHx9V+NPp6p07BsOxJMsuOqO4sInRhh5P6YvM
 5wZCFUK37xPEqYvr+BFS9B/4jgw3Mg2Kj+gjxShwsLS5JtVDfZw=
 =UB4F
 -----END PGP SIGNATURE-----

Merge tag 'soc-drivers-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull SoC driver updates from Arnd Bergmann:
 "The driver updates again are all over the place with many minor fixes
  going into platform specific code. The most notable changes are:

   - Support for Microchip pic64gx system controllers
   - Work on cleaning up devicetree bindings for SoC drivers, and
     converting them into the new format
   - Lots of smaller changes for Qualcomm SoC drivers, including support
     for a number of newly supported chips
   - reset controller API cleanups and a new driver for Cix Sky1
   - Reworks of the Tegra PMC and CBB drivers, along with a change to
     how individual Tegra SoCs get selected in Kconfig and BPMP firmware
     driver updates including a refresh of the ABI header to match the
     version used by firmware
   - STM32 updates to the firewall bus driver and support for the debug
     bus through OP-TEE
   - SCMI firmware driver improvements for reliability, in particular
     for dealing with broken firmware interrupts
   - Memory driver updates for Tegra, and a patch to remove the unused
     Baikal T1 driver"

* tag 'soc-drivers-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (193 commits)
  firmware: arm_ffa: Use the correct buffer size during RXTX_MAP
  firmware: qcom: scm: Allow QSEECOM on Lenovo IdeaCentre Mini X
  clk: spear: fix resource leak in clk_register_vco_pll()
  reset: rzv2h-usb2phy: Add support for VBUS mux controller registration
  reset: rzv2h-usb2phy: Convert to regmap API
  dt-bindings: reset: renesas,rzv2h-usb2phy: Document RZ/G3E USB2PHY reset
  dt-bindings: reset: renesas,rzv2h-usb2phy: Add '#mux-state-cells' property
  soc: microchip: add mpfs gpio interrupt mux driver
  dt-bindings: soc: microchip: document PolarFire SoC's gpio interrupt mux
  gpio: mpfs: Add interrupt support
  soc: qcom: ubwc: add helpers to get programmable values
  soc: qcom: ubwc: add helper to get min_acc length
  firmware: qcom: scm: Register gunyah watchdog device
  soc: qcom: socinfo: Add SoC ID for SA8650P
  dt-bindings: arm: qcom,ids: Add SoC ID for SA8650P
  firmware: qcom: scm: Allow QSEECOM on Mahua CRD
  soc: qcom: wcnss: simplify allocation of req
  soc: qcom: pd-mapper: Add support for Eliza
  soc: qcom: aoss: compare against normalized cooling state
  soc: qcom: llcc: fix v1 SB syndrome register offset
  ...
2026-04-16 20:34:34 -07:00
Rouven Czerwinski
8c6e843f1c optee: simplify OP-TEE context match
Simplify the TEE implementor ID match by returning the boolean
expression directly instead of going through an if/else.

Signed-off-by: Rouven Czerwinski <rouven.czerwinski@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-03-04 08:33:31 +01:00
Matthew Wilcox
08d9a4580f tee: shm: Remove refcounting of kernel pages
Earlier TEE subsystem assumed to refcount all the memory pages to be
shared with TEE implementation to be refcounted. However, the slab
allocations within the kernel don't allow refcounting kernel pages.

It is rather better to trust the kernel clients to not free pages while
being shared with TEE implementation. Hence, remove refcounting of kernel
pages from register_shm_helper() API.

Fixes: b9c0e49abf ("mm: decline to manipulate the refcount on a slab page")
Reported-by: Marco Felsch <m.felsch@pengutronix.de>
Reported-by: Sven Püschel <s.pueschel@pengutronix.de>
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Co-developed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Tested-by: Sven Püschel <s.pueschel@pengutronix.de>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-03-03 09:03:04 +01:00
Amirreza Zarrabi
387a926ee1 tee: optee: prevent use-after-free when the client exits before the supplicant
Commit 70b0d6b0a1 ("tee: optee: Fix supplicant wait loop") made the
client wait as killable so it can be interrupted during shutdown or
after a supplicant crash. This changes the original lifetime expectations:
the client task can now terminate while the supplicant is still processing
its request.

If the client exits first it removes the request from its queue and
kfree()s it, while the request ID remains in supp->idr. A subsequent
lookup on the supplicant path then dereferences freed memory, leading to
a use-after-free.

Serialise access to the request with supp->mutex:

  * Hold supp->mutex in optee_supp_recv() and optee_supp_send() while
    looking up and touching the request.
  * Let optee_supp_thrd_req() notice that the client has terminated and
    signal optee_supp_send() accordingly.

With these changes the request cannot be freed while the supplicant still
has a reference, eliminating the race.

Fixes: 70b0d6b0a1 ("tee: optee: Fix supplicant wait loop")
Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Tested-by: Ox Yeh <ox.yeh@mediatek.com>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-03-02 14:36:50 +01:00
Kees Cook
189f164e57 Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses
Conversion performed via this Coccinelle script:

  // SPDX-License-Identifier: GPL-2.0-only
  // Options: --include-headers-for-types --all-includes --include-headers --keep-comments
  virtual patch

  @gfp depends on patch && !(file in "tools") && !(file in "samples")@
  identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex,
 		    kzalloc_obj,kzalloc_objs,kzalloc_flex,
		    kvmalloc_obj,kvmalloc_objs,kvmalloc_flex,
		    kvzalloc_obj,kvzalloc_objs,kvzalloc_flex};
  @@

  	ALLOC(...
  -		, GFP_KERNEL
  	)

  $ make coccicheck MODE=patch COCCI=gfp.cocci

Build and boot tested x86_64 with Fedora 42's GCC and Clang:

Linux version 6.19.0+ (user@host) (gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7), GNU ld version 2.44-12.fc42) #1 SMP PREEMPT_DYNAMIC 1970-01-01
Linux version 6.19.0+ (user@host) (clang version 20.1.8 (Fedora 20.1.8-4.fc42), LLD 20.1.8) #1 SMP PREEMPT_DYNAMIC 1970-01-01

Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-22 08:26:33 -08:00
Linus Torvalds
32a92f8c89 Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
This converts some of the visually simpler cases that have been split
over multiple lines.  I only did the ones that are easy to verify the
resulting diff by having just that final GFP_KERNEL argument on the next
line.

Somebody should probably do a proper coccinelle script for this, but for
me the trivial script actually resulted in an assertion failure in the
middle of the script.  I probably had made it a bit _too_ trivial.

So after fighting that far a while I decided to just do some of the
syntactically simpler cases with variations of the previous 'sed'
scripts.

The more syntactically complex multi-line cases would mostly really want
whitespace cleanup anyway.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-21 20:03:00 -08:00
Linus Torvalds
bf4afc53b7 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using

    git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-21 17:09:51 -08:00
Kees Cook
69050f8d6d treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-21 01:02:28 -08:00
Arnd Bergmann
ee5dde7ed6 TEE sysfs for 6.20
- Add an optional generic sysfs attribute for TEE revision
 - Implement revision reporting for OP-TEE using both SMC and FF-A ABIs
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEE0qerISgy2SKkqO79Wr/6JGat8H4FAmlrgt0aHGplbnMud2lr
 bGFuZGVyQGxpbmFyby5vcmcACgkQWr/6JGat8H7ieA/+LWgQ6n9yUUxZ4hnK2538
 lSg9vkBuGYeMcObNyKwtehB3+ivjtQB6ZTdV8OCVhduKFXLBb/6Iedf1zHrVrEi2
 qXTZutfzPNFD4wfD+VvpfY3ydxbvB+xBOKwNEI+2mUnyxe7RiDWkMKKg6dS2p9uy
 dvs1+H9yYyL/jMecNbjrBaUFQ80YzHUakQ2ExHWRUZtUHKKVcELlbWzvNxfTa+Xo
 lyuhWFr9/u6loJ+kyMcq4vaesM8fdfq6ESaeoWGumFyviy3Ds/k9HNyTSwqHn/9S
 CfcG3souXA/9WUaH9q3pM8pb9VZHfYLIIPZ9LB0qePdJL82Fh16KGWnSEyQyEehJ
 fpOPui8LAP9siyR9Ett8i1vvXf2qquZxx5Ep+07u+Vx1ho6CfGL30hpzQTBJrHRI
 GfLyjfZYiR2sOkUE0sfFMxZDy6F5OOJL3/NIAXC4C7MLOFbeFChsbkd9Cz0K4kGA
 InPBVDVfIANBTGxsZT2YizLPar8Ui1X6L3o1nrb75qEJn86QUdzVgr20XuCfnRi1
 W7QIa97QJGA8sBVHLEoZFRSDJjVJP+7vWK2hn6qW6iJiLMkuBoKY741WmEM1wEdW
 sgZ0D014Oxc7EstWPfbgkX5K/2ABsrtg6Lb1/X39N3uMkvaxRzwhyuCSjeVzlczv
 AoFdyelBnTLCWemZ/fI8goo=
 =8kDV
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmlw8S0ACgkQmmx57+YA
 GNm68A//auSP2t30O+WMO4biHofoKhkgeoj4IkuQKCReKeCukjCRy0Sh+S7XJkbv
 UYfPhUg44b9p3xjD+jugTv2FqCMV9ivdGAGOLIekEeknIKgHJ0sqCGpKgahL7w17
 aWV2eGVe1tnA0RKx51ixHe9m38/esQsxCTFT3dS8RiKvfljhM+KXgH8pNy+aT+QO
 hazk0uWRsM5rYCbAL5vbt+zjt2lTO34cCp2+OM/18S1x4lgfW2kDQBYYtgAZvZJF
 MclDCvXP06SOakGmr5sAnRN943fH5zmEGbw1buoXjStsiJX4EHuccHtAmjvOwPD/
 p7MKPiSn8WEdhNiLVk9XV/SSs+aYtT69c3uGjV+1MnhsB7RVjqA+xfhK8LZajseb
 r0ZSReUJF+KpguHqJfNj+bVQQm1KFRsIqurB0Cn7J+fwRAiS5D9Mqku/OGYso2GE
 RGPavlndN8ytZWJiYKyzsBOkAiYR0jejJbwMH8OA72/mcDsxibLafSr5DSeYpmmS
 AfXPGkZEluNYW0UccrsFov+rZ6AHiGCuElNVZ2W1l1QKc641aS1y1Ar987ysq1PC
 KrpSHDihrzbBcIgTKCQoL19vaqusOyDk6RB263zOLrgEWnelxVSLcQWEDTPjX9dV
 4Ys/DE+O1dZIZ0Waq88InzpIZlUcLlVMJEEiXSRxIGskFYNgaZM=
 =lDdi
 -----END PGP SIGNATURE-----

Merge tag 'tee-sysfs-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into soc/drivers

TEE sysfs for 6.20

- Add an optional generic sysfs attribute for TEE revision
- Implement revision reporting for OP-TEE using both SMC and FF-A ABIs

* tag 'tee-sysfs-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
  tee: optee: store OS revision for TEE core
  tee: add revision sysfs attribute

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2026-01-21 16:30:52 +01:00
Arnd Bergmann
4b45c2f3f8 AMDTEE update for 6.20
Remove unused return variables
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEE0qerISgy2SKkqO79Wr/6JGat8H4FAmlrgWoaHGplbnMud2lr
 bGFuZGVyQGxpbmFyby5vcmcACgkQWr/6JGat8H7p3Q//boaLed/kX6xTiE4o23DY
 AvwjVD8lDjHWNkxuacJa2S/aW2Ocz4tspc/usQleoH69UKbsODiPddtbclM3Zp8N
 zT2ge9tl+6rzmmjmmO0y5k5GhxGfvtDfUwXoIfoHcoS+mes7Eo0SlXGp6QL25yT3
 bRh5ry+LVe5J6JnWkLZzV/YpEmw+7IFn94oeaZ2mZp6jHh2vYB5aYxlVCQUyQMpa
 17jc+Kj4gYeBgu7ct+CWCeRW2hfPGHI133S/uJfvyztQjJLS/6UOhqdVyXMWs3ER
 llpJiUGs+gosdsBsBUDNhSZJLfkUTgcMLxQv5p3sd9GAC1MsuKT/qUGi7E95oesy
 Bm4n3gL7VRHetyuvCQaYggnDarhiFoNLg/IxLVO4SgqnmT8s4C/2RDWNl4dH0w27
 WQw+ck04B5OEY/QjPUiKCSccRDORaQ23BErXpF4xSn4yAXRTak4xEpVoUvOUz3LT
 WiLwgaDNrUJIkqjWLIrnYnKNRkeCGMcsQnmDmG17g221DxOL1W4AnEkYzuvuTthN
 RENqYwv5FjWccgpME27xSazLhnAR5KPuDYfhfvdomp6D6MqKmTdA0D1tfzocP447
 Gpn8lUicazpdqeSmoGKAOyP05M0fyA4tz5ty0ZFkEccGcwgsVsxrQhhn71r/hnOG
 zF6NtFW/OORBD192XEsekLc=
 =WKQQ
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmlw8PgACgkQmmx57+YA
 GNlwFBAAns0z8NHhU2SBlqlUD7+3bmc6EhVl2i/VlAQ4KeQ6PtulX8eA5vkTER3Z
 sMrgs3gDBr7qPlZUc8Uu98UoD8G/mNM5LY5lRAOHSpOQ3ONIHJqtk2wT0+GcMCHI
 qNt263arISya79ombFBRCQcRFDYaS5k+W92iHgw/AnkHCiUkXMnBwKiAaxBlOKKp
 q17FcSN+6TchiyIKUruY9vzxC0d6nyH0QRlVov0Hm6iWsenOpEYAaIkqAoApTTGX
 Zw+vAkx2aH4Q9ezwX3zyYAtZCVfQ6iyF/PnI7uVi1optCMzuJ+Db7tPes9jw1V46
 6PNXC5Runaec/G4FWn3qriyeQz/Mz2G7k0hJ3n1iHLkQtYX/JhU5Otmhet4mtyTx
 MslNhQWLR/d/czvnEMQ/YjPr3yqu2RKOEMt7SAK0AVPR3permKRgcdsgQSpD4w0r
 Onc+wvQjHu17+W6Oey+YwCb3hHVtIrHeM+f2CYF8b+IAGLT0cdwztnTkPMBCo2y3
 /vt2DRZi4Lm8Ip7eigylySHeCBBKf/irQekoAmXIGofBJQbmd+hXXO1jFSau+qv3
 EOOF8zvxvbiTjrazFBF79z/IGknU4bUaVg3cBBIA1ukogGLMGHhGQoDX/owpyXst
 51BevQuCdkSTFD+fkeePmhxqz5zuS48kELj7qgxcPpmstKOcSaQ=
 =6nWs
 -----END PGP SIGNATURE-----

Merge tag 'amdtee-update-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into soc/drivers

AMDTEE update for 6.20

Remove unused return variables

* tag 'amdtee-update-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
  tee: amdtee: Remove unused return variables

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2026-01-21 16:29:54 +01:00
Arnd Bergmann
e6bea2f553 TEE bus callback for 6.20
- Move from generic device_driver to TEE bus-specific callbacks
 - Add module_tee_client_driver() and registration helpers to reduce
   boilerplate
 - Convert several client drivers (TPM, KEYS, firmware, EFI, hwrng,
   and RTC)
 - Update documentation and fix kernel-doc warnings
 -----BEGIN PGP SIGNATURE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rq
 KmWob7BA0GH0DfrYy9PH5i5V77n6r3oLYa2G65G4wPcmiI1RQ6X+KqDu4Sf5cwAf
 6QYLGIylAjNA0RWAj8NahxcJO+IximPpdBusYuMwqUma1fzy/2XkDuIs8TR/FnNQ
 6V83SUCZBuH9V49WcWYJlvtSHpQFzdxsgo5IoZm+mDXTfnlFk2OO9iByfxD0kbGH
 sdBxsT1ZFcrT9WZS9XvR9MvjYJcsT1uYdXn2wkWZ9hw9Ck52gZ/dOZvbpoJflPQe
 yEXXnK0ebnhRQ69TTvjnz4Ss0r4IP48UaVZjEvCXwJhTN5/c36YJjQzWZHKc/8C5
 tfuY3rZBMxeqsUkbg1Z5mDHHvYm2FnnByGYEEOvR0pD2B2M0A1uaons2WLUG0w/A
 aJV7JCdrWw7RXOumYFS3TmxCGha5Gf05QlIGF8Bq9zdGNDkBHw2KUoIntPjD8FB7
 rLO3MOBT6gGCz3oEHb75LUEd0YvHtLIkRvkIUjPgENFZ7ejJ2Zoot9ISxNYje/Tv
 bEyV/IUvqV26Evj2F0I/85r+SQKVacTBngJkC2rr+lU3ayRTxrQ=
 =DwU/
 -----END PGP SIGNATURE-----

Merge tag 'tee-bus-callback-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into soc/drivers

TEE bus callback for 6.20

- Move from generic device_driver to TEE bus-specific callbacks
- Add module_tee_client_driver() and registration helpers to reduce
  boilerplate
- Convert several client drivers (TPM, KEYS, firmware, EFI, hwrng,
  and RTC)
- Update documentation and fix kernel-doc warnings

* tag 'tee-bus-callback-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
  tpm/tpm_ftpm_tee: Fix kdoc after function renames
  tpm/tpm_ftpm_tee: Make use of tee bus methods
  tpm/tpm_ftpm_tee: Make use of tee specific driver registration
  KEYS: trusted: Make use of tee bus methods
  KEYS: trusted: Migrate to use tee specific driver registration function
  firmware: tee_bnxt: Make use of tee bus methods
  firmware: tee_bnxt: Make use of module_tee_client_driver()
  firmware: arm_scmi: Make use of tee bus methods
  firmware: arm_scmi: optee: Make use of module_tee_client_driver()
  efi: stmm: Make use of tee bus methods
  efi: stmm: Make use of module_tee_client_driver()
  hwrng: optee - Make use of tee bus methods
  hwrng: optee - Make use of module_tee_client_driver()
  rtc: optee: Make use of tee bus methods
  rtc: optee: Migrate to use tee specific driver registration function
  tee: Adapt documentation to cover recent additions
  tee: Add probe, remove and shutdown bus callbacks to tee_client_driver
  tee: Add some helpers to reduce boilerplate for tee client drivers

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2026-01-21 16:28:23 +01:00
Arnd Bergmann
08b67ff20f OP-TEE update for 6.20
- A micro optimization by making a local array static const
 - Update OP-TEE mailing list as moderated
 - Update an outdated comment for cmd_alloc_suppl()
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEE0qerISgy2SKkqO79Wr/6JGat8H4FAmlredUaHGplbnMud2lr
 bGFuZGVyQGxpbmFyby5vcmcACgkQWr/6JGat8H4xChAAhUG/QPAPPCyG3m8mLQ5e
 drjiKMa20TE31r+tNUJGuUCxa9JPPFZEoX+6ucYaOUZhGaUW8qYhbAl+kMmsu/O3
 pZay6bjp/Dpbo9QKn94Gl7JtvPXZD3RV9SZb9Hdzb4OdH/A9+/CQcnWzufgccoTD
 rXEwtJhTn972aXkbLAZY9dL9DcMA+dvBdzhc5Y8F9zH6+BLfV/duCmb8EHUlT528
 zTqGrTTdL11IcpimvdJ1LG4UMAjEZe1nIedJ3Fqxg6nhxQD7lv+10kY2QFonqhsF
 drgukflh7K5Y9ROOATekzt3SJINpkvlQOq0baXVOJhHBjAhB5hzOFfArx2mkMW9g
 Z9wyj45n5U6aIKUzXhrprBiZ8miSut0Mtjp35hsc6a1WWbfBKJ6nranCeMMSh0ff
 hnhUGL8iG1fbzbTkyIT0jDN6vS2dFxJx4zNoN5v8HPXs64IPgJihI7hzriJkxAbh
 mcEhZ1FXx16sumqNw79AC25GBkI0+QkkIyTO1GhsvnLcRpbfnotY/AKABAD1uWKt
 Erql3++GKjx0t9DFpzPsttyLJqVa3GHe9ImsX5gCGzfUO7vB54Gie/GKNxOPbDrL
 Wcmhj0mHPNznySqBupM5dUSBP/9Fs+XDUhW8wz1QctfoRYeERmKn1HjqpCVSJlOa
 DB/UCdiA4+UcfV5k7oGvr9I=
 =iY48
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmlw8GEACgkQmmx57+YA
 GNmLxw//aEhs8ucwR+MzIwmgIIJOv2KBNSYZnQLGB3xTGKPFHXdRKPlBkIBTzuP8
 kWJKJs6hBn7XPZb9AsQceNaOhfDqtHFVIrj9fWKfoROj6+0BWMY7M//67KheOSO6
 JO5kDFgVyW53yj9msRc/LuxVjrHnBoT/CVxVu9gRdHkV8JUoFL5iE7+5lrbzKIKE
 QpOFhCNiOq+xmNl1oUcsP2V+F30XpOrrZ48HBjWhUz3jbweXHvKVWlB5oQweIsdV
 QznvdMymtALncJy/KvYnA5bXT2zE3Dox1h6ExgBGuvRHTEcOUuR7BaM06efMbCN1
 7iENA5evIpSSMcw9NMXdN4Dkbr3Y3505HbPQrmFZyuVJdfMuCgPy6AJe3jb0qxr1
 EYmqU3NibvH6rLidI/k/eCpGdzyASM9hN3Z7A2hTvlKRzL0ms3C8R1YBG08Jthg8
 89Lexux9Cask7+HHYJ/ZM5tIJ6/vkIwda9UTbng4BTaVc+J6LqFqadgQcWSd8fGb
 kbXJ3+4CeqV2V+/1LXj2is/HfXvPFBU1xpE93p6xXo554yKrNIoA5xueWpVKKI4B
 8gqBRbvrVpvgryj0oGtdb3zBPs8YBmhXpU48bRoihYyR5dKJOPkTEB7X6Nf4lG3Y
 nRHr/Ghg71nIyrPX+jJMrZllnp6PTEKzayJyCZTomf8t5STaB78=
 =diWz
 -----END PGP SIGNATURE-----

Merge tag 'optee-update-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into soc/drivers

OP-TEE update for 6.20

- A micro optimization by making a local array static const
- Update OP-TEE mailing list as moderated
- Update an outdated comment for cmd_alloc_suppl()

* tag 'optee-update-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
  optee: make read-only array attr static const
  MAINTAINERS: Mark the OP-TEE mailing list moderated
  optee: update outdated comment

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2026-01-21 16:27:27 +01:00
Colin Ian King
94ea7063fa optee: make read-only array attr static const
Don't populate the read-only array attr on the stack at run
time, instead make it static const.

Signed-off-by: Colin Ian King <coking@nvidia.com>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-01-16 10:35:05 +01:00
Aristo Chen
c19faf5a62 tee: optee: store OS revision for TEE core
Collect OP-TEE OS revision from secure world for both SMC and FF-A
ABIs, store it in the OP-TEE driver, and expose it through the
generic get_tee_revision() callback.

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
2026-01-15 10:35:14 +01:00
Aristo Chen
241bdf7253 tee: add revision sysfs attribute
Add a generic TEE revision sysfs attribute backed by a new
optional get_tee_revision() callback. The revision string is
diagnostic-only and must not be used to infer feature support.

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-01-14 12:04:34 +01:00
Thorsten Blum
a0db08f47c tee: amdtee: Remove unused return variables
In tee_params_to_amd_params() and amd_params_to_tee_params(), return 0
directly and remove the unused return variables.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-01-14 10:20:51 +01:00
Julia Lawall
499ea377ed optee: update outdated comment
The function cmd_alloc_suppl() was renamed as
optee_rpc_cmd_alloc_suppl() in commit c51a564a5b
("optee: isolate smc abi").  Update the comment
accordingly.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-01-05 10:34:28 +01:00
Krzysztof Kozlowski
1c05d9a4ca tee: qcomtee: user: Fix confusing cleanup.h syntax
Initializing automatic __free variables to NULL without need (e.g.
branches with different allocations), followed by actual allocation is
in contrary to explicit coding rules guiding cleanup.h:

"Given that the "__free(...) = NULL" pattern for variables defined at
the top of the function poses this potential interdependency problem the
recommendation is to always define and assign variables in one statement
and not group variable definitions at the top of the function when
__free() is used."

Code does not have a bug, but is less readable and uses discouraged
coding practice, so fix that by moving declaration to the place of
assignment.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-01-05 10:21:09 +01:00
Krzysztof Kozlowski
7c4c14ad3d tee: qcomtee: mem: Fix confusing cleanup.h syntax
Initializing automatic __free variables to NULL without need (e.g.
branches with different allocations), followed by actual allocation is
in contrary to explicit coding rules guiding cleanup.h:

"Given that the "__free(...) = NULL" pattern for variables defined at
the top of the function poses this potential interdependency problem the
recommendation is to always define and assign variables in one statement
and not group variable definitions at the top of the function when
__free() is used."

Code does not have a bug, but is less readable and uses discouraged
coding practice, so fix that by moving declaration to the place of
assignment.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-01-05 10:21:09 +01:00
Krzysztof Kozlowski
4cc19518da tee: qcomtee: call: Fix confusing cleanup.h syntax
Initializing automatic __free variables to NULL without need (e.g.
branches with different allocations), followed by actual allocation is
in contrary to explicit coding rules guiding cleanup.h:

"Given that the "__free(...) = NULL" pattern for variables defined at
the top of the function poses this potential interdependency problem the
recommendation is to always define and assign variables in one statement
and not group variable definitions at the top of the function when
__free() is used."

Code does not have a bug, but is less readable and uses discouraged
coding practice, so fix that by moving declaration to the place of
assignment.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2026-01-05 10:21:09 +01:00
Uwe Kleine-König
71a3346572 tee: Add probe, remove and shutdown bus callbacks to tee_client_driver
Introduce a bus specific probe, remove and shutdown function. For now
this only allows to get rid of a cast of the generic device to a
tee_client device in the drivers and changes the remove prototype to
return void---a non-zero return value is ignored anyhow.

The objective is to get rid of users of struct device_driver callbacks
.probe(), .remove() and .shutdown() to eventually remove these. Until
all tee_client drivers are converted this results in a runtime warning
about the drivers needing an update because there is a bus probe
function and a driver probe function.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2025-12-17 18:28:28 +01:00
Uwe Kleine-König
a707eda330 tee: Add some helpers to reduce boilerplate for tee client drivers
Similar to platform drivers (and others) create dedicated register and
unregister functions and a macro to simplify modules that only need to
handle driver registration in their init and exit handlers.

Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2025-12-17 18:28:27 +01:00
Arnd Bergmann
fe7cdcd1ba QCOMTEE fixes2 for v6.18
- initialize result before use in in error path
 - fix uninitialized pointers with free attribute
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEE0qerISgy2SKkqO79Wr/6JGat8H4FAmka6uoa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8Z4nu
 mD2Cfdj/l41P09miemeLCXIcOHRJShtVRzZdszTmKqi3YEESAYSw57OKfE4flcuR
 NhxLRwnZfetvuqW6wqNZBeoRLgTenpG5Qj2nPxJXpXG+gVw8EMvo87U/oq3bYNgu
 +04EjN2Ulc3BPuupfq5K4x3Pmf0olkDJ/qyaeUc//R6ouwH/4hQvqRWUewhJ+1MF
 wbfj/fPfOlhqPa5TiwwGWC9XK0ovq7bdcbEsVkJXJ7b4Do16zWa57dIS+heN4A/Z
 UlXBvjEWgYd0H9+AGkWii3iFFy86FGRxflGYDfti6iRMeo3h+RbiNx3w8KbOgLg2
 il6ne2TLvLg1pFqm67suPDXfyRRIKmkvIZtEyH8cdXmJ2zKYcrfoskd2Q9nd5bZE
 Bzy0KrO18mXNTjcnd3ht+6hkYcAcQFetk6DgU7aKg0WDNOeWFPlnxr7BBASVSZjI
 oiCcLW8GqCqJubMBjydso3q85AW8ig5phRCxuTP3kEbZPb71hMU=
 =r+Hg
 -----END PGP SIGNATURE-----

Merge tag 'qcomtee-fixes2-for-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into arm/fixes

QCOMTEE fixes2 for v6.18

- initialize result before use in in error path
- fix uninitialized pointers with free attribute

* tag 'qcomtee-fixes2-for-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
  tee: qcomtee: initialize result before use in release worker
  tee: qcomtee: fix uninitialized pointers with free attribute

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2025-11-21 21:27:20 +01:00
Amirreza Zarrabi
e19d7f7e92 tee: qcomtee: initialize result before use in release worker
Initialize result to 0 so the error path doesn't read it
uninitialized when the invoke fails. Fixes a Smatch warning.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/op-tee/7c1e0de2-7d42-4c6b-92fe-0e4fe5d650b5@oss.qualcomm.com/
Fixes: d6e290837e ("tee: add Qualcomm TEE driver")
Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2025-11-17 10:19:29 +01:00
Ally Heev
ac5ae0a5ce tee: qcomtee: fix uninitialized pointers with free attribute
Uninitialized pointers with `__free` attribute can cause undefined
behavior as the memory assigned randomly to the pointer is freed
automatically when the pointer goes out of scope.

qcomtee doesn't have any bugs related to this as of now, but
it is better to initialize and assign pointers with `__free`
attribute in one statement to ensure proper scope-based cleanup

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/aPiG_F5EBQUjZqsl@stanley.mountain/
Signed-off-by: Ally Heev <allyheev@gmail.com>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2025-11-14 08:42:07 +01:00
Arnd Bergmann
1d4e7d9f6b TEE QTEE fixes for v6.18
- Adds ARCH_QCOM dependency for the QTEE driver
 - Fixing return values for copy_from_user() failures
 - Guarding against potential off by one read
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEE0qerISgy2SKkqO79Wr/6JGat8H4FAmjfv58aHGplbnMud2lr
 bGFuZGVyQGxpbmFyby5vcmcACgkQWr/6JGat8H6uxA/+NFregDoinXbAYFzEjoTM
 g2tVAEe/6+1XWN37DngvWvV4ndnbq49n9EYqR4mWRz1KH5sCmTjpzolOpLvLmKd3
 woZeqPP6gpbmiKQQ08cK34axhfi0xAPAK9B9qiat5ARBN1CoT0E+OLp4u9B4RX7/
 zf2jU8PI2JrqqbABmUIkfqbHgP5Hh9TIzE3RH4oI/wLQl+F2goKBx+p2X8BEqmlw
 xRpD4nKMk8Hui/oIDwe9BJ5AzVb4hG/PY9O9UQRaW/WCifcIyWYWbE3cnnN1YtmO
 yRcGlalBa/wpRQR94pUUyrb1qhbb/PcdSa46S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EaGgNLEj/syuK0GfaRm9sKeS05B3weOb
 kipNi6jf/0ZEg3vl5tMBA687Y+cx0J4VuS5cCMwoExpl0RzZCriXA0uMfOE7ovdp
 b8134JCTLxhSdONUX2jK9mAXNOK0ovmwjuWqaVvlNb4w0YCQPAw=
 =G+xF
 -----END PGP SIGNATURE-----

Merge tag 'tee-qcomtee-fixes-for-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into arm/fixes

TEE QTEE fixes for v6.18

- Adds ARCH_QCOM dependency for the QTEE driver
- Fixing return values for copy_from_user() failures
- Guarding against potential off by one read

* tag 'tee-qcomtee-fixes-for-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
  tee: QCOMTEE should depend on ARCH_QCOM
  tee: qcom: return -EFAULT instead of -EINVAL if copy_from_user() fails
  tee: qcom: prevent potential off by one read
2025-10-17 15:26:52 +02:00
Geert Uytterhoeven
3b63efa21b tee: QCOMTEE should depend on ARCH_QCOM
The Qualcomm Trusted Execution Environment (QTEE) is only available on
Qualcomm SoCs.  Hence add a dependency on ARCH_QCOM, to prevent asking
the user about this driver when configuring a kernel without Qualcomm
platform support.

Fixes: d6e290837e ("tee: add Qualcomm TEE driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2025-10-02 08:31:10 +02:00
Linus Torvalds
38057e3236 soc: driver updates for 6.18
Lots of platform specific updates for Qualcomm SoCs, including a
 new TEE subsystem driver for the Qualcomm QTEE firmware interface.
 
 Added support for the Apple A11 SoC in drivers that are shared with the
 M1/M2 series, among more updates for those.
 
 Smaller platform specific driver updates for Renesas, ASpeed, Broadcom,
 Nvidia, Mediatek, Amlogic, TI, Allwinner, and Freescale SoCs.
 
 Driver updates in the cache controller, memory controller and reset
 controller subsystems.
 
 SCMI firmware updates to add more features and improve robustness.
 This includes support for having multiple SCMI providers in a single
 system.
 
 TEE subsystem support for protected DMA-bufs, allowing hardware to
 access memory areas that managed by the kernel but remain inaccessible
 from the CPU in EL1/EL0.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmjdpaoACgkQmmx57+YA
 GNnBXA//QgmFXYGG7QfB825mt0orKZxpfpLcwvqO7hkWgbXtl7Gokw2lGYN6bwLu
 zvY4MQ/bVoZ8R5uTVmuaSHBRsttSen8mBf+V0vzsBM/DRRVxvIN/7TESrY3J7Dtx
 J5syHKIBiUtdkDebWWC6jIElczIBItsd03Ln4Xjjt8Vas5YOO4n44zFrPo+FwlN/
 I6D2K86AiNZTtUCDMtB6VfJ6YtjYBWcWnJm7FXw/vE8FAXdZUnNWnZ8hbdQ5GaME
 JZGepUhONaOMUoGNZNaDGw511RdPhYzPjj9rCsIx2qdsRO9/4tJ8ccpW2aUMYh8c
 nA6w8Hj8jCwco6aYYrDUDV9uRtURDrmyJgTJBNLU05e/L+MuJ3IZNlzHFWlsxIAE
 vhyTdmg/P04ClQyixCl67IH/66F/0smX9C+1761LrD7GTdfR92KPl5W6q+DPBg/x
 yf+s2p3+f7ItV5XobKOrbf3w0xazeDb5o/EK8BufMx9vSe9bpzJ0gOf0CmNXEpyZ
 owAhbh6wXX1YwPcyA9LHv6gthyJwc/3fLu49ggMZP2rU01ccKOYn9H0cr7C8NVmy
 wEpJR0lp5aSw2oRkPkxB6sFmUohcpr8/OXGGJuvCXkYsUY1BEup4lewvbIWK4WoE
 c84kbbaHsjgFhe3IRlQw3G4KLYQT3jRtF7fH+gPx556BcI6K+lg=
 =mcZR
 -----END PGP SIGNATURE-----

Merge tag 'soc-drivers-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull SoC driver updates from Arnd Bergmann:
 "Lots of platform specific updates for Qualcomm SoCs, including a new
  TEE subsystem driver for the Qualcomm QTEE firmware interface.

  Added support for the Apple A11 SoC in drivers that are shared with
  the M1/M2 series, among more updates for those.

  Smaller platform specific driver updates for Renesas, ASpeed,
  Broadcom, Nvidia, Mediatek, Amlogic, TI, Allwinner, and Freescale
  SoCs.

  Driver updates in the cache controller, memory controller and reset
  controller subsystems.

  SCMI firmware updates to add more features and improve robustness.
  This includes support for having multiple SCMI providers in a single
  system.

  TEE subsystem support for protected DMA-bufs, allowing hardware to
  access memory areas that managed by the kernel but remain inaccessible
  from the CPU in EL1/EL0"

* tag 'soc-drivers-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (139 commits)
  soc/fsl/qbman: Use for_each_online_cpu() instead of for_each_cpu()
  soc: fsl: qe: Drop legacy-of-mm-gpiochip.h header from GPIO driver
  soc: fsl: qe: Change GPIO driver to a proper platform driver
  tee: fix register_shm_helper()
  pmdomain: apple: Add "apple,t8103-pmgr-pwrstate"
  dt-bindings: spmi: Add Apple A11 and T2 compatible
  serial: qcom-geni: Load UART qup Firmware from linux side
  spi: geni-qcom: Load spi qup Firmware from linux side
  i2c: qcom-geni: Load i2c qup Firmware from linux side
  soc: qcom: geni-se: Add support to load QUP SE Firmware via Linux subsystem
  soc: qcom: geni-se: Cleanup register defines and update copyright
  dt-bindings: qcom: se-common: Add QUP Peripheral-specific properties for I2C, SPI, and SERIAL bus
  Documentation: tee: Add Qualcomm TEE driver
  tee: qcom: enable TEE_IOC_SHM_ALLOC ioctl
  tee: qcom: add primordial object
  tee: add Qualcomm TEE driver
  tee: increase TEE_MAX_ARG_SIZE to 4096
  tee: add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF
  tee: add TEE_IOCTL_PARAM_ATTR_TYPE_UBUF
  tee: add close_context to TEE driver operation
  ...
2025-10-01 17:32:51 -07:00
Arnd Bergmann
0a8c310491 TEE fix2 for v6.17
Fixing incorrect error handling for a call to iov_iter_extract_pages().
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEE0qerISgy2SKkqO79Wr/6JGat8H4FAmjTqXAaHGplbnMud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nZpvhCZNenlOc/O99bUiFIJ1FlnG97QvXqQ0j48H7Kq6A2/gid5mQeFT0fVMvA/0
 UD7UuLA1n3f+3d+lfhHsbcUXs/93DVKs5ZUa5hJsdl5VmxVz0sZhrqzdFWlqalhq
 hgbqzhLAuP+B2a6rhJ2+x9mdKVeTxSxeLFRi5Oe2t176y/Zovz9DUD0LwfiD5+GY
 djUMKuNr9guWVINhbSANi2UUfM5xRmErTeeVg34YzUUnRAgcSqG5WtkzlAme/KPB
 RFtgS5CKtIiBTFS/6nqO9TYoMZkroq48c5u05atwdFuyLsCDT2auDfaKQjjczZKI
 6UgrHkMxYDoiVAKP787hpvNbzoK4I3gF5OQ4U0UcBAoT7+SAgSDpoMVoDOOAib0c
 RccBsYhuTVVab2DmBu3TWis5sKk/KbbZ7GiKn7CVHx4Y+pd3H8UeCs34aEcx2XnM
 pUk6K4KyzsUeXP4rxMW18m1ycKfhkrR7bmZDurJTroWyqnL25CE=
 =WKuv
 -----END PGP SIGNATURE-----

Merge tag 'tee-shm-register-fix-for-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into soc/drivers

TEE fix2 for v6.17

Fixing incorrect error handling for a call to iov_iter_extract_pages().

* tag 'tee-shm-register-fix-for-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
  tee: fix register_shm_helper()

Link: https://lore.kernel.org/r/20250924083404.GA3747732@rayden
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2025-09-24 23:12:20 +02:00
Arnd Bergmann
ff0bebab77 Add Qualcomm TEE driver (QTEE)
This introduces a Trusted Execution Environment (TEE) driver for
 Qualcomm TEE (QTEE).
 
 QTEE enables Trusted Applications (TAs) and services to run securely. It
 uses an object-based interface, where each service is an object with
 sets of operations.
 
 Kernel and userspace services are also available to QTEE through a
 similar approach. QTEE makes callback requests that are converted into
 object invocations. These objects can represent services within the
 kernel or userspace process.
 
 We extend the TEE subsystem to understand object parameters and an ioctl
 call so client can invoke objects in QTEE:
   - TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_*
   - TEE_IOC_OBJECT_INVOKE
 
 The existing ioctl calls TEE_IOC_SUPPL_RECV and TEE_IOC_SUPPL_SEND are
 used for invoking services in the userspace process by QTEE.
 
 The TEE backend driver uses the QTEE Transport Message to communicate
 with QTEE. Interactions through the object INVOKE interface are
 translated into QTEE messages. Likewise, object invocations from QTEE
 for userspace objects are converted into SEND/RECV ioctl calls to
 supplicants.
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEE0qerISgy2SKkqO79Wr/6JGat8H4FAmjIS8AaHGplbnMud2lr
 bGFuZGVyQGxpbmFyby5vcmcACgkQWr/6JGat8H4Wzg/+KnIx5XCYpj1QmL2H8vz5
 dkqB5+QEHfaUIKxUrbk7X/Gow7ZTO8IuDPaiWPSIaGhOosio7fr9J6SdGWySSvBw
 qXazPLgRP7tvhhUA8H1zGO6J9GSGIGENtzRyeK9QzglmkBQcoK9fLRH7StGiwFdP
 f3NKPIx3YZKKL5+I4Xe8J0jvLZmiJW59cSj7m1sfDbPobuLLEKff4VFd4NSv8ufc
 JKpxlxwa3xCtpjNsDJFNlpRwtO0YvF10V3xlDtRGZQs7Gq/dbOA48koA0EqZtTc9
 Yhigl+F4gjleQcrpVT2QM7qJt8fdmuR77FI67YQCmr1cqY1pT/gT3l3Fri0Ok3XU
 Yl+EBI32QLFTjJeGvoEehaEhhpJsWJaLDNDgOV9gDJfZoJK3UgYVjUFwWlVF8Xju
 6iplkDBGpexogjDXoBo8vZEP+/EGwr+cGhWvokLymZCe8R8tfmbA4KkU1mhxo3ma
 eHleGKKghC78xQzUc7gwt0pVJm4FY+uoCzbdV/S/i5j5Kn6l4un5lkUOzXH6D7lj
 HBLExWqL8nxc7mC0Zxtvcd58FiVbLgjEmgMQEGOTliuO8/BXxKU1OJeyNGd4D9vz
 8F2vwBSgyCcrpkx1MmDC2NxYPzUOQ58ct6z07UxlpUCcBgCXlnrRBMjX1k8CwJpn
 BkiizW+aj53HRTQlWlBZLp0=
 =+Jqo
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmjTDEkACgkQmmx57+YA
 GNk5ww//TTwhmt8/XMNbozvUHYvz2/BsJJ9jVlFZUp9nuf7nVkDESGiNAvj439Fy
 xSwnFKjplRxDwLWixsi92QSF60VfhTm3pQ7ggsga/5IoHr+R2l0L2aMzkZUl4jKX
 y6pCg9A/FE1D87AfOh4dzuagddkwzOf1CEcJlE95t7NH9uome3QdsIzmc7/yg/MV
 01xq+30YaSRNbGxiQkmIqChU8bJBFqaH+ygPWZVyAX0gzk9nQHhzNgvbsi8v0Otv
 iFNO3/VF7uzsv2Q8Qx0unIBq6kJIxhHC3K3M1TXHJKRtax8N/8M6UVVkdfshes5+
 reg0CIsOEQ9FqevyabEkirtiwvCF61knmhkKJjCnysd+18PCzLjxnNEVtY+tUomH
 sFI++U5MLuybfCAx4jqjW9dEUrLNiGF8sbJTkQ4ToBjRJR1YihT9aBHeoH7OCKfb
 izS03PlJqDAK7qGH7PTjabi/YmYujizxVrh29CsP3Lk0FfB5m2h2dsX1gr9Z9V5d
 hq0z8nAsh6UJt26Nfq2+hhMaC4AiBn4foc+YaCx/Z8pf9pejzEu/NxRNox05LZem
 EThVNRF1zTtI+0SCHGDAwV3Tuj/uuvrOl9FkcdPbP0kFErsW8b5zwZWIDvzqc2FT
 L39E/C91Ptoe9ZpmCAfnyzKcfI6FeEfXwtMsLcagHsm6pcVbfyc=
 =BBL5
 -----END PGP SIGNATURE-----

Merge tag 'tee-qcomtee-for-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into soc/drivers

Add Qualcomm TEE driver (QTEE)

This introduces a Trusted Execution Environment (TEE) driver for
Qualcomm TEE (QTEE).

QTEE enables Trusted Applications (TAs) and services to run securely. It
uses an object-based interface, where each service is an object with
sets of operations.

Kernel and userspace services are also available to QTEE through a
similar approach. QTEE makes callback requests that are converted into
object invocations. These objects can represent services within the
kernel or userspace process.

We extend the TEE subsystem to understand object parameters and an ioctl
call so client can invoke objects in QTEE:
  - TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_*
  - TEE_IOC_OBJECT_INVOKE

The existing ioctl calls TEE_IOC_SUPPL_RECV and TEE_IOC_SUPPL_SEND are
used for invoking services in the userspace process by QTEE.

The TEE backend driver uses the QTEE Transport Message to communicate
with QTEE. Interactions through the object INVOKE interface are
translated into QTEE messages. Likewise, object invocations from QTEE
for userspace objects are converted into SEND/RECV ioctl calls to
supplicants.

* tag 'tee-qcomtee-for-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
  Documentation: tee: Add Qualcomm TEE driver
  tee: qcom: enable TEE_IOC_SHM_ALLOC ioctl
  tee: qcom: add primordial object
  tee: add Qualcomm TEE driver
  tee: increase TEE_MAX_ARG_SIZE to 4096
  tee: add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF
  tee: add TEE_IOCTL_PARAM_ATTR_TYPE_UBUF
  tee: add close_context to TEE driver operation
  tee: allow a driver to allocate a tee_device without a pool

Link: https://lore.kernel.org/r/20250915174957.GA2040478@rayden
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2025-09-23 23:08:25 +02:00
Jens Wiklander
d5cf5b3706 tee: fix register_shm_helper()
In register_shm_helper(), fix incorrect error handling for a call to
iov_iter_extract_pages(). A case is missing for when
iov_iter_extract_pages() only got some pages and return a number larger
than 0, but not the requested amount.

This fixes a possible NULL pointer dereference following a bad input from
ioctl(TEE_IOC_SHM_REGISTER) where parts of the buffer isn't mapped.

Cc: stable@vger.kernel.org
Reported-by: Masami Ichikawa <masami256@gmail.com>
Closes: https://lore.kernel.org/op-tee/CACOXgS-Bo2W72Nj1_44c7bntyNYOavnTjJAvUbEiQfq=u9W+-g@mail.gmail.com/
Tested-by: Masami Ichikawa <masami256@gmail.com>
Fixes: 7bdee41575 ("tee: Use iov_iter to better support shared buffer registration")
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2025-09-22 08:47:00 +02:00
Dan Carpenter
a9ee2c461e tee: qcom: return -EFAULT instead of -EINVAL if copy_from_user() fails
If copy_from_user() fails, the correct error code is -EFAULT, not
-EINVAL.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2025-09-19 08:46:57 +02:00
Dan Carpenter
b14bb2e782 tee: qcom: prevent potential off by one read
Re-order these checks to check if "i" is a valid array index before using
it.  This prevents a potential off by one read access.

Fixes: d6e290837e ("tee: add Qualcomm TEE driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2025-09-19 08:45:59 +02:00
Amirreza Zarrabi
87ab676d90 tee: qcom: enable TEE_IOC_SHM_ALLOC ioctl
Enable userspace to allocate shared memory with QTEE. Since
QTEE handles shared memory as object, a wrapper is implemented
to represent tee_shm as an object. The shared memory identifier,
obtained through TEE_IOC_SHM_ALLOC, is transferred to the driver using
TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_INPUT/OUTPUT.

Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Tested-by: Harshal Dev <quic_hdev@quicinc.com>
Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2025-09-15 17:34:06 +02:00
Amirreza Zarrabi
0f7bfdcb7c tee: qcom: add primordial object
After booting, the kernel provides a static object known as the
primordial object. This object is utilized by QTEE for native
kernel services such as yield or privileged operations.

Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Harshal Dev <quic_hdev@quicinc.com>
Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2025-09-15 17:34:06 +02:00
Amirreza Zarrabi
d6e290837e tee: add Qualcomm TEE driver
Introduce qcomtee_object, which represents an object in both QTEE and
the kernel. QTEE clients can invoke an instance of qcomtee_object to
access QTEE services. If this invocation produces a new object in QTEE,
an instance of qcomtee_object will be returned.

Similarly, QTEE can request services from by issuing a callback
request, which invokes an instance of qcomtee_object.

Implement initial support for exporting qcomtee_object to userspace
and QTEE, enabling the invocation of objects hosted in QTEE and userspace
through the TEE subsystem.

Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Harshal Dev <quic_hdev@quicinc.com>
Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2025-09-15 17:34:06 +02:00
Amirreza Zarrabi
d5b8b0fa17 tee: add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF
The TEE subsystem allows session-based access to trusted services,
requiring a session to be established to receive a service. This
is not suitable for an environment that represents services as objects.
An object supports various operations that a client can invoke,
potentially generating a result or a new object that can be invoked
independently of the original object.

Add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_INPUT/OUTPUT/INOUT to represent an
object. Objects may reside in either TEE or userspace. To invoke an
object in TEE, introduce a new ioctl. Use the existing SUPPL_RECV and
SUPPL_SEND to invoke an object in userspace.

Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Harshal Dev <quic_hdev@quicinc.com>
Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2025-09-15 17:34:06 +02:00
Amirreza Zarrabi
54a53e95a9 tee: add TEE_IOCTL_PARAM_ATTR_TYPE_UBUF
For drivers that can transfer data to the TEE without using shared
memory from client, it is necessary to receive the user address
directly, bypassing any processing by the TEE subsystem. Introduce
TEE_IOCTL_PARAM_ATTR_TYPE_UBUF_INPUT/OUTPUT/INOUT to represent
userspace buffers.

Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Harshal Dev <quic_hdev@quicinc.com>
Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2025-09-15 17:34:06 +02:00