Skip to content

Commit 4367a75

Browse files
committed
KVM: SVM: Create a stack frame in __svm_sev_es_vcpu_run()
Now that KVM uses the host save area to context switch RBP, i.e. preserves RBP for the entirety of __svm_sev_es_vcpu_run(), create a stack frame using the standared FRAME_{BEGIN,END} macros. Note, __svm_sev_es_vcpu_run() is subtly not a leaf function as it can call into ibpb_feature() via UNTRAIN_RET_VM. Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Link: https://lore.kernel.org/r/20240223204233.3337324-8-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent adac42b commit 4367a75

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/kvm/svm/vmenter.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <asm/asm.h>
44
#include <asm/asm-offsets.h>
55
#include <asm/bitsperlong.h>
6+
#include <asm/frame.h>
67
#include <asm/kvm_vcpu_regs.h>
78
#include <asm/nospec-branch.h>
89
#include "kvm-asm-offsets.h"
@@ -312,6 +313,8 @@ SYM_FUNC_END(__svm_vcpu_run)
312313
* @spec_ctrl_intercepted: bool
313314
*/
314315
SYM_FUNC_START(__svm_sev_es_vcpu_run)
316+
FRAME_BEGIN
317+
315318
/*
316319
* Save non-volatile (callee-saved) registers to the host save area.
317320
* Except for RAX and RSP, all GPRs are restored on #VMEXIT, but not
@@ -362,6 +365,7 @@ SYM_FUNC_START(__svm_sev_es_vcpu_run)
362365
*/
363366
UNTRAIN_RET_VM
364367

368+
FRAME_END
365369
RET
366370

367371
RESTORE_GUEST_SPEC_CTRL_BODY

0 commit comments

Comments
 (0)