aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorGravatar Sean Christopherson <seanjc@google.com> 2024-02-23 12:42:29 -0800
committerGravatar Sean Christopherson <seanjc@google.com> 2024-04-09 10:20:29 -0700
commit87e8e360a05fd29465691aeac179bcf585600c59 (patch)
treec25f5a7952d14b51a7954d02ffc0f24781951f8f /arch/x86/kvm
parentKVM: SVM: Drop 32-bit "support" from __svm_sev_es_vcpu_run() (diff)
downloadlinux-87e8e360a05fd29465691aeac179bcf585600c59.tar.gz
linux-87e8e360a05fd29465691aeac179bcf585600c59.tar.bz2
linux-87e8e360a05fd29465691aeac179bcf585600c59.zip
KVM: SVM: Clobber RAX instead of RBX when discarding spec_ctrl_intercepted
POP @spec_ctrl_intercepted into RAX instead of RBX when discarding it from the stack so that __svm_sev_es_vcpu_run() doesn't modify any non-volatile registers. __svm_sev_es_vcpu_run() doesn't return a value, and RAX is already are clobbered multiple times in the #VMEXIT path. This will allowing using the host save area to save/restore non-volatile registers in __svm_sev_es_vcpu_run(). Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Link: https://lore.kernel.org/r/20240223204233.3337324-5-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/svm/vmenter.S4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/svm/vmenter.S b/arch/x86/kvm/svm/vmenter.S
index c057866a459b..db94fb6f610a 100644
--- a/arch/x86/kvm/svm/vmenter.S
+++ b/arch/x86/kvm/svm/vmenter.S
@@ -350,8 +350,8 @@ SYM_FUNC_START(__svm_sev_es_vcpu_run)
*/
UNTRAIN_RET_VM
- /* "Pop" @spec_ctrl_intercepted. */
- pop %rbx
+ /* "Pop" and discard @spec_ctrl_intercepted. */
+ pop %rax
pop %rbx