Re: X86 fpu registers in a signal handler's ucontext

From: Andi Kleen
Date: Mon Apr 29 2013 - 13:57:58 EST


"Warlich, Christof" <christof.warlich@xxxxxxxxxxx> writes:
>
> First, this link:
> http://valgrind.10908.n7.nabble.com/need-FPU-and-SSE-state-in-sigcontext-ucontext-td19844.html
> suggests that unlike the GPRs, the FP registers are _not_ restored after
> returnung from the signal handler.

The FP registers are restored lazily, but the state for this is kept in
the kernel.

One easy way may be to catch the FPU exception too and clear from there?

There can be some complications with different save formats too (XSAVE
vs FXSAVE). So your solution may not be necessarily 100% portable
to all systems.

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/