u-boot/arch/arm
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
..
cpu arm64: explicitly disable pointer authentication instructions 2022-08-20 18:12:37 -04:00
dts Restore pcm051_rev3_defconfig config 2022-08-20 16:40:14 -04:00
include Convert CONFIG_SYS_FSL_QMAN_V3 et al to Kconfig 2022-08-12 16:10:49 -04:00
lib ARM: relocate: Fix Thumb code by using proper label type 2022-07-26 17:53:43 -04:00
mach-apple arm: apple: Add initial Apple M2 support 2022-07-25 09:38:47 -04:00
mach-aspeed aspeed/spl: Remove OVERLAY from linker script 2022-07-06 14:32:00 -04:00
mach-at91 arm: Remove snapper9260 board 2022-08-12 16:10:50 -04:00
mach-bcm283x
mach-bcmbca arm: bcmbca: introduce the bcmbca architecture and 47622 SOC 2022-06-10 13:37:32 -04:00
mach-bcmstb
mach-cortina
mach-davinci arm: Remove unused references to CONFIG_SOC_DM* 2022-07-25 14:57:27 -04:00
mach-exynos arm: samsung: Migrate a number of symbols to Kconfig 2022-06-28 17:04:37 -04:00
mach-highbank
mach-hpe ARM: hpe: gxp: add core support 2022-06-22 21:30:04 -04:00
mach-imx common: Drop display_options.h from common header 2022-08-10 13:46:55 -04:00
mach-integrator arm: integrator: Migrate platform-specific options and cleanup armcoremodule.h 2022-04-08 09:05:19 -04:00
mach-ipq40xx
mach-k3 arm: mach-k3: security: Remove certificate if detected on GP device 2022-08-04 15:32:20 -04:00
mach-keystone i2c: Remove non-DM_I2C support from davinci_i2c.c 2022-07-08 17:57:34 -04:00
mach-kirkwood Convert CONFIG_KIRKWOOD_PCIE_INIT et al to Kconfig 2022-07-05 17:05:00 -04:00
mach-lpc32xx
mach-mediatek
mach-meson ARM: meson: fixup error on efuse commands return 2022-08-08 09:56:38 +02:00
mach-mvebu arm: mvebu: spl: Always fallback to BootROM boot method 2022-08-09 08:57:23 +02:00
mach-nexell video: Drop references to CONFIG_VIDEO et al 2022-03-28 20:17:07 +02:00
mach-npcm arm: nuvoton: Add support for Nuvoton NPCM750 BMC 2022-05-05 09:28:47 -04:00
mach-octeontx
mach-octeontx2
mach-omap2 Nokia RX-51: Move board required options from defconfig to Kconfig 2022-08-20 16:18:40 -04:00
mach-orion5x linker_lists: Rename sections to remove . prefix 2022-06-23 12:58:18 -04:00
mach-owl
mach-qemu
mach-rmobile Migrate CUSTOM_SYS_INIT_SP_ADDR to Kconfig using system-constants.h 2022-06-06 12:09:19 -04:00
mach-rockchip Merge branch 'next' 2022-07-11 14:58:57 -04:00
mach-s5pc1xx
mach-snapdragon board: qualcomm: Add support for QCS404 EVB 2022-07-25 13:02:04 -04:00
mach-socfpga socfpga: arria10: Allow dcache_enable before relocation 2022-07-01 14:57:15 +08:00
mach-sti stm32mp1: fix reference for STMicroelectronics 2022-06-17 14:12:27 +02:00
mach-stm32 configs: stm32f746-disco: Migrate SPL flags to defconfig 2022-05-10 13:56:12 +02:00
mach-stm32mp stm32mp: add support of STM32MP13x Rev.Y 2022-07-12 11:47:34 +02:00
mach-sunxi sunxi: Move INITIAL_USB_SCAN_DELAY to driver Kconfig 2022-07-18 23:48:09 +01:00
mach-tegra Convert CONFIG_TEGRA_GPU to Kconfig 2022-06-28 17:03:31 -04:00
mach-u8500
mach-uniphier serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
mach-versal spi: cadence_qspi: Enable apb linear mode for apb read & write operations 2022-06-29 16:00:31 +02:00
mach-versatile
mach-zynq fpga: xilinx: add bitstream flags to driver desc 2022-07-26 09:34:21 +02:00
mach-zynqmp mailbox: zynqmp: Move struct zynqmp_ipi_msg from sys_proto.h 2022-07-26 08:36:20 +02:00
mach-zynqmp-r5
thumb1/include/asm/proc-armv
config.mk linker_lists: Rename sections to remove . prefix 2022-06-23 12:58:18 -04:00
Kconfig arm: Set default MACH_TYPE in Kconfig 2022-08-20 16:17:50 -04:00
Kconfig.debug
Makefile arm: makefile: cleanup mach-imx usage 2022-07-26 11:29:00 +02:00