audk/MdePkg/Library/BaseLib/AArch64
Ard Biesheuvel e504b3917e MdePkg/BaseLib AARCH64: Make LongJump() BTI compatible
Currently, the AArch64 implementation of LongJump() avoids using the RET
instruction to perform the jump, even though the target address is held
in the link register X30, as the nature of a long jump implies that the
ordinary return address prediction machinery will not be able to make a
correct prediction.

However, LongJump() is rarely used, and the return stack will be out of
sync in any case, so this optimization has little value in practice, and
given that indirect calls other than function returns require a BTI
landing pad at the call site, this optimization is not compatible with
BTI. So let's just use RET instead.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
2023-03-30 11:05:22 +00:00
..
CpuBreakpoint.S MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
CpuBreakpoint.asm MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DisableInterrupts.S MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DisableInterrupts.asm MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
EnableInterrupts.S MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
EnableInterrupts.asm MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
GetInterruptsState.S MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
GetInterruptsState.asm MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
MemoryFence.S MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
MemoryFence.asm MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SetJumpLongJump.S MdePkg/BaseLib AARCH64: Make LongJump() BTI compatible 2023-03-30 11:05:22 +00:00
SetJumpLongJump.asm MdePkg/BaseLib: Fix invalid memory access in AArch64 SetJump/LongJump 2020-10-13 03:20:49 +00:00
SpeculationBarrier.S MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SpeculationBarrier.asm MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SwitchStack.S MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SwitchStack.asm MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00