Enable hyper-v enlightenment features for windows VMs
Submitted by Cole Robinson
Link to original bug (#732811)
Description
hyper-v enlightenments are paravirt optimizations that Windows VMs will use when they detect they are running on hyper-v. These bits add performance improvements Some of these optimizations can also be turned on with KVM. Some more info:
http://www.linux-kvm.org/wiki/images/0/0a/2012-forum-kvm_hyperv.pdf
After some off-list discussion with the KVM devs, here's the recommended configuration. Suggest to enable it for Windows VMs only. All Windows VMs is easiest and should be safe, but the only versions which start to support these bits are Vista+ and Server 2008+
The recommended qemu configuration is:
-cpu ...,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time
Which maps to the libvirt XML:
<features>
<hyperv>
</hyperv>
<clock ...>
</clock>
Though there are some version caveats here:
- relaxed state='on' libvirt 1.0.0+, qemu 1.1+
- vapic, spinlocks requires libvirt 1.1.0+, qemu 1.1+
- hypervclock requires libvirt 1.2.2+, qemu 2.0.0+
AFAIK it should be safe to mix the hypervclock setting the other recommended timer settings (mentioned at https://bugzilla.redhat.com/show_bug.cgi?id=1053846 )