It is possible for early initialization functions such as lk_main()
to contain NEON instructions because we don't build the kernel with
-mgeneral-regs-only. As a result we can end up taking an FPU exception
before we are ready to handle it.
We didn't have this problem when starting at a higher exception level
than EL1 because we turned off FPU traps in arm64_elX_to_el1(). But we
neglected to do so when starting at EL1. Fix the problem by moving the
CPACR_EL1 manipulation out of arm64_elX_to_el1() and into arm_reset().
It is possible for early initialization functions such as lk_main() to contain NEON instructions because we don't build the kernel with -mgeneral-regs-only. As a result we can end up taking an FPU exception before we are ready to handle it.
We didn't have this problem when starting at a higher exception level than EL1 because we turned off FPU traps in arm64_elX_to_el1(). But we neglected to do so when starting at EL1. Fix the problem by moving the CPACR_EL1 manipulation out of arm64_elX_to_el1() and into arm_reset().