Re: _fpstate_fxsave & al

Ulrich Drepper (drepper@redhat.com)
06 Jun 2000 00:10:39 -0700


Gareth Hughes <gareth@precisioninsight.com> writes:

> The csseg field will be filled in with a non-zero value by a pre-2.4
> kernel, and thus will be incorrectly interpreted as a FXSAVE FPU format
> and you'll get a segfault.

I said csseg should contain zero if fxsave is used. Zero is no
correct value in any previous kernel.

> Reversing the convention (ie. using zero to indicate the FXSAVE
> format), won't help as the entire FPU context, be it the regular
> FSAVE or new FXSAVE format, is used to restore the task's hardware
> environment when the signal handler returns. You really don't want
> to be messing with the internal fields.

You haven't taken into account that I said the fxsave structure should
be appended to the fsave structure. You can have all the context
information in the fxsave part. The kernel would use something like

if (ctx->csseg == 0)
use fxrestor on the fxsave struct
else
use frestor on the fsave struct

struct fxsave and struct fsave do not overlap.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/