← Documents Documentation/virt/kvm/x86/intel-tdx.rst GitHub 원문 ↗

Linux 6.18.37 · 가상화 / KVM / x86

Intel Trust Domain Extensions (TDX)

Intel TDX KVM sub-ioctl ABI와 private memory measurement를 포함한 TD 생성 흐름입니다.

Source pathDocumentation/virt/kvm/x86/intel-tdx.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

intel-tdx.rst:1-268

Intel TDX KVM sub-ioctl ABI와 private memory measurement를 포함한 TD 생성 흐름입니다.

레지스터, 비트 필드, 구조체와 호출 순서를 원문 표기 및 줄 좌표와 함께 보존했습니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ===================================
4 Intel Trust Domain Extensions (TDX)
5 ===================================
6
7 Overview
8 ========
9 Intel's Trust Domain Extensions (TDX) protect confidential guest VMs from the
10 host and physical attacks. A CPU-attested software module called 'the TDX
11 module' runs inside a new CPU isolated range to provide the functionalities to
12 manage and run protected VMs, a.k.a, TDX guests or TDs.
13
14 Please refer to [1] for the whitepaper, specifications and other resources.
15
16 This documentation describes TDX-specific KVM ABIs. The TDX module needs to be
17 initialized before it can be used by KVM to run any TDX guests. The host
18 core-kernel provides the support of initializing the TDX module, which is
19 described in the Documentation/arch/x86/tdx.rst.
20
21 API description
22 ===============
23
24 KVM_MEMORY_ENCRYPT_OP
25 ---------------------
26 :Type: vm ioctl, vcpu ioctl
27
28 For TDX operations, KVM_MEMORY_ENCRYPT_OP is re-purposed to be generic
29 ioctl with TDX specific sub-ioctl() commands.
30
31 ::
32
33 /* Trust Domain Extensions sub-ioctl() commands. */
34 enum kvm_tdx_cmd_id {
35 KVM_TDX_CAPABILITIES = 0,
36 KVM_TDX_INIT_VM,
37 KVM_TDX_INIT_VCPU,
38 KVM_TDX_INIT_MEM_REGION,
39 KVM_TDX_FINALIZE_VM,
40 KVM_TDX_GET_CPUID,
41
42 KVM_TDX_CMD_NR_MAX,
43 };
44
45 struct kvm_tdx_cmd {
46 /* enum kvm_tdx_cmd_id */
47 __u32 id;
48 /* flags for sub-command. If sub-command doesn't use this, set zero. */
49 __u32 flags;
50 /*
51 * data for each sub-command. An immediate or a pointer to the actual
52 * data in process virtual address. If sub-command doesn't use it,
53 * set zero.
54 */
55 __u64 data;
56 /*
57 * Auxiliary error code. The sub-command may return TDX SEAMCALL
58 * status code in addition to -Exxx.
59 */
60 __u64 hw_error;
61 };
62
63 KVM_TDX_CAPABILITIES
64 --------------------
65 :Type: vm ioctl
66 :Returns: 0 on success, <0 on error
67
68 Return the TDX capabilities that current KVM supports with the specific TDX
69 module loaded in the system. It reports what features/capabilities are allowed
70 to be configured to the TDX guest.
71
72 - id: KVM_TDX_CAPABILITIES
73 - flags: must be 0
74 - data: pointer to struct kvm_tdx_capabilities
75 - hw_error: must be 0
76
77 ::
78
79 struct kvm_tdx_capabilities {
80 __u64 supported_attrs;
81 __u64 supported_xfam;
82
83 /* TDG.VP.VMCALL hypercalls executed in kernel and forwarded to
84 * userspace, respectively
85 */
86 __u64 kernel_tdvmcallinfo_1_r11;
87 __u64 user_tdvmcallinfo_1_r11;
88
89 /* TDG.VP.VMCALL instruction executions subfunctions executed in kernel
90 * and forwarded to userspace, respectively
91 */
92 __u64 kernel_tdvmcallinfo_1_r12;
93 __u64 user_tdvmcallinfo_1_r12;
94
95 __u64 reserved[250];
96
97 /* Configurable CPUID bits for userspace */
98 struct kvm_cpuid2 cpuid;
99 };
100
101
102 KVM_TDX_INIT_VM
103 ---------------
104 :Type: vm ioctl
105 :Returns: 0 on success, <0 on error
106
107 Perform TDX specific VM initialization. This needs to be called after
108 KVM_CREATE_VM and before creating any VCPUs.
109
110 - id: KVM_TDX_INIT_VM
111 - flags: must be 0
112 - data: pointer to struct kvm_tdx_init_vm
113 - hw_error: must be 0
114
115 ::
116
117 struct kvm_tdx_init_vm {
118 __u64 attributes;
119 __u64 xfam;
120 __u64 mrconfigid[6]; /* sha384 digest */
121 __u64 mrowner[6]; /* sha384 digest */
122 __u64 mrownerconfig[6]; /* sha384 digest */
123
124 /* The total space for TD_PARAMS before the CPUIDs is 256 bytes */
125 __u64 reserved[12];
126
127 /*
128 * Call KVM_TDX_INIT_VM before vcpu creation, thus before
129 * KVM_SET_CPUID2.
130 * This configuration supersedes KVM_SET_CPUID2s for VCPUs because the
131 * TDX module directly virtualizes those CPUIDs without VMM. The user
132 * space VMM, e.g. qemu, should make KVM_SET_CPUID2 consistent with
133 * those values. If it doesn't, KVM may have wrong idea of vCPUIDs of
134 * the guest, and KVM may wrongly emulate CPUIDs or MSRs that the TDX
135 * module doesn't virtualize.
136 */
137 struct kvm_cpuid2 cpuid;
138 };
139
140
141 KVM_TDX_INIT_VCPU
142 -----------------
143 :Type: vcpu ioctl
144 :Returns: 0 on success, <0 on error
145
146 Perform TDX specific VCPU initialization.
147
148 - id: KVM_TDX_INIT_VCPU
149 - flags: must be 0
150 - data: initial value of the guest TD VCPU RCX
151 - hw_error: must be 0
152
153 KVM_TDX_INIT_MEM_REGION
154 -----------------------
155 :Type: vcpu ioctl
156 :Returns: 0 on success, <0 on error
157
158 Initialize @nr_pages TDX guest private memory starting from @gpa with userspace
159 provided data from @source_addr.
160
161 Note, before calling this sub command, memory attribute of the range
162 [gpa, gpa + nr_pages] needs to be private. Userspace can use
163 KVM_SET_MEMORY_ATTRIBUTES to set the attribute.
164
165 If KVM_TDX_MEASURE_MEMORY_REGION flag is specified, it also extends measurement.
166
167 - id: KVM_TDX_INIT_MEM_REGION
168 - flags: currently only KVM_TDX_MEASURE_MEMORY_REGION is defined
169 - data: pointer to struct kvm_tdx_init_mem_region
170 - hw_error: must be 0
171
172 ::
173
174 #define KVM_TDX_MEASURE_MEMORY_REGION (1UL << 0)
175
176 struct kvm_tdx_init_mem_region {
177 __u64 source_addr;
178 __u64 gpa;
179 __u64 nr_pages;
180 };
181
182
183 KVM_TDX_FINALIZE_VM
184 -------------------
185 :Type: vm ioctl
186 :Returns: 0 on success, <0 on error
187
188 Complete measurement of the initial TD contents and mark it ready to run.
189
190 - id: KVM_TDX_FINALIZE_VM
191 - flags: must be 0
192 - data: must be 0
193 - hw_error: must be 0
194
195
196 KVM_TDX_GET_CPUID
197 -----------------
198 :Type: vcpu ioctl
199 :Returns: 0 on success, <0 on error
200
201 Get the CPUID values that the TDX module virtualizes for the TD guest.
202 When it returns -E2BIG, the user space should allocate a larger buffer and
203 retry. The minimum buffer size is updated in the nent field of the
204 struct kvm_cpuid2.
205
206 - id: KVM_TDX_GET_CPUID
207 - flags: must be 0
208 - data: pointer to struct kvm_cpuid2 (in/out)
209 - hw_error: must be 0 (out)
210
211 ::
212
213 struct kvm_cpuid2 {
214 __u32 nent;
215 __u32 padding;
216 struct kvm_cpuid_entry2 entries[0];
217 };
218
219 struct kvm_cpuid_entry2 {
220 __u32 function;
221 __u32 index;
222 __u32 flags;
223 __u32 eax;
224 __u32 ebx;
225 __u32 ecx;
226 __u32 edx;
227 __u32 padding[3];
228 };
229
230 KVM TDX creation flow
231 =====================
232 In addition to the standard KVM flow, new TDX ioctls need to be called. The
233 control flow is as follows:
234
235 #. Check system wide capability
236
237 * KVM_CAP_VM_TYPES: Check if VM type is supported and if KVM_X86_TDX_VM
238 is supported.
239
240 #. Create VM
241
242 * KVM_CREATE_VM
243 * KVM_TDX_CAPABILITIES: Query TDX capabilities for creating TDX guests.
244 * KVM_CHECK_EXTENSION(KVM_CAP_MAX_VCPUS): Query maximum VCPUs the TD can
245 support at VM level (TDX has its own limitation on this).
246 * KVM_SET_TSC_KHZ: Configure TD's TSC frequency if a different TSC frequency
247 than host is desired. This is Optional.
248 * KVM_TDX_INIT_VM: Pass TDX specific VM parameters.
249
250 #. Create VCPU
251
252 * KVM_CREATE_VCPU
253 * KVM_TDX_INIT_VCPU: Pass TDX specific VCPU parameters.
254 * KVM_SET_CPUID2: Configure TD's CPUIDs.
255 * KVM_SET_MSRS: Configure TD's MSRs.
256
257 #. Initialize initial guest memory
258
259 * Prepare content of initial guest memory.
260 * KVM_TDX_INIT_MEM_REGION: Add initial guest memory.
261 * KVM_TDX_FINALIZE_VM: Finalize the measurement of the TDX guest.
262
263 #. Run VCPU
264
265 References
266 ==========
267
268 https://www.intel.com/content/www/us/en/developer/tools/trust-domain-extensions/documentation.html
269

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

