Re: [PATCH] SVM: forbid guest to execute monitor/mwait

Avi Kivity
2007-03-22T12:01:18Z

Joerg Roedel wrote:
> On Thu, Mar 22, 2007 at 01:40:26PM +0200, Avi Kivity wrote:
>
>> Joerg Roedel wrote:
>>
>>> Right. But it is possible for userspace to enable monitor bit for the
>>> guest. Without virtualization of these 2 instructions the guest would
>>> idle in the guest state after calling mwait and prevent other processes
>>> and guests from running in that time.
>>>
>> Won't an interrupt during mwait cause a vmexit?
>>
>
> Yes, an interrupt would cause an vmexit. But depending on the HZ value
> of the host it may be a lot of time until the next interrupt. And over
> time this will sum up and slow down other tasks.
>

Well, a guest can cause exactly the same effect with

cli
spin:
jmp spin

without executing any instructions that are not reported by cpuid.

--
error compiling committee.c: too many arguments to function