u-boot/arch
Rasmus Villemoes 4b05301979 arm64: explicitly disable pointer authentication instructions
The Yocto project builds their aarch64 cross-compiler with the
configure knob --enable-standard-branch-protection, which means that
their gcc behaves as if -mbranch-protection=standard is passed; the
default (lacking that configure knob) is -mbranch-protection=none.

This means that when building U-Boot using the Yocto toolchain, most
functions end up containing paciasp/autiasp/bti instructions. However,
since U-Boot is not an ordinary userspace application, there's no OS
kernel which has set up the required authentication keys, so these
instructions do nothing at all (even on arm64 hardware that does have
the pointer authentication capability). They do however make the image
larger.

It is theoretically possible for U-Boot to make use of the pointer
authentication protection - cf. the linux kernel's
CONFIG_ARM64_PTR_AUTH_KERNEL - but it is far from trivial, and it's
hard to see just what threat model it would protect against in a
bootloader context. Regardless, we certainly have none of the required
infrastructure now, so explicitly pass -mbranch-protection=none to
ensure those useless instructions do not get emitted.

For a toolchain not configured with
--enable-standard-branch-protection, this changes nothing. For the
Yocto toolchain, this reduces the size of both SPL and U-Boot proper
by about 3% for my imx8mp target.

If you don't have a Yocto toolchain, the effect can easily be
reproduced by applying this patch and changing =none to =standard.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20 18:12:37 -04:00
..
arc arc: Move SYS_LITTLE_ENDIAN / SYS_BIG_ENDIAN selection to Kconfig 2022-08-12 16:10:49 -04:00
arm arm64: explicitly disable pointer authentication instructions 2022-08-20 18:12:37 -04:00
m68k Remove CONFIG_SYS_FSL_SCFG_IODSECR1_ADDR et al 2022-08-12 16:10:49 -04:00
microblaze zynqmp: Run board_get_usable_ram_top() only on main U-Boot 2022-07-26 08:23:54 +02:00
mips mips: mtmips: add two reference boards for mt7621 2022-07-13 23:03:37 +02:00
nios2 linker_lists: Rename sections to remove . prefix 2022-06-23 12:58:18 -04:00
powerpc ppc: Remove ids8313 board 2022-08-12 16:10:50 -04:00
riscv riscv: ae350: Fix XIP config boot failure 2022-08-11 18:46:07 +08:00
sandbox bootstd: Add vbe bootmeth into sandbox 2022-08-12 08:17:11 -04:00
sh sh: Remove unused code in arch/sh/lib/bootm.c 2022-08-04 16:18:47 -04:00
x86 video: Rename structs and functions to avoid VBE 2022-08-12 08:14:23 -04:00
xtensa xtensa: Switch to using CONFIG_XTENSA for building device trees 2022-06-28 17:03:31 -04:00
.gitignore
Kconfig arc: Move SYS_LITTLE_ENDIAN / SYS_BIG_ENDIAN selection to Kconfig 2022-08-12 16:10:49 -04:00
Kconfig.nxp Convert CONFIG_SYS_FSL_NUM_CC_PLLS to Kconfig 2022-08-12 16:10:49 -04:00
u-boot-elf.lds