Re: freezes when not emulating CPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

Bart Oldeman wrote:
I've been looking at this. The SIGFPEs don't happen for i386 (default
FP), only for x86-64 or when explicitly compiling with SSE floating
point (using gcc -msse2 -mfpmath=sse).
OK, but the point is that I haven't specified
these flags by hands, so they might be a default
for dosemu right now. So it have to became sse-safe.

The "fnsave" instruction really
re-initializes the FPU (it's documented),
I know it does, but the comment I was referring to,
also says:
---
which is good enough for calling FPU-using routines.
---
and that appeared to be false.

but with SSE one needs to
use "fxsave"
Hmm, why does'n it use fxsave right now?

and "fninit", and that still doesn't reinitialize the
SIMD part. Adding an "ldmxcsr" instruction solved that problem.
I guess this might be a good work-around, at
least till they invent yet another FP technique. :)

I still think that a simple FPU environment reset is sufficient, no
need to restore all the registers, because the DOSEMU FPU code is not
interrupted by DOS code.
What if the DOS code (by some crazy chance) also
uses sse?

The fpu save/restore operations aren't cheap, so perhaps one could
only use them around the sound code instead of for every vm86 call.
Though that could be messy.
Indeed - so what was the problem with fninit/ldmxcsr then?
Looks like it would load only the control/status word, so
that might not be as expensive as the full reload?
Also, I think fxrstor doesn't wait for completion, so
the careful implementation may not be too expensive.
There are also some tricks possible, like, for example, set
FPU to something that will SIGFPE on any FP, and initialize
it properly in a signal handler, but I guess this would
be an overkill.

Also, I found no docs about this FPU
init/reset stuff, so everything in this
patch is just a wild guesses based on
a look into a bochs code.
Have you had a look into that? I only zero out a
few fields, I guess more should be re-set on a
hardware reset (or via port I/O). I even thought
this ought to be entire bzero() except for the few
fields with pre-defined values, but it appears
not, which I don't quite understand... and found
no docs.

write something meaningfull about SIGFPE
instead of "Unknown exception".
I've done that now.
Any idea why I am not receiving the SF e-mails for
a long time now? I thought dosemu is long ago dead,
but instead there might just be some problems with
the notification messages...

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Console]     [Linux Audio]     [Linux for Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Camping]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Samba]     [Linux Media]     [Fedora Users]

  Powered by Linux