• Sean Christopherson's avatar
    KVM: nVMX: split pieces of prepare_vmcs02() to prepare_vmcs02_early() · 09abe320
    Sean Christopherson authored
    Add prepare_vmcs02_early() and move pieces of prepare_vmcs02() to the
    new function.  prepare_vmcs02_early() writes the bits of vmcs02 that
    a) must be in place to pass the VMFail consistency checks (assuming
    vmcs12 is valid) and b) are needed recover from a VMExit, e.g. host
    state that is loaded on VMExit.  Splitting the functionality will
    enable KVM to leverage hardware to do VMFail consistency checks via
    a dry run of VMEnter and recover from a potential VMExit without
    having to fully initialize vmcs02.
    
    Add prepare_vmcs02_constant_state() to handle writing vmcs02 state that
    comes from vmcs01 and never changes, i.e. we don't need to rewrite any
    of the vmcs02 that is effectively constant once defined.
    Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
    Reviewed-by: default avatarJim Mattson <jmattson@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    09abe320
vmx.c 409 KB