diff options
author | Soby Mathew <soby.mathew@arm.com> | 2019-07-23 08:55:10 +0000 |
---|---|---|
committer | TrustedFirmware Code Review <review@review.trustedfirmware.org> | 2019-07-23 08:55:10 +0000 |
commit | 1d7dc63ca5e56fcf93210f4cba7c83683372a93c (patch) | |
tree | dcd4fc1ff6d16ea4f239693e98e8bb9897d9cc4c /lib | |
parent | b514ee86c4354a8fae21f853bc8d9c6728543267 (diff) | |
parent | b7e398d64cc4d5bfe279f1a50b7c7e4ea9263534 (diff) |
Merge "Enable MTE support unilaterally for Normal World" into integration
Diffstat (limited to 'lib')
-rw-r--r-- | lib/el3_runtime/aarch64/context_mgmt.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c index 89d7ed68..05ba5ed6 100644 --- a/lib/el3_runtime/aarch64/context_mgmt.c +++ b/lib/el3_runtime/aarch64/context_mgmt.c @@ -12,6 +12,7 @@ #include <arch.h> #include <arch_helpers.h> +#include <arch_features.h> #include <bl31/interrupt_mgmt.h> #include <common/bl_common.h> #include <context.h> @@ -136,6 +137,18 @@ void cm_setup_context(cpu_context_t *ctx, const entry_point_info_t *ep) scr_el3 |= SCR_API_BIT | SCR_APK_BIT; #endif /* !CTX_INCLUDE_PAUTH_REGS */ + unsigned int mte = get_armv8_5_mte_support(); + + /* + * Enable MTE support unilaterally for normal world if the CPU supports + * it. + */ + if (mte != MTE_UNIMPLEMENTED) { + if (security_state == NON_SECURE) { + scr_el3 |= SCR_ATA_BIT; + } + } + #ifdef IMAGE_BL31 /* * SCR_EL3.IRQ, SCR_EL3.FIQ: Enable the physical FIQ and IRQ routing as |