mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2026-07-04 20:38:41 +00:00
SPE and TRBE are unusual features. They have multi-bit enables whose function is not immediately apparent and disabling them is not straightforward. While attempting to figure this out, the disables were made a mess of. Patchfc7dca72bbegan changing the owning security state of SPE and TRBE. This was first used in patch79c0c7fac0with calls to spe_disable() and trbe_disbale(). However, patch13f4a2525reverted the security state ownership, making the spe_disable() and trbe_disable() redundant and their comments incorrect - the DoS protection is achieved by the psb/tsb barriers on context switch, introduces separately inf80887337and73d98e375. Those patches got the behaviour full circle to what it was infc7dca72bso the disables can be fully removed for clarity. However, the original method for disabling these features is not fully correct - letting the "disabled" state be all zeroes made the features seem enabled for secure world but they would trap. That is not a problem while secure world doesn't use them, but could lead to some confusing debugging in the future. NS and Realm worlds were not affected. This patch fully establishes the pattern for SPE and TRBE's enablement, documents it, and implements it such. The description comments in the features boil down to 2 rules. There is a third rule possible: 3. To enable TRBE/SPE for world X with a dirty buffer: * world X owns the buffer * trapping enabled This is not listed as it would not work correctly with SMCCC_ARCH_FEATURE_AVAILABILITY which relies on trapping to be disabled to report correctly. If that is ever implemented, the SMCCC implementation should be considered too. Change-Id: I5588a3d5fc074c2445470954d8c3b172bec77d43 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>