요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
* ARM Secure world bindings
ARM CPUs with TrustZone support have two distinct address spaces,
"Normal" and "Secure". Most devicetree consumers (including the Linux
kernel) are not TrustZone aware and run entirely in either the Normal
world or the Secure world. However some devicetree consumers are
TrustZone aware and need to be able to determine whether devices are
visible only in the Secure address space, only in the Normal address
space, or visible in both. (One example of that situation would be a
virtual machine which boots Secure firmware and wants to tell the
firmware about the layout of the machine via devicetree.)
The general principle of the naming scheme for Secure world bindings
is that any property that needs a different value in the Secure world
can be supported by prefixing the property name with "secure-". So for
instance "secure-foo" would override "foo". For property names with
a vendor prefix, the Secure variant of "vendor,foo" would be
"vendor,secure-foo". If there is no "secure-" property then the Secure
world value is the same as specified for the Normal world by the
non-prefixed property. However, only the properties listed below may
validly have "secure-" versions; this list will be enlarged on a
case-by-case basis.
Defining the bindings in this way means that a device tree which has
been annotated to indicate the presence of Secure-only devices can
still be processed unmodified by existing Non-secure software (and in
particular by the kernel).
Note that it is still valid for bindings intended for purely Secure
world consumers (like kernels that run entirely in Secure) to simply
describe the view of Secure world using the standard bindings. These
secure- bindings only need to be used where both the Secure and Normal
world views need to be described in a single device tree.
Valid Secure world properties
-----------------------------
- secure-status : specifies whether the device is present and usable
in the secure world. The combination of this with "status" allows
the various possible combinations of device visibility to be
specified. If "secure-status" is not specified it defaults to the
same value as "status"; if "status" is not specified either then
both default to "okay". This means the following combinations are
possible:
/* Neither specified: default to visible in both S and NS */
secure-status = "okay"; /* visible in both */
status = "okay"; /* visible in both */
status = "okay"; secure-status = "okay"; /* visible in both */
secure-status = "disabled"; /* NS-only */
status = "okay"; secure-status = "disabled"; /* NS-only */
status = "disabled"; secure-status = "okay"; /* S-only */
status = "disabled"; /* disabled in both */
status = "disabled"; secure-status = "disabled"; /* disabled in both */
The secure-chosen node
----------------------
Similar to the /chosen node which serves as a place for passing data
between firmware and the operating system, the /secure-chosen node may
be used to pass data to the Secure OS. Only the properties defined
below may appear in the /secure-chosen node.
- stdout-path : specifies the device to be used by the Secure OS for
its console output. The syntax is the same as for /chosen/stdout-path.
If the /secure-chosen node exists but the stdout-path property is not
present, the Secure OS should not perform any console output. If
/secure-chosen does not exist, the Secure OS should use the value of
/chosen/stdout-path instead (that is, use the same device as the
Normal world OS).
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
ARM Secure world 속성 이름 원칙
1-34ARM Secure world 바인딩
TrustZone을 지원하는 ARM CPU에는 `Normal`과 `Secure`라는 서로 구분된 두 주소 공간이 있습니다. Linux 커널을 포함한 대부분의 Device Tree 소비자는 TrustZone을 인식하지 못하며 Normal world 또는 Secure world 중 한쪽에서만 실행됩니다.
일부 소비자는 TrustZone을 인식하므로 장치가 Secure 주소 공간에만 보이는지, Normal 주소 공간에만 보이는지, 양쪽 모두에 보이는지 판단해야 합니다. 예를 들어 Secure firmware를 부팅하는 가상 머신이 Device Tree를 통해 firmware에 머신 구성을 전달하는 경우가 이에 해당합니다.
Secure world에서 값이 달라져야 하는 속성은 이름 앞에 `secure-`를 붙입니다. 예를 들어 `secure-foo`는 `foo`를 덮어씁니다. vendor prefix가 있는 `vendor,foo`의 Secure 변형은 `vendor,secure-foo`입니다.
`secure-` 속성이 없으면 Secure world 값은 prefix가 없는 Normal world 속성의 값과 같습니다. 단, 아래에 명시된 속성만 `secure-` 변형을 가질 수 있으며 이 목록은 사례별로 확장됩니다.
이 방식으로 바인딩하면 Secure 전용 장치가 표시된 Device Tree도 기존 Non-secure 소프트웨어, 특히 커널이 수정 없이 처리할 수 있습니다.
Secure world에서만 실행되는 커널처럼 순수 Secure world 소비자를 위한 바인딩은 표준 바인딩으로 Secure world의 관점만 기술해도 유효합니다. `secure-` 바인딩은 한 Device Tree 안에 Secure와 Normal world의 관점을 모두 기술할 때만 필요합니다.
Normal world 속성과 Secure world 전용 속성의 해석 순서입니다.
secure-status와 장치 가시성
35-55`secure-status`는 장치가 Secure world에 존재하며 사용할 수 있는지를 지정합니다. `status`와 조합하면 가능한 장치 가시성 상태를 모두 표현할 수 있습니다.
`secure-status`가 없으면 `status`와 같은 값이 기본값입니다. `status`도 없으면 두 속성 모두 `okay`가 기본값이므로 장치는 양쪽 world에서 보입니다.
/* Neither specified: default to visible in both S and NS */
secure-status = "okay"; /* visible in both */
status = "okay"; /* visible in both */
status = "okay"; secure-status = "okay"; /* visible in both */
secure-status = "disabled"; /* NS-only */
status = "okay"; secure-status = "disabled"; /* NS-only */
status = "disabled"; secure-status = "okay"; /* S-only */
status = "disabled"; /* disabled in both */
status = "disabled"; secure-status = "disabled"; /* disabled in both */
`status`와 `secure-status` 조합의 의미를 정리합니다.
secure-chosen 노드
56-70firmware와 운영체제 사이에 데이터를 전달하는 `/chosen`과 비슷하게 `/secure-chosen`은 Secure OS에 데이터를 전달할 수 있습니다. 이 노드에는 아래에서 정의한 속성만 나타날 수 있습니다.
`stdout-path`는 Secure OS가 console 출력에 사용할 장치를 지정하며 문법은 `/chosen/stdout-path`와 같습니다.
`/secure-chosen` 노드는 있지만 `stdout-path`가 없으면 Secure OS는 console 출력을 하지 않아야 합니다. `/secure-chosen` 자체가 없으면 Secure OS는 `/chosen/stdout-path` 값을 사용하여 Normal world OS와 같은 장치로 출력해야 합니다.
`/secure-chosen` 존재 여부에 따른 stdout 장치 결정 절차입니다.
요약과 해설
secure.txt:1-70`secure-` 속성 override, `secure-status` 조합 및 `/secure-chosen` fallback 규칙을 설명합니다.