From: "R. Armiento" <reply-2006@armiento.net>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] add 'monitor' and 'mwait' instruction (update)
Date: Sat, 08 Jul 2006 22:50:11 +0200 [thread overview]
Message-ID: <44B01A83.3060501@armiento.net> (raw)
In-Reply-To: <DD6CBFCF-E2D6-4D30-8AAC-F0FDE8F97455@gmx.de>
Hi,
Again, thank you for helping out with updated patches, it is much
appreciated.
Joachim Henke wrote:
> R. Armiento wrote:
>> So even with your patch applied one should use the 'idle=halt'
>> kernel parameter when booting Linux with -kernel-kqemu on newer
>> processors. [...]
> To lower the cpu usage, you can additionally apply the attached
> patch, which makes 'mwait' similar to 'hlt'. This ugly hack seems to
> be sufficient at least for Linux.
Is this hack really 'safe'? I don't claim to know much about modern x86
instructions, but some googling tells me that mwait is supposed to wake
on a monitored memory write (but is allowed to wake up earlier, hence it
is acceptable but CPU consuming to emulate it with a nop). Couldn't
there be situations where someone depends on mwait waking up without
there being an event that wakes hlt? Or are we sure qemu's hlt will
happen to wake up anyway?
> Yes, the emulation should be done in a cleaner way. But to me it seems
> impossible to do real mwait emulation in user space.
Again, excuse my lack of knowledge of the internals of qemu and kqemu.
If 'hlt' can be emulated to give CPU time back to the host OS until an
interrupt occurs in the guest; then it is not obvious why mwait couldn't
be simulated in a similar way, only with the addition that qemu also
restarts guest CPU execution should there be writes in monitored memory.
While I have no idea of how much work it would be, it would much
surprise me if this is truly un-doable, at least for non-kqemu emulation.
Rickard
next prev parent reply other threads:[~2006-07-08 18:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-06 15:13 [Qemu-devel] Pentium D with guest Ubuntu 6.06 server kernel panic with kqemu R. Armiento
2006-07-07 9:06 ` Joachim Henke
2006-07-07 9:39 ` Jens Axboe
2006-07-07 13:39 ` R. Armiento
2006-07-07 12:30 ` [Qemu-devel] [PATCH] add 'monitor' and 'mwait' instruction Joachim Henke
2006-07-07 12:57 ` maestro
2006-07-07 13:22 ` Joachim Henke
2006-07-07 15:21 ` Joachim Henke
2006-07-07 13:18 ` [Qemu-devel] [PATCH] add 'monitor' and 'mwait' instruction (update) Joachim Henke
2006-07-07 13:20 ` Joachim Henke
2006-07-08 13:16 ` R. Armiento
2006-07-08 15:01 ` [Qemu-devel] " Joachim Henke
2006-07-08 20:50 ` R. Armiento [this message]
2006-07-09 8:54 ` Joachim Henke
2006-07-09 13:20 ` R. Armiento
2006-07-09 11:30 ` Paul Brook
2006-07-09 15:25 ` Jamie Lokier
2006-07-09 13:03 ` [Qemu-devel] 'monitor' and 'mwait' instruction Joachim Henke
2006-07-09 15:21 ` [Qemu-devel] add 'monitor' and 'mwait' instruction (update) Jamie Lokier
2006-07-09 15:11 ` Jamie Lokier
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=44B01A83.3060501@armiento.net \
--to=reply-2006@armiento.net \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.