Merge tag 'x86_tdx_for_6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
[linux-block.git] / arch / x86 / include / asm / shared / tdx.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_SHARED_TDX_H
3 #define _ASM_X86_SHARED_TDX_H
4
5 #include <linux/bits.h>
6 #include <linux/types.h>
7
8 #define TDX_HYPERCALL_STANDARD  0
9
10 #define TDX_HCALL_HAS_OUTPUT    BIT(0)
11
12 #define TDX_CPUID_LEAF_ID       0x21
13 #define TDX_IDENT               "IntelTDX    "
14
15 #ifndef __ASSEMBLY__
16
17 /*
18  * Used in __tdx_hypercall() to pass down and get back registers' values of
19  * the TDCALL instruction when requesting services from the VMM.
20  *
21  * This is a software only structure and not part of the TDX module/VMM ABI.
22  */
23 struct tdx_hypercall_args {
24         u64 r8;
25         u64 r9;
26         u64 r10;
27         u64 r11;
28         u64 r12;
29         u64 r13;
30         u64 r14;
31         u64 r15;
32         u64 rdi;
33         u64 rsi;
34         u64 rbx;
35         u64 rdx;
36 };
37
38 /* Used to request services from the VMM */
39 u64 __tdx_hypercall(struct tdx_hypercall_args *args, unsigned long flags);
40
41 /* Called from __tdx_hypercall() for unrecoverable failure */
42 void __tdx_hypercall_failed(void);
43
44 #endif /* !__ASSEMBLY__ */
45 #endif /* _ASM_X86_SHARED_TDX_H */