TDX 보호 모델

1-21

Intel TDX는 confidential guest VM을 host와 물리 공격으로부터 보호합니다. CPU가 attest한 TDX module이 새 CPU isolated range에서 실행되어 TDX guest 또는 Trust Domain(TD)을 관리하고 실행합니다.

이 문서는 TDX-specific KVM ABI를 정의합니다. KVM이 TD를 실행하기 전에 host core kernel이 TDX module을 초기화해야 하며 해당 절차는 `Documentation/arch/x86/tdx.rst`에 있습니다.

.. SPDX-License-Identifier: GPL-2.0

===================================
Intel Trust Domain Extensions (TDX)
===================================

Overview
========
Intel's Trust Domain Extensions (TDX) protect confidential guest VMs from the
host and physical attacks.  A CPU-attested software module called 'the TDX
module' runs inside a new CPU isolated range to provide the functionalities to
manage and run protected VMs, a.k.a, TDX guests or TDs.

Please refer to [1] for the whitepaper, specifications and other resources.

This documentation describes TDX-specific KVM ABIs.  The TDX module needs to be
initialized before it can be used by KVM to run any TDX guests.  The host
core-kernel provides the support of initializing the TDX module, which is
described in the Documentation/arch/x86/tdx.rst.

API description

KVM_MEMORY_ENCRYPT_OP command envelope

