This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

is there CPS instruction alternatives to jump from EL1 to EL0 at boot time?

Hello,

I would like to switch from EL1 to EL0 and update my PC in one instruction because I would like to prevent code execution in EL0 mode in my supervisor memory zone.

In order to do that I would like to use ERET instruction or to pop CPSR from stack at boot time instead of using CPS instruction.

I didn't find in the documentation a specific reason to not use ERET at boot time but when I am using it (or when i amp poping cpsr from stack "pop pc^") the behavior is erroneous.

  1. Can someone explain that?
  2. Is there a way  to update PC and CPSR in one instruction at boot time (without erroneous behavior)?

Thanks by advance,

Kevin

Parents
  • Good morning,

    First of all, thank you for you answer.

    RFE gives the same result as eret (or movs pc,lr) at boot time (I tried it yesterday).

    It is really strange because I do these operations (changing spsr during exception handler) after booting and they work as as expected. They behave badly only at boot time. The CPSR and pc are correct after the call to eret/rfe/pop/movs but processor has unpredictible behavior. The only way i found to go to user mode by loading CPSR and pc in one instruction at boot time  is to trigger an exception (by doing an hvc for example) and return from it.

Reply
  • Good morning,

    First of all, thank you for you answer.

    RFE gives the same result as eret (or movs pc,lr) at boot time (I tried it yesterday).

    It is really strange because I do these operations (changing spsr during exception handler) after booting and they work as as expected. They behave badly only at boot time. The CPSR and pc are correct after the call to eret/rfe/pop/movs but processor has unpredictible behavior. The only way i found to go to user mode by loading CPSR and pc in one instruction at boot time  is to trigger an exception (by doing an hvc for example) and return from it.

Children