]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: SVM: Create a stack frame in __svm_vcpu_run() for unwinding
authorSean Christopherson <seanjc@google.com>
Fri, 23 Feb 2024 20:42:26 +0000 (12:42 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 9 Apr 2024 17:20:28 +0000 (10:20 -0700)
Unconditionally create a stack frame in __svm_vcpu_run() to play nice with
unwinding via frame pointers, at least until the point where RBP is loaded
with the guest's value.  Don't bother conditioning the code on
CONFIG_FRAME_POINTER=y, as RBP needs to be saved and restored anyways (due
to it being clobbered with the guest's value); omitting the "MOV RSP, RBP"
is not worth the extra #ifdef.

Creating a stack frame will allow removing the OBJECT_FILES_NON_STANDARD
tag from vmenter.S once __svm_sev_es_vcpu_run() is fixed to not stomp all
over RBP for no reason.

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

index 187018c424bfb4ba8cadfa71a0f4ec7d4c63d766..82637abf0b7ea8d90b89c6ab0c91167f0314adde 100644 (file)
@@ -99,6 +99,7 @@
  */
 SYM_FUNC_START(__svm_vcpu_run)
        push %_ASM_BP
+       mov  %_ASM_SP, %_ASM_BP
 #ifdef CONFIG_X86_64
        push %r15
        push %r14