22-62

TDX는 VM·vCPU ioctl인 `KVM_MEMORY_ENCRYPT_OP`을 TDX sub-ioctl을 담는 generic command로 재사용합니다.

`enum kvm_tdx_cmd_id`
Command범위
`KVM_TDX_CAPABILITIES`지원 capability 조회
`KVM_TDX_INIT_VM`TD 초기화
`KVM_TDX_INIT_VCPU`TD vCPU 초기화
`KVM_TDX_INIT_MEM_REGION`private guest memory 초기화
`KVM_TDX_FINALIZE_VM`measurement 완료와 실행 준비
`KVM_TDX_GET_CPUID`TDX module 가상화 CPUID 조회

TDX 수명주기 subcommand입니다.

`struct kvm_tdx_cmd`
필드의미
`id``enum kvm_tdx_cmd_id`
`flags`command별 flag, 사용하지 않으면 0
`data`즉시값 또는 process virtual address pointer, 미사용 시 0
`hw_error`선택적인 TDX SEAMCALL status code와 -Exxx 보조 오류

모든 subcommand의 공통 입력·출력입니다.

===============

KVM_MEMORY_ENCRYPT_OP
---------------------
:Type: vm ioctl, vcpu ioctl

For TDX operations, KVM_MEMORY_ENCRYPT_OP is re-purposed to be generic
ioctl with TDX specific sub-ioctl() commands.

