Re: [PATCH] kvm-vmx: add module parameter to avoid trapping HLT instructions (v2)

Avi Kivity
2010-12-06T14:01:36Z

On 12/06/2010 03:58 PM, Anthony Liguori wrote:
> On 12/06/2010 02:35 AM, Avi Kivity wrote:
>> On 12/06/2010 10:28 AM, Avi Kivity wrote:
>>>> I wasn't sure about this. Don't you want EIP to point to the
>>>> beginning of the instruction such that the exception will cause the
>>>> instruction to restart?
>>>
>>>
>>> An interrupt causes the HLT to complete execution. APF completion
>>> counts as an interrupt in this case.
>>>
>>
>> btw, it's possible a VMEXIT during HLT returns RIP already advanced
>> past the HLT instruction. Please check if this is the case.
>
> It's not just possible, it appears to be exactly what happens.
>
> I guess it makes sense that RIP gets advanced before HLT begins to wait.
>

It does. Good, it simplifies the patch.

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