Re: [PATCH 1/2] ARM: v7m: clear CONTROL.FPCA before the boot SVC

From: Vladimir Murzin

Date: Wed Nov 25 2026 - 05:50:49 EST


On 11/25/26 02:58, Brad Hawthorne wrote:
> __v7m_setup writes CONTROL only after the SVC it uses to enter Handler
> mode. If the boot loader ran FP code, CONTROL.FPCA can still be set,
> so the SVC stacks an extended frame, and its EXC_RETURN has FType
> clear. Since commit 72cd4064fcca ("ARM: 8830/1: NOMMU: Toggle only
> bits in EXC_RETURN we are really care of"), that EXC_RETURN is saved in
> exc_ret, which every return to user space uses, so each return expects
> an extended frame that ret_to_user never builds. init then starts with
> a corrupted stack.
>
> Write CONTROL to its reset value, 0, before the SVC. That clears FPCA,
> and also selects the main stack, which the code after the SVC reads.
>

Cannot boot loader do that before passing control to Linux?

Cheers
Vladimir