qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] add 'monitor' and 'mwait' instruction (update)


From: Joachim Henke
Subject: Re: [Qemu-devel] add 'monitor' and 'mwait' instruction (update)
Date: Sat, 8 Jul 2006 17:01:49 +0200

R. Armiento wrote:
However, as you probably know, despite not declaring MONITOR in qemu, kqemu sees MONITOR on the host processor and Linux CPU usage will still be 100%, even with your updated patch. So even with your patch applied one should use the 'idle=halt' kernel parameter when booting Linux with -kernel-kqemu on newer processors.

Yes, this is obviously true. 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.

While your patch resolves the problem and is great for my setup, I suppose it is problematic. If MONITOR is not declared by qemu then still serving mwait 'correctly' is not faithful emulation (right?). To make sure this does not break anything else, I would guess that either mwait has to be emulated better so that it is ok to let qemu declare MONITOR support; OR as a temporary workaround make the patch only serve mwait if -kernel-kqemu is enabled and host CPUID supports MONITOR.

Yes, the emulation should be done in a cleaner way. But to me it seems impossible to do real mwait emulation in user space. Probably someone else will come up with a better solution. Anyway, your last suggestion looks good.

--
Joachim Henke
http://he-jo.net/

Attachment: mwait_hlt.diff
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]