summaryrefslogtreecommitdiff
path: root/lib/el3_runtime
diff options
context:
space:
mode:
authorDimitris Papastamos <dimitris.papastamos@arm.com>2018-05-15 18:40:46 +0100
committerGitHub <noreply@github.com>2018-05-15 18:40:46 +0100
commit10df381100e1428e8036393badb0473ee93465f4 (patch)
treede5eea70a228f18b0fbf39c04f1e7a971d07009b /lib/el3_runtime
parent2f1fbb4f66a351bd5994f883f01e40cd144f48cf (diff)
parent2ab9617ef2fa6f60c59d58f61e2d5c45bf965b1f (diff)
Merge pull request #1376 from vwadekar/cm-init-actlr-el1
lib: el3_runtime: initialise actlr_el1 to hardware defaults
Diffstat (limited to 'lib/el3_runtime')
-rw-r--r--lib/el3_runtime/aarch64/context_mgmt.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c
index 76eecc18..d8267e29 100644
--- a/lib/el3_runtime/aarch64/context_mgmt.c
+++ b/lib/el3_runtime/aarch64/context_mgmt.c
@@ -65,7 +65,7 @@ static void cm_init_context_common(cpu_context_t *ctx, const entry_point_info_t
uint32_t scr_el3, pmcr_el0;
el3_state_t *state;
gp_regs_t *gp_regs;
- unsigned long sctlr_elx;
+ unsigned long sctlr_elx, actlr_elx;
assert(ctx);
@@ -178,6 +178,16 @@ static void cm_init_context_common(cpu_context_t *ctx, const entry_point_info_t
*/
write_ctx_reg(get_sysregs_ctx(ctx), CTX_SCTLR_EL1, sctlr_elx);
+ /*
+ * Base the context ACTLR_EL1 on the current value, as it is
+ * implementation defined. The context restore process will write
+ * the value from the context to the actual register and can cause
+ * problems for processor cores that don't expect certain bits to
+ * be zero.
+ */
+ actlr_elx = read_actlr_el1();
+ write_ctx_reg((get_sysregs_ctx(ctx)), (CTX_ACTLR_EL1), (actlr_elx));
+
if (security_state == SECURE) {
/*
* Initialise PMCR_EL0 for secure context only, setting all