::

  /* Trust Domain Extensions sub-ioctl() commands. */
  enum kvm_tdx_cmd_id {
          KVM_TDX_CAPABILITIES = 0,
          KVM_TDX_INIT_VM,
          KVM_TDX_INIT_VCPU,
          KVM_TDX_INIT_MEM_REGION,
          KVM_TDX_FINALIZE_VM,
          KVM_TDX_GET_CPUID,

          KVM_TDX_CMD_NR_MAX,
  };

  struct kvm_tdx_cmd {
        /* enum kvm_tdx_cmd_id */
        __u32 id;
        /* flags for sub-command. If sub-command doesn't use this, set zero. */
        __u32 flags;
        /*
         * data for each sub-command. An immediate or a pointer to the actual
         * data in process virtual address.  If sub-command doesn't use it,
         * set zero.
         */
        __u64 data;
        /*
         * Auxiliary error code.  The sub-command may return TDX SEAMCALL
         * status code in addition to -Exxx.
         */
        __u64 hw_error;
  };

KVM_TDX_CAPABILITIES

63-101

현재 system의 TDX module과 KVM이 지원하는 capability 및 guest에 구성 가능한 기능을 반환합니다. flags와 hw_error 입력은 0, data는 `struct kvm_tdx_capabilities` pointer입니다.

TDX capability field
필드의미
`supported_attrs`지원 TD attributes
`supported_xfam`지원 XFAM
`kernel_tdvmcallinfo_1_r11/r12`kernel이 처리하는 TDG.VP.VMCALL과 subfunction bitmap
`user_tdvmcallinfo_1_r11/r12`userspace로 전달하는 VMCALL과 subfunction bitmap
`reserved[250]`예약
`cpuid`userspace가 구성 가능한 CPUID bit

TD attribute, XFAM, TDVMCALL 처리 위치와 CPUID를 보고합니다.

KVM_TDX_CAPABILITIES
--------------------
:Type: vm ioctl
:Returns: 0 on success, <0 on error

Return the TDX capabilities that current KVM supports with the specific TDX
module loaded in the system.  It reports what features/capabilities are allowed
to be configured to the TDX guest.

- id: KVM_TDX_CAPABILITIES
- flags: must be 0
- data: pointer to struct kvm_tdx_capabilities
- hw_error: must be 0

::

  struct kvm_tdx_capabilities {
        __u64 supported_attrs;
        __u64 supported_xfam;

        /* TDG.VP.VMCALL hypercalls executed in kernel and forwarded to
         * userspace, respectively
         */
        __u64 kernel_tdvmcallinfo_1_r11;
        __u64 user_tdvmcallinfo_1_r11;

        /* TDG.VP.VMCALL instruction executions subfunctions executed in kernel
         * and forwarded to userspace, respectively
         */
        __u64 kernel_tdvmcallinfo_1_r12;
        __u64 user_tdvmcallinfo_1_r12;

        __u64 reserved[250];

        /* Configurable CPUID bits for userspace */
        struct kvm_cpuid2 cpuid;
  };

KVM_TDX_INIT_VM

102-140

`KVM_CREATE_VM` 뒤 어떤 vCPU도 만들기 전에 TDX-specific VM initialization을 수행합니다. attributes, XFAM과 SHA-384 measurement identity 값을 전달합니다.

`struct kvm_tdx_init_vm`
필드의미
`attributes`TD attributes
`xfam`extended feature activation mask
`mrconfigid[6]`SHA-384 configuration digest
`mrowner[6]`SHA-384 owner digest
`mrownerconfig[6]`SHA-384 owner configuration digest
`reserved[12]`CPUID 전 TD_PARAMS 공간
`cpuid`TDX module이 직접 가상화할 CPUID

TD_PARAMS의 identity와 CPUID 구성입니다.

이 CPUID 구성은 vCPU별 `KVM_SET_CPUID2`보다 우선합니다. QEMU 같은 VMM은 두 값을 일치시켜야 하며, 다르면 KVM이 guest vCPUID를 잘못 이해해 TDX module이 가상화하지 않는 CPUID나 MSR을 잘못 에뮬레이션할 수 있습니다.

