Re: FPU precision & signal handlers (bug?)

Gabriel Paubert
2002-03-08T12:11:59Z

On 8 Mar 2002, Alan Cox wrote:

> > I agree with the second part, but actually what you want is to start with
> > an empty stack. Whether the contents are FP or MMX is irrelevant.
> > Actually the support of applications using MMX did not require any change
> > to the kernel (Intel carefully designed it that way).
>
> Not the case. If you drop into a signal or exception handler and it uses
> FPU while MMX is on it'll get a nasty shock. As it happens Linux already
> did the right thing.

You are in for the same shock if you the FPU is in non MMX mode. Think of
the case when all stack entries are marked valid in the interrupted
process: stack overflow on the first fld.

Or alernatively show me how you could simplify the signal delivery FPU
logic for non MMX processor.

Answer: you can't. I still stand by my statement that MMX is
completely irrelevant and does not add any special case.

> Intel minimised it and did pretty much the best job that could be done for
> it.

Better than this, they made it completely transparent.

Gabriel.