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

Avi Kivity
2010-12-06T16:30:37Z

On 12/06/2010 06:21 PM, Anthony Liguori wrote:
>> No, right now we intercept SHUTDOWN (and turn it back, in qemu, into
>> a RESET), and we emulate all the SIPI stuff. We also intercepted HLT
>> so we couldn't get that activity state either.
>
>
> Ok, looks like I need to make this per-VM and use a CAP along with an
> interface to enable it to ensure that userspace to ensure it gets
> saved/restored appropriately. I'll rework it.

Not really, it's not any different from the ordinary intercepted HLT.
Put the halted state where we currently put it (hint: nowhere), and all
is fine.

So we have a minor bug that we don't save/restore HLT state (either
emulated or "real" with your patch), that causes a spurious wakeup after
live migration.

Note for your respin, yield_on_hlt became __read_often again, so please
make it __read_mostly.

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