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 r10; 25 u64 r11; 26 u64 r12; 27 u64 r13; 28 u64 r14; 29 u64 r15; 30 }; 31 32 /* Used to request services from the VMM */ 33 u64 __tdx_hypercall(struct tdx_hypercall_args *args, unsigned long flags); 34 35 /* Called from __tdx_hypercall() for unrecoverable failure */ 36 void __tdx_hypercall_failed(void); 37 38 #endif /* !__ASSEMBLY__ */ 39 #endif /* _ASM_X86_SHARED_TDX_H */ 40