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

Avi Kivity
2010-12-06T14:33:11Z

On 12/06/2010 04:03 PM, Anthony Liguori wrote:
>> It does. Good, it simplifies the patch.
>
>
> Any ideas if the unit test framework can be used to validate this?
> The behavior makes perfect sense but I wanted an excuse to play around
> with it :-)
>

Not the user space one. The exit we're interested in is external
interrupt, and that one isn't delivered to userspace.

I guess you could have a loop

1: hlt
jmp 1b

and enter it programming a timer to something close, and examine the
vcpu state afterwards. However you don't propagate the VMCS halted
state to the corresponding kvm state, so there's no way to test it. (a
minor bug in your patch)

> Not sure if there's a way to validate VMCS state after a hand crafted
> exit.
>

KVM_GET_REGS and friends.

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