KVM_TDX_INIT_VM
---------------
:Type: vm ioctl
:Returns: 0 on success, <0 on error

Perform TDX specific VM initialization.  This needs to be called after
KVM_CREATE_VM and before creating any VCPUs.

- id: KVM_TDX_INIT_VM
- flags: must be 0
- data: pointer to struct kvm_tdx_init_vm
- hw_error: must be 0

::

  struct kvm_tdx_init_vm {
          __u64 attributes;
          __u64 xfam;
          __u64 mrconfigid[6];          /* sha384 digest */
          __u64 mrowner[6];             /* sha384 digest */
          __u64 mrownerconfig[6];       /* sha384 digest */

          /* The total space for TD_PARAMS before the CPUIDs is 256 bytes */
          __u64 reserved[12];

        /*
         * Call KVM_TDX_INIT_VM before vcpu creation, thus before
         * KVM_SET_CPUID2.
         * This configuration supersedes KVM_SET_CPUID2s for VCPUs because the
         * TDX module directly virtualizes those CPUIDs without VMM.  The user
         * space VMM, e.g. qemu, should make KVM_SET_CPUID2 consistent with
         * those values.  If it doesn't, KVM may have wrong idea of vCPUIDs of
         * the guest, and KVM may wrongly emulate CPUIDs or MSRs that the TDX
         * module doesn't virtualize.
         */
          struct kvm_cpuid2 cpuid;
  };

KVM_TDX_INIT_VCPU

141-152

vCPU ioctl로 TDX-specific vCPU initialization을 수행합니다. flags와 hw_error는 0이며 data에 guest TD vCPU의 초기 RCX 값을 직접 전달합니다.

KVM_TDX_INIT_VCPU
-----------------
:Type: vcpu ioctl
:Returns: 0 on success, <0 on error

Perform TDX specific VCPU initialization.

- id: KVM_TDX_INIT_VCPU
- flags: must be 0
- data: initial value of the guest TD VCPU RCX
- hw_error: must be 0

KVM_TDX_INIT_MEM_REGION

153-182

userspace `source_addr` data로 `gpa`부터 `nr_pages`개의 TD private memory를 초기화합니다. 호출 전 `[gpa, gpa + nr_pages]` range의 memory attribute를 `KVM_SET_MEMORY_ATTRIBUTES`로 private로 설정해야 합니다.

`KVM_TDX_MEASURE_MEMORY_REGION` flag를 주면 초기화와 함께 measurement를 확장합니다. 현재 정의된 flag는 이 bit 하나입니다.

`struct kvm_tdx_init_mem_region`
필드의미
`source_addr`userspace 초기 data 주소
`gpa`TD guest physical start
`nr_pages`초기화할 page 수

초기 guest memory source와 target입니다.

KVM_TDX_INIT_MEM_REGION
-----------------------
:Type: vcpu ioctl
:Returns: 0 on success, <0 on error

Initialize @nr_pages TDX guest private memory starting from @gpa with userspace
provided data from @source_addr.

Note, before calling this sub command, memory attribute of the range
[gpa, gpa + nr_pages] needs to be private.  Userspace can use
KVM_SET_MEMORY_ATTRIBUTES to set the attribute.

If KVM_TDX_MEASURE_MEMORY_REGION flag is specified, it also extends measurement.

- id: KVM_TDX_INIT_MEM_REGION
- flags: currently only KVM_TDX_MEASURE_MEMORY_REGION is defined
- data: pointer to struct kvm_tdx_init_mem_region
- hw_error: must be 0

::

  #define KVM_TDX_MEASURE_MEMORY_REGION   (1UL << 0)

  struct kvm_tdx_init_mem_region {
          __u64 source_addr;
          __u64 gpa;
          __u64 nr_pages;
  };

KVM_TDX_FINALIZE_VM

183-195

초기 TD content의 measurement를 완료하고 실행 가능 상태로 표시합니다. VM ioctl이며 flags, data, hw_error는 모두 0이어야 합니다.

KVM_TDX_FINALIZE_VM
-------------------
:Type: vm ioctl
:Returns: 0 on success, <0 on error

Complete measurement of the initial TD contents and mark it ready to run.

- id: KVM_TDX_FINALIZE_VM
- flags: must be 0
- data: must be 0
- hw_error: must be 0

