Updates to FXSR/SSE support in 2.4.0-test1

From: Gareth Hughes (gareth@precisioninsight.com)
Date: Sat Jun 10 2000 - 09:37:17 EST


I've finished updating the core kernel stuff, so that we have both
binary and source-code compatibility with glibc 2.1.3 and GDB 5.0.
Ulrich, I will send you the glibc header changes (ucontext.h, user.h and
ptrace.h), but here's what the signal context looks like:

struct _fpstate {
        /* Regular FPU environment */
        unsigned long cw;
        unsigned long sw;
        unsigned long tag;
        unsigned long ipoff;
        unsigned long cssel;
        unsigned long dataoff;
        unsigned long datasel;
        struct _fpreg _st[8];
        unsigned short status;
        unsigned short magic; /* 0xffff = regular FPU data only */

        /* FXSR FPU environment */
        unsigned long _fxsr_env[6]; /* FXSR FPU env is ignored */
        unsigned long mxcsr;
        unsigned long reserved;
        struct _fpxreg _fxsr_st[8]; /* FXSR FPU reg data is ignored */
        struct _xmmreg _xmm[8];
        unsigned long padding[56];
};

The FXSR floating point environment and register data is copied into the
regular FPU struct, and copied back from the regular FPU struct on
completion of the signal handler. Thus, any changes to the FXSR
floating point (non-SSE) data must be ignored to allow current signal
handlers to continue working. I hope everyone agrees this is the sanest
way to handle the backward compatibility issue here.

I've got a test program that installs a SIGFPE handler and checks the
FPU state. It runs correctly on 2.2.14, 2.3.99-pre9 and my updated
2.4.0-test1 kernels after being compiled with the above sigcontext
struct. I will forward it with my updated kernel patch and glibc
headers.

Sorry for the delays, there is just a slight problem with the GDB 5.0
ptrace options that I'm working out. However, GDB 5.0 and glibc 2.1.3
now compile straight out of the box with my changes, and binary
compatibility has been maintained in all cases (as far as I can tell).

Thanks again for your input and suggestions.

-- 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 : Thu Jun 15 2000 - 21:00:20 EST