ARM-software / tf-issues

Issue tracking for the ARM Trusted Firmware project
37 stars 16 forks source link

SCR setting not always done properly #126

Closed lpaatero closed 10 years ago

lpaatero commented 10 years ago

BL31 in bl31_prepare_next_image_entry uses cm_set_el3_eret_context to configure registers. However it does not configure scr to match non-secure RW to 64 bit, in case SP has already been initialized and is 32 bit. Thus non-secure code execution fails.

It seems that whenever cm_set_el3_eret_context is called, both scr SCR_RW_BIT and SCR_NS_BIT should always be configured to match values in SPSR and in security_state. Relying on previous set values seems unnecessary optimization.

It could be better design to make cm_set_el3_eret_context configure those bits correctly always, and perhaps even leave scr parameter out.

athoelke commented 10 years ago

I had an idea that the SCR handling was going to need rework:

lpaatero commented 10 years ago

Your analysis seem very sensible direction to go for me.