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_CPUID_LEAF_ID 0x21 11 #define TDX_IDENT "IntelTDX " 12 13 #ifndef __ASSEMBLY__ 14 15 /* 16 * Used in __tdx_hypercall() to pass down and get back registers' values of 17 * the TDCALL instruction when requesting services from the VMM. 18 * 19 * This is a software only structure and not part of the TDX module/VMM ABI. 20 */ 21 struct tdx_hypercall_args { 22 u64 r8; 23 u64 r9; 24 u64 r10; 25 u64 r11; 26 u64 r12; 27 u64 r13; 28 u64 r14; 29 u64 r15; 30 u64 rdi; 31 u64 rsi; 32 u64 rbx; 33 u64 rdx; 34 }; 35 36 /* Used to request services from the VMM */ 37 u64 __tdx_hypercall(struct tdx_hypercall_args *args); 38 u64 __tdx_hypercall_ret(struct tdx_hypercall_args *args); 39 40 /* Called from __tdx_hypercall() for unrecoverable failure */ 41 void __tdx_hypercall_failed(void); 42 43 #endif /* !__ASSEMBLY__ */ 44 #endif /* _ASM_X86_SHARED_TDX_H */ 45