KVM to double performances for Windows guest OS

A new patch on the work could drastically improve performances of Windows guest operating systems for KVM hypervisor, included in Linux kernel since version 2.6.20. This is what Anthony Liguori, IBM software engineer and long time Xen hacker, reports in his personal blog:

At this past KVM Forum, Ben Serebin , from AMD, shared an interesting observation. Windows guests only access the TPR with instructions that are at least 5 bytes. The significance of 5 bytes is that that happens to be the size of an absolute call on the x86. This means that you can replace any of the TPR access instructions with an absolute call without the need to do fancy dynamic translation. If you’re very clever about hiding routines within the BIOS (it turns out, Windows always has a valid virtual mapping to the BIOS), you can actually rewrite TPR access instruction to instead be calls to functions, that you provide, that access the TPR in a more efficient way.

Avi Kivity posted an implementation of this to KVM recently. The results are quite dramatic. Windows XP installs are at least twice as fast–perhaps even faster. The very latest Intel processors have a hardware feature that ends up with the same result but the nice thing about a purely software approach is that it will work with older processors.

This code hasn’t made it’s way into a KVM release yet as it needs a bit more testing and clean-up. I suspect we won’t see it in a release for a couple more weeks but once it’s there, you can reenable ACPI in your Windows guests and enjoy good performance…

Read the whole post at the source.