요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. 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 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
-----------------------
: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.
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.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
1. 일반 설명
1-12TDX 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에는 일반 설명과 함께 입력 매개변수, 출력 데이터와 반환값을 기록합니다.
출력 설명에는 공통 오류 외에 해당 명령에서 특별한 의미를 갖는 오류 값도 포함됩니다.
각 명령의 입력과 결과를 동일한 형식으로 제시합니다.
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를 만들어 일관된 이름을 유지합니다.
Report 요청 구조체와 반환 규칙입니다.
사용자 공간 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-52TDX 참고 자료는 원문에 적힌 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.
요약·해설
tdx-guest.rst:1-52현재 TDX guest ABI는 subtype 0을 입력 필드로 받지 않고 ioctl command 이름에 고정합니다. 이 선택은 현재 ABI를 단순하게 유지하면서 미래 subtype마다 별도 command를 추가해 기존 호출의 의미가 바뀌지 않도록 합니다.