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

From: H. Peter Anvin
Date: Thu May 02 2013 - 23:18:14 EST


On 04/29/2013 07:34 AM, Warlich, Christof wrote:
> Second, only FP state seems to be available through ucontext_t, and I would
> need to clear exceptions for SSE as well.

Not true.

> Can anyone give me some advice on how to I could proceed?

To optimize the common case, if the signal handler doesn't touch the FPU
the state is not reloaded from the signal stack. Therefore you need to
execute an FPU instruction -- pretty much any FPU instruction -- in your
signal handler in order to force the reload.

-hpa

--
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/