• Vitaly Kuznetsov's avatar
    KVM: nVMX: optimize prepare_vmcs02{,_full} for Enlightened VMCS case · c4ebd629
    Vitaly Kuznetsov authored
    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: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    c4ebd629
vmx.c 433 KB