]> git.baikalelectronics.ru Git - kernel.git/commit
x86/kvm: use Enlightened VMCS when running on Hyper-V
authorVitaly Kuznetsov <vkuznets@redhat.com>
Tue, 20 Mar 2018 14:02:11 +0000 (15:02 +0100)
committerRadim Krčmář <rkrcmar@redhat.com>
Wed, 28 Mar 2018 20:47:06 +0000 (22:47 +0200)
commit95623a961c621f8e6f508cb1542990802a4bf30a
treeaf9af13eab5a5d139eebd716923fc04897606eff
parentced50748a1bdd7f87e792f2eaed57c8f0ea87c8f
x86/kvm: use Enlightened VMCS when running on Hyper-V

Enlightened VMCS is just a structure in memory, the main benefit
besides avoiding somewhat slower VMREAD/VMWRITE is using clean field
mask: we tell the underlying hypervisor which fields were modified
since VMEXIT so there's no need to inspect them all.

Tight CPUID loop test shows significant speedup:
Before: 18890 cycles
After: 8304 cycles

Static key is being used to avoid performance penalty for non-Hyper-V
deployments.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/vmx.c
arch/x86/kvm/vmx_evmcs.h [new file with mode: 0644]