← Documents Documentation/virt/coco/tdx-guest.rst GitHub 원문 ↗

Linux 6.18.37 · 가상화 / 기밀 컴퓨팅

TDX 게스트 API 문서

TDX guest attestation software가 TDREPORT0을 얻는 ioctl ABI와 오류·subtype 확장 규칙을 설명합니다.

Source pathDocumentation/virt/coco/tdx-guest.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

tdx-guest.rst:1-52

현재 TDX guest ABI는 subtype 0을 입력 필드로 받지 않고 ioctl command 이름에 고정합니다. 이 선택은 현재 ABI를 단순하게 유지하면서 미래 subtype마다 별도 command를 추가해 기존 호출의 의미가 바뀌지 않도록 합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ===================================================================
4 TDX Guest API Documentation
5 ===================================================================
6
7 1. General description
8 ======================
9
10 The TDX guest driver exposes IOCTL interfaces via the /dev/tdx-guest misc
11 device to allow userspace to get certain TDX guest-specific details.
12
13 2. API description
14 ==================
15
16 In this section, for each supported IOCTL, the following information is
17 provided along with a generic description.
18
19 :Input parameters: Parameters passed to the IOCTL and related details.
20 :Output: Details about output data and return value (with details about
21 the non common error values).
22
23 2.1 TDX_CMD_GET_REPORT0
24 -----------------------
25
26 :Input parameters: struct tdx_report_req
27 :Output: Upon successful execution, TDREPORT data is copied to
28 tdx_report_req.tdreport and return 0. Return -EINVAL for invalid
29 operands, -EIO on TDCALL failure or standard error number on other
30 common failures.
31
32 The TDX_CMD_GET_REPORT0 IOCTL can be used by the attestation software to get
33 the TDREPORT0 (a.k.a. TDREPORT subtype 0) from the TDX module using
34 TDCALL[TDG.MR.REPORT].
35
36 A subtype index is added at the end of this IOCTL CMD to uniquely identify the
37 subtype-specific TDREPORT request. Although the subtype option is mentioned in
38 the TDX Module v1.0 specification, section titled "TDG.MR.REPORT", it is not
39 currently used, and it expects this value to be 0. So to keep the IOCTL
40 implementation simple, the subtype option was not included as part of the input
41 ABI. However, in the future, if the TDX Module supports more than one subtype,
42 a new IOCTL CMD will be created to handle it. To keep the IOCTL naming
43 consistent, a subtype index is added as part of the IOCTL CMD.
44
45 Reference
46 ---------
47
48 TDX reference material is collected here:
49
50 https://www.intel.com/content/www/us/en/developer/articles/technical/intel-trust-domain-extensions.html
51
52 The driver is based on TDX module specification v1.0 and TDX GHCI specification v1.0.
53

3. 한국어 전문 번역

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

1. 일반 설명

1-12

TDX guest driver는 misc device `/dev/tdx-guest`를 통해 ioctl interface를 노출합니다. 사용자 공간은 이 interface로 TDX 게스트에 특화된 정보를 얻을 수 있습니다.

이 문서는 driver가 제공하는 TDX guest ABI와 attestation software가 report를 요청하는 방법을 설명합니다.

.. SPDX-License-Identifier: GPL-2.0

===================================================================
TDX Guest API Documentation
===================================================================

1. General description
======================

The TDX guest driver exposes IOCTL interfaces via the /dev/tdx-guest misc
device to allow userspace to get certain TDX guest-specific details.

2. API 설명 형식

13-22

지원되는 각 ioctl에는 일반 설명과 함께 입력 매개변수, 출력 데이터와 반환값을 기록합니다.

출력 설명에는 공통 오류 외에 해당 명령에서 특별한 의미를 갖는 오류 값도 포함됩니다.

TDX ioctl 문서 필드
필드내용
Input parametersIOCTL에 전달하는 구조체와 필드
Output출력 데이터, 성공 반환값, 명령별 오류

각 명령의 입력과 결과를 동일한 형식으로 제시합니다.

2. API description
==================

In this section, for each supported IOCTL, the following information is
provided along with a generic description.

:Input parameters: Parameters passed to the IOCTL and related details.
:Output: Details about output data and return value (with details about
         the non common error values).

2.1 TDX_CMD_GET_REPORT0

23-43

`TDX_CMD_GET_REPORT0`의 입력은 `struct tdx_report_req`입니다. 성공하면 `TDREPORT` 데이터를 `tdx_report_req.tdreport`에 복사하고 0을 반환합니다.

잘못된 operand에는 `-EINVAL`, `TDCALL` 실패에는 `-EIO`를 반환하며 그 밖의 공통 실패에는 표준 오류 번호를 반환합니다.

Attestation software는 이 ioctl로 `TDCALL[TDG.MR.REPORT]`를 통해 TDX module에서 `TDREPORT0`, 즉 TDREPORT subtype 0을 얻습니다.

TDX Module v1.0 명세에는 subtype option이 있지만 현재는 0만 기대하므로 입력 ABI에는 subtype을 넣지 않았습니다. 대신 명령 이름 끝에 subtype index를 붙였습니다. 향후 여러 subtype을 지원하면 subtype별 새 ioctl command를 만들어 일관된 이름을 유지합니다.

TDX_CMD_GET_REPORT0 계약
항목
Input`struct tdx_report_req`
Output`tdx_report_req.tdreport`의 TDREPORT0
Success0
Invalid operands`-EINVAL`
TDCALL failure`-EIO`
Subtype현재 0, command 이름에 index 포함

Report 요청 구조체와 반환 규칙입니다.

TDREPORT0 획득
Attestation software가 struct tdx_report_req 준비TDX_CMD_GET_REPORT0 ioctl을 /dev/tdx-guest에 발행Guest driver가 TDCALL[TDG.MR.REPORT] 실행TDX module이 subtype 0 TDREPORT 생성tdx_report_req.tdreport로 복사하고 0 반환

사용자 공간 attestation software에서 TDX module까지의 호출 경로입니다.

2.1 TDX_CMD_GET_REPORT0
-----------------------

:Input parameters: struct tdx_report_req
:Output: Upon successful execution, TDREPORT data is copied to
         tdx_report_req.tdreport and return 0. Return -EINVAL for invalid
         operands, -EIO on TDCALL failure or standard error number on other
         common failures.

The TDX_CMD_GET_REPORT0 IOCTL can be used by the attestation software to get
the TDREPORT0 (a.k.a. TDREPORT subtype 0) from the TDX module using
TDCALL[TDG.MR.REPORT].

A subtype index is added at the end of this IOCTL CMD to uniquely identify the
subtype-specific TDREPORT request. Although the subtype option is mentioned in
the TDX Module v1.0 specification, section titled "TDG.MR.REPORT", it is not
currently used, and it expects this value to be 0. So to keep the IOCTL
implementation simple, the subtype option was not included as part of the input
ABI. However, in the future, if the TDX Module supports more than one subtype,
a new IOCTL CMD will be created to handle it. To keep the IOCTL naming
consistent, a subtype index is added as part of the IOCTL CMD.

참고 자료와 구현 기준

44-52

TDX 참고 자료는 원문에 적힌 Intel Trust Domain Extensions 기술 자료 페이지에 모여 있습니다.

이 드라이버 문서는 TDX module specification v1.0과 TDX GHCI specification v1.0을 기준으로 합니다.


Reference
---------

TDX reference material is collected here:

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

The driver is based on TDX module specification v1.0 and TDX GHCI specification v1.0.