In EL0, the Stack Pointer (SP)
maps to the SP_EL0 Stack Pointer register.
Taking an exception selects the default Stack Pointer for
the target Exception level, meaning SP maps to the SP_ELx
Stack Pointer
register, where x
is the Exception level.
Software executing in the target Exception level can execute
an MSR SPSel, #Imm1
instruction to select
whether to use the default SP_ELx
Stack Pointer or
the SP_EL0 Stack Pointer.
The selected Stack Pointer can be indicated by a suffix to
the Exception level:
t |
Indicates use of the SP0 Stack Pointer.
|
h | Indicates use of the SPx
Stack Pointer. |
Note
The t and h suffixes are based on the terminology of thread and
handler, introduced in ARMv7-M.
The following table shows the set
of AArch64 Stack Pointer options.
Table 3-1 AArch64 Stack Pointer options
Exception level |
AArch64 Stack Pointer options |
EL0 |
EL0t |
EL1 |
EL1t, EL1h |
EL2 |
EL2t, EL2h |
EL3 |
EL3t, EL3h |
In AArch32 state, each mode that can be the target
of an exception has its own Banked copy of the Stack Pointer. For
example, the Banked Stack Pointer for Hyp mode is called SP_hyp.
Software executing in one of these modes uses the Banked Stack Pointer
for that mode.
The modes that have Banked copies of the Stack Pointer are
FIQ mode, IRQ mode, Supervisor mode, Abort mode, Undefined mode,
Hyp mode, and Monitor mode. Software executing in User mode or System
mode uses the User mode Stack Pointer, SP_usr.