devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Access controllers: differentiate between access checks and grants?
@ 2025-07-04  9:08 Ahmad Fatoum
  2025-07-04 10:07 ` Oleksii Moisieiev
  0 siblings, 1 reply; 5+ messages in thread
From: Ahmad Fatoum @ 2025-07-04  9:08 UTC (permalink / raw)
  To: devicetree@vger.kernel.org
  Cc: Oleksii Moisieiev, Gatien Chevallier, Rob Herring,
	kernel@pengutronix.de, Laurentiu Mihalcea, Krzysztof Kozlowski,
	Conor Dooley

Hi,

Quoting access-controllers.yaml:

  Access controllers are typically used to set/read the permissions of a
  hardware block and grant access to it.

I am afraid that having the exact same binding for both granting and
checking accesses complicates matters:

  1) Harder to reason about device trees: Does this property actually
     modify hardware state or not?

  2) More difficult migration: If access granting is added initially to
     Linux, but later moved into the secure world. How to reflect in
     the DT that the access controller has become read-only and that the
     driver should not attempt writes?

My suggestion would be adding an `access-checks-only;` or similar
property for access controllers that are read-only.

By setting this property for simple devices like efuses with feature
gates, we address 1) above.

2) is addressed by adding this property to Linux device tree (e.g. via
bootloader fixup) when secure firmware starts to handle a bus controller
itself.

An example where 2) would be relevant is the recent addition to
linux-next of the AIPSTZ[1] bridge for i.MX8MP. The power-on reset
defaults for the bridge preclude the DSP from accessing peripherals in
the bridge and they are lost when shutting down the relevant power
domain, so the driver takes care to apply a permissive access list on
probe and resume.

If we were to move this security setting into the secure world for
actual security benefit and made the controller read-only for normal
world, we will need a way to tell the Linux driver to avoid writing to
the peripheral.

access-checks-only could be that way.

Thoughts?

[1]:
https://lore.kernel.org/all/20250610160152.1113930-1-laurentiumihalcea111@gmail.com/

Thanks,
Ahmad



-- 
Pengutronix e.K.                       |                             |
Steuerwalder Str. 21                   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany              | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686       | Fax:   +49-5121-206917-5555 |


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-07-04 12:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-04  9:08 Access controllers: differentiate between access checks and grants? Ahmad Fatoum
2025-07-04 10:07 ` Oleksii Moisieiev
2025-07-04 10:41   ` Ahmad Fatoum
2025-07-04 12:01     ` Gatien CHEVALLIER
2025-07-04 12:30     ` Oleksii Moisieiev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).