1 Commits
Author SHA1 Message Date
MoandClaude Fable 5.2 96adac001b fix(libkernel): mark exception handler contexts as XMM-format FPU state
Every context handed to a guest exception handler carried a 512-byte
FXSAVE image but left mc_fpformat and mc_ownedfp at 0. The tree's own
sigreturn rejects a context whose format is not _MC_FPFMT_XMM, so a
handler that resumed through sigreturn of the context it was given got
EINVAL. FreeBSD 11.4's sendsig fills both fields through get_fpcontext.

CallHandler now sets mc_fpformat to _MC_FPFMT_XMM (0x10002) and
mc_ownedfp to _MC_FPOWNED_FPU (0x20001), as getcontext here already
does. The constants move from UserContext.cpp to UserContext.hpp.

Tests check the two fields in raise and fault handlers and resume a
fault handler through sigreturn of its own context. The debt entry for
handler contexts states what is still unmeasured or different.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 02:42:44 -08:00