public inbox for linux-msdos@vger.kernel.org
 help / color / mirror / Atom feed
From: Samuel Bronson <naesten@gmail.com>
To: Stas Sergeev <stsp@aknet.ru>
Cc: Bart Oldeman <bartoldeman@users.sourceforge.net>,
	dosemu <linux-msdos@vger.kernel.org>
Subject: Re: freezes when not emulating CPU
Date: Thu, 17 Sep 2009 16:37:10 -0400	[thread overview]
Message-ID: <db65a1cd0909171337r373b038cv638581a6dbb1c4e1@mail.gmail.com> (raw)
In-Reply-To: <4AAE6090.5030603@aknet.ru>

Whoops, sent this to just Stas the first time ... sorry, Stas!

On Mon, Sep 14, 2009 at 11:26 AM, Stas Sergeev <stsp@aknet.ru> wrote:
> Hello.
>
> Bart Oldeman wrote:

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

Well, I believe that's essentially what Intel suggests OSes do on
task-switch -- leave some flag set/cleared that will cause the next FP
operation to give an exception so that it can switch the FP registers
at that time. Whether or not this would be a good idea for DOSEMU
depends on how often you do a vm86 call vs how often the FP registers
are needed, and on how expensive it is to actually enter a state from
which the next FP access will cause a signal compared to just doing
the reload each time.

  reply	other threads:[~2009-09-17 20:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 10:57 freezes when not emulating CPU (was: MIDI input patch) Stas Sergeev
2009-09-14 13:05 ` Bart Oldeman
2009-09-14 15:26   ` freezes when not emulating CPU Stas Sergeev
2009-09-17 20:37     ` Samuel Bronson [this message]
2009-09-17 21:05       ` Stas Sergeev
2009-09-18 12:49     ` Bart Oldeman
     [not found]       ` <AE6CA625AD924972A78210F20D55D7BC@kofowork>
2009-09-18 15:25         ` Bart Oldeman
2009-09-18 15:47           ` Gert Koefoed Andersen
2009-09-18 17:27           ` Gert Koefoed Andersen
2009-09-14 17:02   ` freezes when not emulating CPU (was: MIDI input patch) Frank Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=db65a1cd0909171337r373b038cv638581a6dbb1c4e1@mail.gmail.com \
    --to=naesten@gmail.com \
    --cc=bartoldeman@users.sourceforge.net \
    --cc=linux-msdos@vger.kernel.org \
    --cc=stsp@aknet.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox