hw/arm/boot.c: Set NSACR.{CP11,CP10} for NS kernel boots
commitece628fcf69cbbd4b3efb6fbd203af07609467a2
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 20 Sep 2019 17:40:39 +0000 (20 18:40 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 27 Sep 2019 10:41:32 +0000 (27 11:41 +0100)
tree475915a5bd3fc4443437c8259f1e819ecabc45f7
parent83704ceff1b81b750f50464643084aa7cc5608fb
hw/arm/boot.c: Set NSACR.{CP11,CP10} for NS kernel boots

If we're booting a Linux kernel directly into Non-Secure
state on a CPU which has Secure state, then make sure we
set the NSACR CP11 and CP10 bits, so that Non-Secure is allowed
to access the FPU. Otherwise an AArch32 kernel will UNDEF as
soon as it tries to use the FPU.

It used to not matter that we didn't do this until commit
fc1120a7f5f2d4b6, where we implemented actually honouring
these NSACR bits.

The problem only exists for CPUs where EL3 is AArch32; the
equivalent AArch64 trap bits are in CPTR_EL3 and are "0 to
not trap, 1 to trap", so the reset value of the register
permits NS access, unlike NSACR.

Fixes: fc1120a7f5
Fixes: https://bugs.launchpad.net/qemu/+bug/1844597
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190920174039.3916-1-peter.maydell@linaro.org
hw/arm/boot.c