Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(STM32) drivers: stm32_risab: add RISAB reconfiguration #7252

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

GseoC
Copy link
Contributor

@GseoC GseoC commented Jan 30, 2025

Similarly to RISAF, update the driver to allow dynamic firewall reconfiguration.

@GseoC
Copy link
Contributor Author

GseoC commented Jan 30, 2025

Checkpatch fails are targeting traces, so false positives.

@GseoC GseoC changed the title (STM32) drivers: stm32_risab: ass RISAB reconfiguration (STM32) drivers: stm32_risab: add RISAB reconfiguration Jan 30, 2025
Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For commit "drivers: stm32_risab: rework regs_access_granted()": since it's fixing something, I think it deserves a Fixes tag:
Fixes: c413678c6ca6 ("drivers: stm32_risab: add RISAB internal memory firewall driver")

core/drivers/firewall/stm32_risab.c Outdated Show resolved Hide resolved

if (!IS_ALIGNED(paddr, _RISAB_PAGE_SIZE) ||
!IS_ALIGNED(size, _RISAB_PAGE_SIZE)) {
EMSG("Physical ddress %"PRIxPA" or size:%#zx misaligned with RISAB page boundaries",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/ddress/address/
Maybe shorten the message to "Unaligned region: pa %#"PRIxPA" size %zu".
Note that EMSG() already prints the function label, here explicitly referring to RISAB.

core/drivers/firewall/stm32_risab.c Outdated Show resolved Hide resolved
core/drivers/firewall/stm32_risab.c Show resolved Hide resolved
@GseoC
Copy link
Contributor Author

GseoC commented Feb 6, 2025

Comments addressed

@GseoC
Copy link
Contributor Author

GseoC commented Feb 6, 2025

Last comment addressed

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acked-by: Etienne Carriere <[email protected]>

GseoC added 2 commits February 7, 2025 09:31
Rework regs_access_granted() to always authorize access to RISAB1/2
that can only be accessed by the Cortex-A35.

Also fix the sequence by isolating the case where the CID filtering is
not enabled.

Fixes: c413678 ("drivers: stm32_risab: add RISAB internal memory firewall driver")
Signed-off-by: Gatien Chevallier <[email protected]>
Acked-by: Etienne Carriere <[email protected]>
Add the .set_memory_conf ops to be able to reconfigure memory regions
protected by RISABs dynamically.

Factorize the RIF configuration application.

Signed-off-by: Gatien Chevallier <[email protected]>
Acked-by: Etienne Carriere <[email protected]>
@GseoC
Copy link
Contributor Author

GseoC commented Feb 7, 2025

Tags applied, thanks.

Checkpatch error is related to a trace.

@jforissier jforissier merged commit 8d8a3cb into OP-TEE:master Feb 7, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants