Merge tag 'selinux-pr-20220523' of git://git.kernel.org/pub/scm/linux/kernel/git...
[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 #define TDX_HCALL_ISSUE_STI     BIT(1)
12
13 #define TDX_CPUID_LEAF_ID       0x21
14 #define TDX_IDENT               "IntelTDX    "
15
16 #ifndef __ASSEMBLY__
17
18 /*
19  * Used in __tdx_hypercall() to pass down and get back registers' values of
20  * the TDCALL instruction when requesting services from the VMM.
21  *
22  * This is a software only structure and not part of the TDX module/VMM ABI.
23  */
24 struct tdx_hypercall_args {
25         u64 r10;
26         u64 r11;
27         u64 r12;
28         u64 r13;
29         u64 r14;
30         u64 r15;
31 };
32
33 /* Used to request services from the VMM */
34 u64 __tdx_hypercall(struct tdx_hypercall_args *args, unsigned long flags);
35
36 /* Called from __tdx_hypercall() for unrecoverable failure */
37 void __tdx_hypercall_failed(void);
38
39 #endif /* !__ASSEMBLY__ */
40 #endif /* _ASM_X86_SHARED_TDX_H */