push %r13
push %r12
push %rbx
push %r13
push %r12
push %rbx
/* Free RDI and RSI to be used as TDVMCALL arguments */
movq %rdi, %rax
/* Free RDI and RSI to be used as TDVMCALL arguments */
movq %rdi, %rax
/* Copy hypercall registers from arg struct: */
movq TDX_HYPERCALL_r8(%rax), %r8
/* Copy hypercall registers from arg struct: */
movq TDX_HYPERCALL_r8(%rax), %r8
* HLT operation indefinitely. Since this is the not the desired
* result, conditionally call STI before TDCALL.
*/
* HLT operation indefinitely. Since this is the not the desired
* result, conditionally call STI before TDCALL.
*/
- testq $TDX_HCALL_ISSUE_STI, %rbp
+ testq $TDX_HCALL_ISSUE_STI, 8(%rsp)
jz .Lskip_sti
sti
.Lskip_sti:
jz .Lskip_sti
sti
.Lskip_sti:
pop %rax
/* Copy hypercall result registers to arg struct if needed */
pop %rax
/* Copy hypercall result registers to arg struct if needed */
- testq $TDX_HCALL_HAS_OUTPUT, %rbp
+ testq $TDX_HCALL_HAS_OUTPUT, (%rsp)
jz .Lout
movq %r8, TDX_HYPERCALL_r8(%rax)
jz .Lout
movq %r8, TDX_HYPERCALL_r8(%rax)
xor %r10d, %r10d
xor %r11d, %r11d
xor %rdi, %rdi
xor %r10d, %r10d
xor %r11d, %r11d
xor %rdi, %rdi
+ /* Remove TDX_HCALL_* flags from the stack */
+ pop %rsi
+
/* Restore callee-saved GPRs as mandated by the x86_64 ABI */
/* Restore callee-saved GPRs as mandated by the x86_64 ABI */
pop %rbx
pop %r12
pop %r13
pop %rbx
pop %r12
pop %r13