KVM: SVM: Save/restore args across SEV-ES VMRUN via host save area
authorSean Christopherson <seanjc@google.com>
Fri, 23 Feb 2024 20:42:31 +0000 (12:42 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 9 Apr 2024 17:21:10 +0000 (10:21 -0700)
commitadac42bf42c1608f23938c03e3ca53fa6c87f337
tree6a6dfc4014ae31c172591d17c50f816cb33bdf7c
parentc92be2fd8edf7b300a758c185fe032fd0257b886
KVM: SVM: Save/restore args across SEV-ES VMRUN via host save area

Use the host save area to preserve volatile registers that are used in
__svm_sev_es_vcpu_run() to access function parameters after #VMEXIT.
Like saving/restoring non-volatile registers, there's no reason not to
take advantage of hardware restoring registers on #VMEXIT, as doing so
shaves a few instructions and the save area is going to be accessed no
matter what.

Converting all register save/restore code to use the host save area also
make it easier to follow the SEV-ES VMRUN flow in its entirety, as
opposed to having a mix of stack-based versus host save area save/restore.

Add a parameter to RESTORE_HOST_SPEC_CTRL_BODY so that the SEV-ES path
doesn't need to write @spec_ctrl_intercepted to memory just to play nice
with the common macro.

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20240223204233.3337324-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/vmenter.S