HomeFreeBSD

arm: Handle VFP exceptions from the kernel

Description

arm: Handle VFP exceptions from the kernel

vfp_bounce() is called when handling an undefined instruction exception,
to see if we need to enable the VFP. Previously it would
unconditionally panic if the exception came from the kernel, which was
simply wrong, and it did not permit lazy initialization of VFP state in
the kernel. However, this functionality can be useful and is supported
by arm's fpu_kern_enter() implementation. Thus, relax assertions and
consume the exception if the thread was in an FPU section.

Based on a patch from Stormshield.

Reviewed by: andrew
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D42971

(cherry picked from commit 03a07de0d5ee7d58069152070c42d55f7ec32b7c)

Details

Provenance
markjAuthored on Dec 11 2023, 2:08 PM
Reviewer
andrew
Differential Revision
D42971: arm: Handle VFP exceptions from the kernel
Parents
rGbc394ad824f5: arm: Fix handling of undefined instructions in kernel mode
Branches
Unknown
Tags
Unknown