3.2.5 Stack Pointer selection
Stack Pointer behavior depends on the Execution state, as follows:
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_EL
x Stack Pointer
x is the Exception level.
Software executing in the target Exception level can execute
MSR SPSel, #Imm1 instruction to select
whether to use the default SP_EL
x Stack Pointer or
the SP_EL0 Stack Pointer.
The selected Stack Pointer can be indicated by a suffix to
the Exception level:
Indicates use of the SP0 Stack Pointer.
|h||Indicates use of the SP
NoteThe 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
||AArch64 Stack Pointer options
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.