|Subject:||Re: [Qemu-devel] add 'monitor' and 'mwait' instruction (update)|
|Date:||Sun, 09 Jul 2006 15:20:02 +0200|
|User-agent:||Thunderbird 18.104.22.168 (X11/20060615)|
R. Armiento wrote: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?
Joachim Henke wrote:
Currently the Linux kernel simply uses monitor/mwait as a faster 'hlt' replacement, so it should be "safe" there. I don't know about other guest OSs. Anyway, I proposed this hack only as a quick "solution" for local usage.
I realize the last version of the patch was just a "quick hack" to solve the problem with Linux's idle function. But I just don't see how you can postulate that mwait is not used anywhere else in the Linux kernel? There are many kernel modules; some being closed source. And if an mwait lurks somewhere in your kernel, you might get a really obscure breakage that will be a pain to debug...
Problem is, at the moment I've no idea, how we could achieve this memory monitoring in a safe and simple way in user space.
I'm trying to read up on monitor and mwait. Apparently mwait puts the processor in low-power wait mode, waiting for a memory write in some select area defined by monitor; and as I am new to this I'm not sure if I have understood all sources from where such a memory write can come from while the processor is asleep. One source, I suppose, is from other processors in an SMP setup? Another source may be DMA? Does this mean that it is safe to emulate wmait as hlt if neiter SMP or DMA is used? (Qemu hardware doesn't support DMA, right?)
|[Prev in Thread]||Current Thread||[Next in Thread]|