File tree Expand file tree Collapse file tree 2 files changed +20
-12
lines changed Expand file tree Collapse file tree 2 files changed +20
-12
lines changed Original file line number Diff line number Diff line change 78
78
* Return status of TDCALL via RAX.
79
79
*/
80
80
SYM_FUNC_START(__tdx_module_call)
81
- FRAME_BEGIN
82
81
TDX_MODULE_CALL host =0
83
- FRAME_END
84
- RET
85
82
SYM_FUNC_END(__tdx_module_call)
86
83
87
84
/*
Original file line number Diff line number Diff line change 1
1
/* SPDX-License-Identifier: GPL-2.0 */
2
2
#include <asm/asm-offsets.h>
3
+ #include <asm/frame.h>
3
4
#include <asm/tdx.h>
4
5
5
6
/*
18
19
* TDX module.
19
20
*/
20
21
.macro TDX_MODULE_CALL host: req
22
+ FRAME_BEGIN
21
23
/*
22
24
* R12 will be used as temporary storage for struct tdx_module_output
23
25
* pointer. Since R12-R15 registers are not used by TDCALL/SEAMCALL
44
46
mov %rsi , %rcx
45
47
/* Leave input param 2 in RDX */
46
48
47
- .if \host
49
+ .if \host
48
50
seamcall
49
51
/*
50
52
* SEAMCALL instruction is essentially a VMExit from VMX root
57
59
* This value will never be used as actual SEAMCALL error code as
58
60
* it is from the Reserved status code class.
59
61
*/
60
- jnc .Lno_vmfailinvalid
61
- mov $TDX_SEAMCALL_VMFAILINVALID, %rax
62
- .Lno_vmfailinvalid:
63
-
64
- .else
62
+ jc .Lseamcall_vmfailinvalid
63
+ .else
65
64
tdcall
66
- .endif
65
+ .endif
67
66
68
67
/*
69
68
* Fetch output pointer from stack to R12 (It is used
80
79
* Other registers may contain details of the failure.
81
80
*/
82
81
test %r12 , %r12
83
- jz .Lno_output_struct
82
+ jz .Lout
84
83
85
84
/* Copy result registers to output struct: */
86
85
movq %rcx , TDX_MODULE_rcx(%r12 )
90
89
movq %r10 , TDX_MODULE_r10(%r12 )
91
90
movq %r11 , TDX_MODULE_r11(%r12 )
92
91
93
- .Lno_output_struct :
92
+ .Lout :
94
93
/* Restore the state of R12 register */
95
94
pop %r12
95
+
96
+ FRAME_END
97
+ RET
98
+
99
+ .if \host
100
+ .Lseamcall_vmfailinvalid:
101
+ mov $TDX_SEAMCALL_VMFAILINVALID, %rax
102
+ /* pop the unused output pointer back to %r9 */
103
+ pop %r9
104
+ jmp .Lout
105
+ .endif /* \host */
106
+
96
107
.endm
You can’t perform that action at this time.
0 commit comments