14b05f815SKuppuswamy Sathyanarayanan /* SPDX-License-Identifier: GPL-2.0 */ 24b05f815SKuppuswamy Sathyanarayanan #ifndef _ASM_X86_SHARED_TDX_H 34b05f815SKuppuswamy Sathyanarayanan #define _ASM_X86_SHARED_TDX_H 44b05f815SKuppuswamy Sathyanarayanan 5*4c5b9aacSKirill A. Shutemov #include <linux/bits.h> 6*4c5b9aacSKirill A. Shutemov #include <linux/types.h> 7*4c5b9aacSKirill A. Shutemov 8*4c5b9aacSKirill A. Shutemov #define TDX_HYPERCALL_STANDARD 0 9*4c5b9aacSKirill A. Shutemov 10*4c5b9aacSKirill A. Shutemov #define TDX_HCALL_HAS_OUTPUT BIT(0) 11*4c5b9aacSKirill A. Shutemov #define TDX_HCALL_ISSUE_STI BIT(1) 12*4c5b9aacSKirill A. Shutemov 134b05f815SKuppuswamy Sathyanarayanan #define TDX_CPUID_LEAF_ID 0x21 144b05f815SKuppuswamy Sathyanarayanan #define TDX_IDENT "IntelTDX " 154b05f815SKuppuswamy Sathyanarayanan 16*4c5b9aacSKirill A. Shutemov #ifndef __ASSEMBLY__ 17*4c5b9aacSKirill A. Shutemov 18*4c5b9aacSKirill A. Shutemov /* 19*4c5b9aacSKirill A. Shutemov * Used in __tdx_hypercall() to pass down and get back registers' values of 20*4c5b9aacSKirill A. Shutemov * the TDCALL instruction when requesting services from the VMM. 21*4c5b9aacSKirill A. Shutemov * 22*4c5b9aacSKirill A. Shutemov * This is a software only structure and not part of the TDX module/VMM ABI. 23*4c5b9aacSKirill A. Shutemov */ 24*4c5b9aacSKirill A. Shutemov struct tdx_hypercall_args { 25*4c5b9aacSKirill A. Shutemov u64 r10; 26*4c5b9aacSKirill A. Shutemov u64 r11; 27*4c5b9aacSKirill A. Shutemov u64 r12; 28*4c5b9aacSKirill A. Shutemov u64 r13; 29*4c5b9aacSKirill A. Shutemov u64 r14; 30*4c5b9aacSKirill A. Shutemov u64 r15; 31*4c5b9aacSKirill A. Shutemov }; 32*4c5b9aacSKirill A. Shutemov 33*4c5b9aacSKirill A. Shutemov /* Used to request services from the VMM */ 34*4c5b9aacSKirill A. Shutemov u64 __tdx_hypercall(struct tdx_hypercall_args *args, unsigned long flags); 35*4c5b9aacSKirill A. Shutemov 36*4c5b9aacSKirill A. Shutemov /* Called from __tdx_hypercall() for unrecoverable failure */ 37*4c5b9aacSKirill A. Shutemov void __tdx_hypercall_failed(void); 38*4c5b9aacSKirill A. Shutemov 39*4c5b9aacSKirill A. Shutemov #endif /* !__ASSEMBLY__ */ 404b05f815SKuppuswamy Sathyanarayanan #endif /* _ASM_X86_SHARED_TDX_H */ 41