ERET

Exception return

This instruction restores PSTATE from the SPSR, and branches to the address held in the ELR.

The SPSR is checked for the current Exception level for an illegal return event. See Illegal exception returns from AArch64 state.

ERET is UNDEFINED at EL0.

Encoding: System

313029282726252423222120191817161514131211109876543210
11010110100111110000001111100000
opcop2AMRnop4

ERET

Decoding algorithm

constant boolean pac = FALSE;
constant boolean use_key_a = TRUE;

Operation

if PSTATE.EL == EL0 then UNDEFINED;
AArch64.CheckForERetTrap(pac, use_key_a);
constant bits(64) target = ELR_ELx[];

AArch64.ExceptionReturn(target, SPSR_ELx[]);

Explanations