ARM: Prevent the compiler from using NEON registers
authorSamuel Holland <samuel@sholland.org>
Sun, 22 Aug 2021 00:54:02 +0000 (19:54 -0500)
committerTom Rini <trini@konsulko.com>
Thu, 2 Sep 2021 15:19:58 +0000 (11:19 -0400)
commitf43312c974eaeb7301cb2638aa4ab05ed7ca4c44
tree435cb510829dde1f9f7d6c68f68a6f427172f458
parente0bd6f31ce41771964b64dc86dcd976c8bdb116a
ARM: Prevent the compiler from using NEON registers

For ARMv8-A, NEON is standard, so the compiler can use it even when no
special target flags are provided. For example, it can use stores from
NEON registers to zero-initialize large structures. GCC 11 decides to
do this inside the DRAM init code for the Allwinner H6.

However, GCC 11 has a bug where it generates misaligned NEON register
stores even with -mstrict-align. Since the MMU is not enabled this early
in SPL, the misaligned store causes an exception and breaks booting.

Work around this issue by restricting the compiler to using GPRs only,
not vector registers. This prevents any future surprises relating to
NEON use as well.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Andre Przywara <andre.przywara@arm.com>
arch/arm/config.mk