xref: /linux/arch/x86/include/asm/tdx_global_metadata.h (revision 4a8bdffce502d70405391a7ac38bac6dcef94749)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* TDX global metadata structures. */
3 #ifndef _X86_VIRT_TDX_TDX_GLOBAL_METADATA_H
4 #define _X86_VIRT_TDX_TDX_GLOBAL_METADATA_H
5 
6 #include <linux/types.h>
7 
8 struct tdx_sys_info_version {
9 	u16 minor_version;
10 	u16 major_version;
11 	u16 update_version;
12 };
13 
14 struct tdx_sys_info_features {
15 	u64 tdx_features0;
16 };
17 
18 struct tdx_sys_info_tdmr {
19 	u16 max_tdmrs;
20 	u16 max_reserved_per_tdmr;
21 	u16 pamt_4k_entry_size;
22 	u16 pamt_2m_entry_size;
23 	u16 pamt_1g_entry_size;
24 
25 	/* Optional metadata, if DPAMT is supported */
26 	u8  pamt_page_bitmap_entry_bits;
27 };
28 
29 struct tdx_sys_info_td_ctrl {
30 	u16 tdr_base_size;
31 	u16 tdcs_base_size;
32 	u16 tdvps_base_size;
33 };
34 
35 struct tdx_sys_info_td_conf {
36 	u64 attributes_fixed0;
37 	u64 attributes_fixed1;
38 	u64 xfam_fixed0;
39 	u64 xfam_fixed1;
40 	u16 num_cpuid_config;
41 	u16 max_vcpus_per_td;
42 	u64 cpuid_config_leaves[128];
43 	u64 cpuid_config_values[128][2];
44 };
45 
46 struct tdx_sys_info_handoff {
47 	u16 module_hv;
48 };
49 
50 struct tdx_sys_info {
51 	struct tdx_sys_info_version version;
52 	struct tdx_sys_info_features features;
53 	struct tdx_sys_info_tdmr tdmr;
54 	struct tdx_sys_info_td_ctrl td_ctrl;
55 	struct tdx_sys_info_td_conf td_conf;
56 };
57 
58 #endif
59