Re: _fpstate_fxsave & al

From: Gareth Hughes (gareth@precisioninsight.com)
Date: Tue Jun 06 2000 - 00:31:02 EST


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


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



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:24 EST