summaryrefslogtreecommitdiff
path: root/arch/x86/virt/vmx/tdx/seamcall.S
blob: 5b1f2286aea9a7420dfc5e62fb366e3ca426a1ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/linkage.h>
#include <asm/frame.h>

#include "tdxcall.S"

/*
 * __seamcall() - Host-side interface functions to SEAM software
 * (the P-SEAMLDR or the TDX module).
 *
 * __seamcall() function ABI:
 *
 * @fn   (RDI)  - SEAMCALL Leaf number, moved to RAX
 * @args (RSI)  - struct tdx_module_args for input
 *
 * Only RCX/RDX/R8-R11 are used as input registers.
 *
 * Return (via RAX) TDX_SEAMCALL_VMFAILINVALID if the SEAMCALL itself
 * fails, or the completion status of the SEAMCALL leaf function.
 */
SYM_FUNC_START(__seamcall)
	TDX_MODULE_CALL host=1
SYM_FUNC_END(__seamcall)

/*
 * __seamcall_ret() - Host-side interface functions to SEAM software
 * (the P-SEAMLDR or the TDX module), with saving output registers to
 * the 'struct tdx_module_args' used as input.
 *
 * __seamcall_ret() function ABI:
 *
 * @fn   (RDI)  - SEAMCALL Leaf number, moved to RAX
 * @args (RSI)  - struct tdx_module_args for input and output
 *
 * Only RCX/RDX/R8-R11 are used as input/output registers.
 *
 * Return (via RAX) TDX_SEAMCALL_VMFAILINVALID if the SEAMCALL itself
 * fails, or the completion status of the SEAMCALL leaf function.
 */
SYM_FUNC_START(__seamcall_ret)
	TDX_MODULE_CALL host=1 ret=1
SYM_FUNC_END(__seamcall_ret)

/*
 * __seamcall_saved_ret() - Host-side interface functions to SEAM software
 * (the P-SEAMLDR or the TDX module), with saving output registers to the
 * 'struct tdx_module_args' used as input.
 *
 * __seamcall_saved_ret() function ABI:
 *
 * @fn   (RDI)  - SEAMCALL Leaf number, moved to RAX
 * @args (RSI)  - struct tdx_module_args for input and output
 *
 * All registers in @args are used as input/output registers.
 *
 * Return (via RAX) TDX_SEAMCALL_VMFAILINVALID if the SEAMCALL itself
 * fails, or the completion status of the SEAMCALL leaf function.
 */
SYM_FUNC_START(__seamcall_saved_ret)
	TDX_MODULE_CALL host=1 ret=1 saved=1
SYM_FUNC_END(__seamcall_saved_ret)