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

Anthony Liguori
2010-12-03T22:45:35Z

On 12/03/2010 03:36 AM, Avi Kivity wrote:
> On 12/02/2010 10:51 PM, Anthony Liguori wrote:
>>> VCPU in HLT state only allows injection of certain events that
>>> would be delivered on HLT. #PF is not one of them.
>>
>> But you can't inject an exception into a guest while the VMCS is
>> active, can you?
>
> No, but this is irrelevant.
>
>> So the guest takes an exit while in the hlt instruction but that's no
>> different than if the guest has been interrupted because of hlt exiting.
>
> hlt exiting doesn't leave vcpu in the halted state (since hlt has not
> been executed). So currently we never see a vcpu in halted state.

Right, you mean the guest activity state being halt.

My understanding is that it just needs to be cleared on exception
injection. Would could clear it at every vmentry but that would
introduce a vmcs_read() to the fast path which is undesirable.

Regards,

Anthony Liguori