Re: _fpstate_fxsave & al

Gareth Hughes (gareth@precisioninsight.com)
Mon, 05 Jun 2000 23:31:02 -0600


This is a multi-part message in MIME format.
--------------A44783E47791FFAF6E8F1503
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Okay Ulrich, how about this. The mcontext_t structure already uses a
pointer to the _fpstate struct, which an old kernel/libc/application can
reference as the fsave format without any troubles. This is the reason
I left the original format the same as it was before and added the magic
field after the FPU save union.

If we change the definition of ucontext_t to contain both the mcontext_t
structure and, instead of _libc_fpstate, we inline the
_libc_fpstate_fsave structure, then the size of ucontext_t will not
change and thus will remain binary compatible.

A couple of notes:

- The FPU data may be incorrectly interpreted by old applications that
haven't been updated to recongize the new FXSAVE format, but will not
segfault as ucontext_t hasn't changed size. The FPU data should be
dereferenced from the fpregset_t pointer and not the inlined
__fpregs_mem member.

- Applications that are smart enought to look for the magic field will
be able to correctly determine the FPU save format, and will still not
segfault.

As for munging the data to include both formats in one go, this is
really not nice and makes the signal context setup code rather ugly and
slow, which defeats the overall purpose of a _fast_ FPU save and
restore.

I've included my updated ucontext.h and user.h for you to check out.

-- Gareth
--------------A44783E47791FFAF6E8F1503
Content-Type: application/x-gzip;
name="glibc-2.4.0-headers.tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="glibc-2.4.0-headers.tar.gz"

H4sICBWJPDkAA2dsaWJjLTIuNC4wLWhlYWRlcnMudGFyAO0Za3PaSDJf5V/RVfmQ2GtjMHac
LLmtw7xMrWNTCDbxpVK6QRpAZUnDaiQDe5X77dc9oxcgvFepze5dlVWFEd09Pf2ennZsiyDi
q6gyf/HdnmqtWn3z5vxFFZ/Lre8qIuvnly+ql7XaZa16Xq/Xkf7s/OziBVS/n0j5E8uIhQAv
Zizk0RNG+D38/+lzegQtsViH7mwewevWIdTevbs8pr9v1d93x3CGToJuyDmYYhot0Q7QFXHg
sMgVwTH0A7tyAACjuSth6noc8HvBwgjEFKI5h97tGFpw405CFq4rB5p2C0xrprS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"unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/