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

Anthony Liguori
2010-12-06T13:58:06Z

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.

Regards,

Anthony Liguori