• Tom Lendacky's avatar
    KVM: SVM: Provide an updated VMRUN invocation for SEV-ES guests · 16809ecd
    Tom Lendacky authored
    The run sequence is different for an SEV-ES guest compared to a legacy or
    even an SEV guest. The guest vCPU register state of an SEV-ES guest will
    be restored on VMRUN and saved on VMEXIT. There is no need to restore the
    guest registers directly and through VMLOAD before VMRUN and no need to
    save the guest registers directly and through VMSAVE on VMEXIT.
    
    Update the svm_vcpu_run() function to skip register state saving and
    restoring and provide an alternative function for running an SEV-ES guest
    in vmenter.S
    
    Additionally, certain host state is restored across an SEV-ES VMRUN. As
    a result certain register states are not required to be restored upon
    VMEXIT (e.g. FS, GS, etc.), so only do that if the guest is not an SEV-ES
    guest.
    Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
    Message-Id: <fb1c66d32f2194e171b95fc1a8affd6d326e10c1.1607620209.git.thomas.lendacky@amd.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    16809ecd
svm.c 120 KB