KVM_TDX_GET_CPUID

196-229

TDX module이 TD guest에 직접 가상화하는 CPUID 값을 조회합니다. `-E2BIG`이면 userspace는 `struct kvm_cpuid2.nent`에 갱신된 최소 크기에 맞춰 더 큰 buffer를 할당하고 재시도해야 합니다.

CPUID 출력 구조
구조필드
`kvm_cpuid2``nent`, `padding`, `entries[0]`
`kvm_cpuid_entry2``function`, `index`, `flags`, `eax`, `ebx`, `ecx`, `edx`, `padding[3]`

가변 길이 entry 배열입니다.

KVM_TDX_GET_CPUID
-----------------
:Type: vcpu ioctl
:Returns: 0 on success, <0 on error

Get the CPUID values that the TDX module virtualizes for the TD guest.
When it returns -E2BIG, the user space should allocate a larger buffer and
retry. The minimum buffer size is updated in the nent field of the
struct kvm_cpuid2.

- id: KVM_TDX_GET_CPUID
- flags: must be 0
- data: pointer to struct kvm_cpuid2 (in/out)
- hw_error: must be 0 (out)

::

  struct kvm_cpuid2 {
	  __u32 nent;
	  __u32 padding;
	  struct kvm_cpuid_entry2 entries[0];
  };

  struct kvm_cpuid_entry2 {
	  __u32 function;
	  __u32 index;
	  __u32 flags;
	  __u32 eax;
	  __u32 ebx;
	  __u32 ecx;
	  __u32 edx;
	  __u32 padding[3];
  };

TDX VM 생성 흐름

230-264
KVM TDX creation flow
KVM_CAP_VM_TYPES에서 KVM_X86_TDX_VM 확인KVM_CREATE_VMKVM_TDX_CAPABILITIES와 KVM_CAP_MAX_VCPUS 조회선택적으로 KVM_SET_TSC_KHZKVM_TDX_INIT_VMKVM_CREATE_VCPU와 KVM_TDX_INIT_VCPUKVM_SET_CPUID2와 KVM_SET_MSRS초기 guest memory 준비KVM_TDX_INIT_MEM_REGIONKVM_TDX_FINALIZE_VMvCPU 실행

표준 KVM 흐름에 TDX ioctl을 삽입하는 순서입니다.

TDX는 자체 최대 vCPU 제한이 있으므로 VM level에서 `KVM_CHECK_EXTENSION(KVM_CAP_MAX_VCPUS)`를 확인합니다. host와 다른 TSC frequency가 필요할 때만 `KVM_SET_TSC_KHZ`를 선택적으로 사용합니다.

KVM TDX creation flow
=====================
In addition to the standard KVM flow, new TDX ioctls need to be called.  The
control flow is as follows:

#. Check system wide capability

   * KVM_CAP_VM_TYPES: Check if VM type is supported and if KVM_X86_TDX_VM
     is supported.

#. Create VM

   * KVM_CREATE_VM
   * KVM_TDX_CAPABILITIES: Query TDX capabilities for creating TDX guests.
   * KVM_CHECK_EXTENSION(KVM_CAP_MAX_VCPUS): Query maximum VCPUs the TD can
     support at VM level (TDX has its own limitation on this).
   * KVM_SET_TSC_KHZ: Configure TD's TSC frequency if a different TSC frequency
     than host is desired.  This is Optional.
   * KVM_TDX_INIT_VM: Pass TDX specific VM parameters.

#. Create VCPU

   * KVM_CREATE_VCPU
   * KVM_TDX_INIT_VCPU: Pass TDX specific VCPU parameters.
   * KVM_SET_CPUID2: Configure TD's CPUIDs.
   * KVM_SET_MSRS: Configure TD's MSRs.

#. Initialize initial guest memory

   * Prepare content of initial guest memory.
   * KVM_TDX_INIT_MEM_REGION: Add initial guest memory.
   * KVM_TDX_FINALIZE_VM: Finalize the measurement of the TDX guest.

#. Run VCPU

참고 자료

265-268

Intel Trust Domain Extensions 개발 문서에서 whitepaper, specification과 추가 resource를 확인할 수 있습니다.

References
==========

https://www.intel.com/content/www/us/en/developer/tools/trust-domain-extensions/documentation.html