summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohann Scott <johann.scott@arm.com>2026-08-18 13:04:31 +0000
committerJohann Scott <johann.scott@arm.com>2026-08-19 10:48:53 +0000
commitedcd6ba663706aab3916ec725a3be18d8cdf783a (patch)
tree0573277b0c0da866ed68e763a45d638775bc0fec /lib
parent41e75c14619471670585bbbbb85df5277910a823 (diff)
downloadarm-trusted-firmware-edcd6ba663706aab3916ec725a3be18d8cdf783a.tar.gz
arm-trusted-firmware-edcd6ba663706aab3916ec725a3be18d8cdf783a.zip
fix(cpufeat): ensure MDCR_FEAT_TRBE_EXC is marked as flipped
The previous FEAT_TRBE_EXC patch mistakenly cleared MDCR_EL3.TRBEE_En and set MDCR_EL3.TRBEE_EL3. The effect of this is that TRBE exceptions are taken at EL3 for management events targeting EL3 only. The intended behaviour is for these bits to be the other way around (set TRBEE_En and clear TRBEE_EL3) - this allows exceptions to be delegated, wherein TRBE exceptions are disabled at EL3 but possibly enabled at EL1 and EL2. Change-Id: I894dd0286916d7ec3d764837da93116196ff847c Signed-off-by: Johann Scott <johann.scott@arm.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/extensions/trbe/trbe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/extensions/trbe/trbe.c b/lib/extensions/trbe/trbe.c
index 195d055b4..6193dd450 100644
--- a/lib/extensions/trbe/trbe.c
+++ b/lib/extensions/trbe/trbe.c
@@ -48,8 +48,8 @@ void trbe_enable_ns(cpu_context_t *ctx)
mdcr_el3_val &= ~(MDCR_NSTBE_BIT);
if (is_feat_trbe_exc_supported()) {
- mdcr_el3_val &= ~MDCR_TRBEE_EN_BIT;
- mdcr_el3_val |= MDCR_TRBEE_EL3_BIT;
+ mdcr_el3_val |= MDCR_TRBEE_EN_BIT;
+ mdcr_el3_val &= ~MDCR_TRBEE_EL3_BIT;
}
write_ctx_reg(state, CTX_MDCR_EL3, mdcr_el3_val);