요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
=================================
TS-TEE (Trusted Services project)
=================================
This driver provides access to secure services implemented by Trusted Services.
Trusted Services [1] is a TrustedFirmware.org project that provides a framework
for developing and deploying device Root of Trust services in FF-A [2] S-EL0
Secure Partitions. The project hosts the reference implementation of the Arm
Platform Security Architecture [3] for Arm A-profile devices.
The FF-A Secure Partitions (SP) are accessible through the FF-A driver [4] which
provides the low level communication for this driver. On top of that the Trusted
Services RPC protocol is used [5]. To use the driver from user space a reference
implementation is provided at [6], which is part of the Trusted Services client
library called libts [7].
All Trusted Services (TS) SPs have the same FF-A UUID; it identifies the TS RPC
protocol. A TS SP can host one or more services (e.g. PSA Crypto, PSA ITS, etc).
A service is identified by its service UUID; the same type of service cannot be
present twice in the same SP. During SP boot each service in the SP is assigned
an "interface ID". This is just a short ID to simplify message addressing.
The generic TEE design is to share memory at once with the Trusted OS, which can
then be reused to communicate with multiple applications running on the Trusted
OS. However, in case of FF-A, memory sharing works on an endpoint level, i.e.
memory is shared with a specific SP. User space has to be able to separately
share memory with each SP based on its endpoint ID; therefore a separate TEE
device is registered for each discovered TS SP. Opening the SP corresponds to
opening the TEE device and creating a TEE context. A TS SP hosts one or more
services. Opening a service corresponds to opening a session in the given
tee_context.
Overview of a system with Trusted Services components::
User space Kernel space Secure world
~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~
+--------+ +-------------+
| Client | | Trusted |
+--------+ | Services SP |
/\ +-------------+
|| /\
|| ||
|| ||
\/ \/
+-------+ +----------+--------+ +-------------+
| libts | | TEE | TS-TEE | | FF-A SPMC |
| | | subsys | driver | | + SPMD |
+-------+----------------+----+-----+--------+-----------+-------------+
| Generic TEE API | | FF-A | TS RPC protocol |
| IOCTL (TEE_IOC_*) | | driver | over FF-A |
+-----------------------------+ +--------+-------------------------+
References
==========
[1] https://www.trustedfirmware.org/projects/trusted-services/
[2] https://developer.arm.com/documentation/den0077/
[3] https://www.arm.com/architecture/security-features/platform-security
[4] drivers/firmware/arm_ffa/
[5] https://trusted-services.readthedocs.io/en/v1.0.0/developer/service-access-protocols.html#abi
[6] https://git.trustedfirmware.org/TS/trusted-services.git/tree/components/rpc/ts_rpc/caller/linux/ts_rpc_caller_linux.c?h=v1.0.0
[7] https://git.trustedfirmware.org/TS/trusted-services.git/tree/deployments/libts/arm-linux/CMakeLists.txt?h=v1.0.0
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Trusted Services와 service 식별
1-25TS-TEE driver는 Trusted Services가 구현한 secure service에 접근할 수 있게 한다.
Trusted Services `[1]`는 TrustedFirmware.org project로, FF-A `[2]` S-EL0 Secure Partition에서 device Root of Trust service를 개발하고 배포하는 framework를 제공한다. 이 project는 Arm A-profile device용 Arm Platform Security Architecture `[3]` reference implementation을 포함한다.
FF-A Secure Partition(SP)은 TS-TEE의 low-level 통신을 제공하는 FF-A driver `[4]`를 통해 접근한다. 그 위에는 Trusted Services RPC protocol `[5]`을 사용한다. user space reference implementation `[6]`은 Trusted Services client library인 `libts` `[7]`의 일부다.
모든 TS SP는 TS RPC protocol을 식별하는 같은 FF-A UUID를 사용한다. SP 하나는 PSA Crypto나 PSA ITS 같은 service를 하나 이상 host할 수 있다. service UUID가 service를 식별하며 같은 종류의 service는 한 SP에 두 번 존재할 수 없다. SP boot 중 각 service에는 message addressing을 단순화하는 짧은 `interface ID`가 할당된다.
partition, protocol, service를 구분하는 값이다.
user-space library에서 Secure Partition까지의 계층이다.
.. SPDX-License-Identifier: GPL-2.0
=================================
TS-TEE (Trusted Services project)
=================================
This driver provides access to secure services implemented by Trusted Services.
Trusted Services [1] is a TrustedFirmware.org project that provides a framework
for developing and deploying device Root of Trust services in FF-A [2] S-EL0
Secure Partitions. The project hosts the reference implementation of the Arm
Platform Security Architecture [3] for Arm A-profile devices.
The FF-A Secure Partitions (SP) are accessible through the FF-A driver [4] which
provides the low level communication for this driver. On top of that the Trusted
Services RPC protocol is used [5]. To use the driver from user space a reference
implementation is provided at [6], which is part of the Trusted Services client
library called libts [7].
All Trusted Services (TS) SPs have the same FF-A UUID; it identifies the TS RPC
protocol. A TS SP can host one or more services (e.g. PSA Crypto, PSA ITS, etc).
A service is identified by its service UUID; the same type of service cannot be
present twice in the same SP. During SP boot each service in the SP is assigned
an "interface ID". This is just a short ID to simplify message addressing.
Endpoint별 memory 공유와 TEE device
26-55일반적인 TEE 설계는 trusted OS와 memory를 한 번 공유하고 그 memory를 trusted OS에서 실행되는 여러 application과 통신할 때 재사용한다. 하지만 FF-A의 memory sharing은 endpoint 수준에서 작동하므로 memory는 특정 SP와 공유된다.
user space는 endpoint ID에 따라 각 SP와 memory를 별도로 공유할 수 있어야 한다. 따라서 발견된 TS SP마다 별도 TEE device를 등록한다. SP를 여는 것은 TEE device를 열고 TEE context를 만드는 것에 해당한다.
TS SP는 service를 하나 이상 host한다. service를 여는 동작은 해당 `tee_context`에서 session을 여는 것에 해당한다.
구성도에서 user-space Client와 `libts`는 generic TEE API로 kernel TEE subsystem과 TS-TEE driver에 접근한다. TS-TEE driver는 FF-A driver를 이용하고, secure world의 FF-A SPMC와 SPMD를 거쳐 TS RPC protocol로 Trusted Services SP에 연결된다.
원문의 ASCII 그림을 실행 영역과 protocol 계층으로 재구성했다.
FF-A endpoint 단위 공유를 generic TEE object로 표현한다.
The generic TEE design is to share memory at once with the Trusted OS, which can
then be reused to communicate with multiple applications running on the Trusted
OS. However, in case of FF-A, memory sharing works on an endpoint level, i.e.
memory is shared with a specific SP. User space has to be able to separately
share memory with each SP based on its endpoint ID; therefore a separate TEE
device is registered for each discovered TS SP. Opening the SP corresponds to
opening the TEE device and creating a TEE context. A TS SP hosts one or more
services. Opening a service corresponds to opening a session in the given
tee_context.
Overview of a system with Trusted Services components::
User space Kernel space Secure world
~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~
+--------+ +-------------+
| Client | | Trusted |
+--------+ | Services SP |
/\ +-------------+
|| /\
|| ||
|| ||
\/ \/
+-------+ +----------+--------+ +-------------+
| libts | | TEE | TS-TEE | | FF-A SPMC |
| | | subsys | driver | | + SPMD |
+-------+----------------+----+-----+--------+-----------+-------------+
| Generic TEE API | | FF-A | TS RPC protocol |
| IOCTL (TEE_IOC_*) | | driver | over FF-A |
+-----------------------------+ +--------+-------------------------+
Trusted Services 구현 참고 자료
56-71참고 자료는 Trusted Services project, Arm FF-A specification, Arm Platform Security Architecture, kernel FF-A driver, TS RPC ABI, `libts`의 Linux caller 및 build deployment를 연결한다.
각 링크가 제공하는 규격 또는 구현이다.
References
==========
[1] https://www.trustedfirmware.org/projects/trusted-services/
[2] https://developer.arm.com/documentation/den0077/
[3] https://www.arm.com/architecture/security-features/platform-security
[4] drivers/firmware/arm_ffa/
[5] https://trusted-services.readthedocs.io/en/v1.0.0/developer/service-access-protocols.html#abi
[6] https://git.trustedfirmware.org/TS/trusted-services.git/tree/components/rpc/ts_rpc/caller/linux/ts_rpc_caller_linux.c?h=v1.0.0
[7] https://git.trustedfirmware.org/TS/trusted-services.git/tree/deployments/libts/arm-linux/CMakeLists.txt?h=v1.0.0
요약·해설
ts-tee.rst:1-71Trusted Services가 FF-A Secure Partition에서 제공하는 service 식별, endpoint별 memory sharing, TEE device와 session mapping을 설명합니다.