2022-04-05 23:29:21 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef _ASM_X86_SHARED_TDX_H
|
|
|
|
#define _ASM_X86_SHARED_TDX_H
|
|
|
|
|
2022-04-05 23:29:25 +00:00
|
|
|
#include <linux/bits.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
|
|
|
#define TDX_HYPERCALL_STANDARD 0
|
|
|
|
|
2022-04-05 23:29:21 +00:00
|
|
|
#define TDX_CPUID_LEAF_ID 0x21
|
|
|
|
#define TDX_IDENT "IntelTDX "
|
|
|
|
|
2022-04-05 23:29:25 +00:00
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Used in __tdx_hypercall() to pass down and get back registers' values of
|
|
|
|
* the TDCALL instruction when requesting services from the VMM.
|
|
|
|
*
|
|
|
|
* This is a software only structure and not part of the TDX module/VMM ABI.
|
|
|
|
*/
|
|
|
|
struct tdx_hypercall_args {
|
2023-01-26 22:11:54 +00:00
|
|
|
u64 r8;
|
|
|
|
u64 r9;
|
2022-04-05 23:29:25 +00:00
|
|
|
u64 r10;
|
|
|
|
u64 r11;
|
|
|
|
u64 r12;
|
|
|
|
u64 r13;
|
|
|
|
u64 r14;
|
|
|
|
u64 r15;
|
2023-01-26 22:11:54 +00:00
|
|
|
u64 rdi;
|
|
|
|
u64 rsi;
|
|
|
|
u64 rbx;
|
|
|
|
u64 rdx;
|
2022-04-05 23:29:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Used to request services from the VMM */
|
2023-03-21 00:35:11 +00:00
|
|
|
u64 __tdx_hypercall(struct tdx_hypercall_args *args);
|
|
|
|
u64 __tdx_hypercall_ret(struct tdx_hypercall_args *args);
|
2022-04-05 23:29:25 +00:00
|
|
|
|
|
|
|
/* Called from __tdx_hypercall() for unrecoverable failure */
|
|
|
|
void __tdx_hypercall_failed(void);
|
|
|
|
|
|
|
|
#endif /* !__ASSEMBLY__ */
|
2022-04-05 23:29:21 +00:00
|
|
|
#endif /* _ASM_X86_SHARED_TDX_H */
|