]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: optimize prepare_vmcs02{,_full} for Enlightened VMCS case
authorVitaly Kuznetsov <vkuznets@redhat.com>
Tue, 16 Oct 2018 16:50:04 +0000 (18:50 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Oct 2018 22:30:16 +0000 (00:30 +0200)
commita338115872c782ae6b6f30e233996ffc3606db50
treeb13704ca131bec1e1faae6508ecfce83056ec722
parent3aa673c055a83055f51c03a9ef0829be0d0ebaa2
KVM: nVMX: optimize prepare_vmcs02{,_full} for Enlightened VMCS case

When Enlightened VMCS is in use by L1 hypervisor we can avoid vmwriting
VMCS fields which did not change.

Our first goal is to achieve minimal impact on traditional VMCS case so
we're not wrapping each vmwrite() with an if-changed checker. We also can't
utilize static keys as Enlightened VMCS usage is per-guest.

This patch implements the simpliest solution: checking fields in groups.
We skip single vmwrite() statements as doing the check will cost us
something even in non-evmcs case and the win is tiny. Unfortunately, this
makes prepare_vmcs02_full{,_full}() code Enlightened VMCS-dependent (and
a bit ugly).

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c