简体   繁体   中英

How to ERET to the same exception level in ARMv8?

It is known how to return from exception level to the previous exception level (set elr_el3 -> set spsr_el3 -> execute eret), but how to ERET from EL3 to the same EL3? In official documentation from ARM I've found the sentence which says that it is possible: "Returning from an exception can stay at the same Exception level or enter a lower Exception level. It cannot move to a higher Exception level.".

The ERET instruction can be used to return to the same or any lower exception level that the CPU supports. If the saved mode fields stored in SPSR_EL3.M[4:0] are set to 0b01101 or 0b01100 , where bits M[3:2] encode an exception level of 3, then an ERET instruction executed at EL3 will return to EL3.

See section "D1.6.4 Saved Program Status Registers (SPSRs)" in the ARM Architecture Reference Manual -- ARMv8, for ARMv8-A architecture profile for more details on how the SPSR_ELx registers are laid out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM