KVM: SVM: improve split between svm_prepare_guest_switch and sev_es_prepare_guest_switch
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 25 Jan 2022 16:11:30 +0000 (11:11 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 10 Feb 2022 18:47:12 +0000 (13:47 -0500)
commit068f7ea61895ffc909a387c92a6a8aa8b70dd9dd
tree734f0769aa6c4eb1a8f6cce0c64b4804c0b9ff4d
parent98242dcafe5ec185014f59feb44c70189319841f
KVM: SVM: improve split between svm_prepare_guest_switch and sev_es_prepare_guest_switch

KVM performs the VMSAVE to the host save area for both regular and SEV-ES
guests, so hoist it up to svm_prepare_guest_switch.  And because
sev_es_prepare_guest_switch does not really need to know the details
of struct svm_cpu_data *, just pass it the pointer to the host save area
inside the HSAVE page.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h