HomeFreeBSD

Arch64: Clear VFP state on execve()

Description

Arch64: Clear VFP state on execve()

I noticed that many of the math-related tests were failing on AArch64.
After a lot of debugging, I noticed that the floating point exception flags
were not being reset when starting a new process. This change resets the
VFP inside exec_setregs() to ensure no VFP register state is leaked from
parent processes to children.

This commit also moves the clearing of fpcr that was added in 65618fdda0f27
from fork() to execve() since that makes more sense: fork() can retain
current register values, but execve() should result in a well-defined
clean state.

Reviewed By: andrew
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29060

(cherry picked from commit 953a7d7c61f3b2f5351dfe668510ec782ae282e8)

Details

Provenance
arichardsonAuthored on Mar 9 2021, 7:11 PM
Reviewer
andrew
Differential Revision
D29060: Arch64: Clear VFP state on execve()
Parents
rG4edea0540344: Fix fget_only_user() to return ENOTCAPABLE on a failed capsicum check
Branches
Unknown
Tags
Unknown