← Documents Documentation/arch/arm64/arm-cca.rst GitHub 원문 ↗

Linux 6.18.37 · Architecture

Arm Confidential Compute Architecture

Arm RME의 네 world, RMM·RMI·RSI, protected/shared IPA, RIPAS 전환과 Linux Realm guest 부팅 요구사항을 설명합니다.

Source pathDocumentation/arch/arm64/arm-cca.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

arm-cca.rst:1-69

CCA의 Realm은 Normal World hypervisor가 guest code와 data를 직접 볼 수 없게 하면서, RMM이 stage-2 mapping과 memory state 전환을 중재하는 confidential VM 환경입니다.

RME의 네 world
World주 역할Realm memory 접근
NormalHost hypervisor·emulated deviceShared IPA만 자유롭게 변경
Secure기존 secure serviceRealm 보호 경계 밖
Root최상위 RME 관리 기반RME trust root
RealmRMM과 confidential guestProtected IPA 사용

기존 두 world model에 Root와 Realm이 추가됩니다.

Realm 제어 interface
Normal hypervisorRMIRMMStage-2 mapping·vCPU 실행
Realm guestRSIRMMAttestation·RIPAS RAM/EMPTY 전환

Normal World와 Realm guest는 서로 다른 interface로 RMM에 요청합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 =====================================
4 Arm Confidential Compute Architecture
5 =====================================
6
7 Arm systems that support the Realm Management Extension (RME) contain
8 hardware to allow a VM guest to be run in a way which protects the code
9 and data of the guest from the hypervisor. It extends the older "two
10 world" model (Normal and Secure World) into four worlds: Normal, Secure,
11 Root and Realm. Linux can then also be run as a guest to a monitor
12 running in the Realm world.
13
14 The monitor running in the Realm world is known as the Realm Management
15 Monitor (RMM) and implements the Realm Management Monitor
16 specification[1]. The monitor acts a bit like a hypervisor (e.g. it runs
17 in EL2 and manages the stage 2 page tables etc of the guests running in
18 Realm world), however much of the control is handled by a hypervisor
19 running in the Normal World. The Normal World hypervisor uses the Realm
20 Management Interface (RMI) defined by the RMM specification to request
21 the RMM to perform operations (e.g. mapping memory or executing a vCPU).
22
23 The RMM defines an environment for guests where the address space (IPA)
24 is split into two. The lower half is protected - any memory that is
25 mapped in this half cannot be seen by the Normal World and the RMM
26 restricts what operations the Normal World can perform on this memory
27 (e.g. the Normal World cannot replace pages in this region without the
28 guest's cooperation). The upper half is shared, the Normal World is free
29 to make changes to the pages in this region, and is able to emulate MMIO
30 devices in this region too.
31
32 A guest running in a Realm may also communicate with the RMM using the
33 Realm Services Interface (RSI) to request changes in its environment or
34 to perform attestation about its environment. In particular it may
35 request that areas of the protected address space are transitioned
36 between 'RAM' and 'EMPTY' (in either direction). This allows a Realm
37 guest to give up memory to be returned to the Normal World, or to
38 request new memory from the Normal World. Without an explicit request
39 from the Realm guest the RMM will otherwise prevent the Normal World
40 from making these changes.
41
42 Linux as a Realm Guest
43 ----------------------
44
45 To run Linux as a guest within a Realm, the following must be provided
46 either by the VMM or by a `boot loader` run in the Realm before Linux:
47
48 * All protected RAM described to Linux (by DT or ACPI) must be marked
49 RIPAS RAM before handing control over to Linux.
50
51 * MMIO devices must be either unprotected (e.g. emulated by the Normal
52 World) or marked RIPAS DEV.
53
54 * MMIO devices emulated by the Normal World and used very early in boot
55 (specifically earlycon) must be specified in the upper half of IPA.
56 For earlycon this can be done by specifying the address on the
57 command line, e.g. with an IPA size of 33 bits and the base address
58 of the emulated UART at 0x1000000: ``earlycon=uart,mmio,0x101000000``
59
60 * Linux will use bounce buffers for communicating with unprotected
61 devices. It will transition some protected memory to RIPAS EMPTY and
62 expect to be able to access unprotected pages at the same IPA address
63 but with the highest valid IPA bit set. The expectation is that the
64 VMM will remove the physical pages from the protected mapping and
65 provide those pages as unprotected pages.
66
67 References
68 ----------
69 [1] https://developer.arm.com/documentation/den0137/
70

3. 한국어 전문 번역

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

RME와 네 개의 world

1-12

SPDX license identifier는 `GPL-2.0`입니다. Realm Management Extension(RME)을 지원하는 Arm 시스템에는 VM guest의 code와 data를 hypervisor로부터 보호하며 실행할 수 있는 hardware가 있습니다.

RME는 기존의 Normal World와 Secure World라는 두 world model을 Normal, Secure, Root, Realm의 네 world로 확장합니다. Linux도 Realm world에서 실행되는 monitor의 guest로 실행할 수 있습니다.

RMM·RMI와 Realm 주소 공간

13-30

Realm world에서 실행되는 monitor를 RMM(Realm Management Monitor)이라 하며 Realm Management Monitor 사양 [1]을 구현합니다. RMM은 EL2에서 실행되고 Realm guest의 stage 2 page table 등을 관리하므로 hypervisor와 비슷하지만, 제어의 상당 부분은 Normal World에서 실행되는 hypervisor가 담당합니다.

Normal World hypervisor는 RMM 사양이 정의한 RMI(Realm Management Interface)로 memory mapping이나 vCPU 실행 같은 작업을 RMM에 요청합니다.

RMM은 guest address space인 IPA를 두 절반으로 나눕니다. 아래쪽 절반은 protected 영역입니다. 이곳에 map한 memory는 Normal World가 볼 수 없고, RMM은 guest 협력 없이 이 영역의 page를 교체하는 등의 Normal World 작업을 제한합니다.

위쪽 절반은 shared 영역입니다. Normal World가 이 영역의 page를 자유롭게 바꿀 수 있으며 이 영역의 MMIO device도 emulate할 수 있습니다.

RSI와 RIPAS 전환

31-41

Realm에서 실행되는 guest는 RSI(Realm Services Interface)로 RMM과 통신해 실행 환경 변경이나 환경 attestation을 요청할 수 있습니다.

특히 protected address space의 영역을 `RAM`과 `EMPTY` 사이에서 양방향으로 전환할 수 있습니다. Realm guest는 memory를 포기해 Normal World로 돌려보내거나 Normal World에 새 memory를 요청할 수 있습니다. Realm guest의 명시적인 요청이 없으면 RMM은 Normal World가 이런 변경을 하지 못하게 합니다.

Linux Realm guest의 부팅 요구사항

42-66

Linux를 Realm 안의 guest로 실행하려면 VMM 또는 Linux보다 먼저 Realm에서 실행되는 boot loader가 다음 조건을 제공해야 합니다.

  • DT나 ACPI로 Linux에 설명하는 모든 protected RAM은 Linux에 제어권을 넘기기 전에 `RIPAS RAM`으로 표시해야 합니다.
  • MMIO device는 Normal World가 emulate하는 경우처럼 unprotected 상태이거나 `RIPAS DEV`로 표시해야 합니다.
  • Normal World가 emulate하며 boot 극초기에 사용하는 MMIO device, 특히 `earlycon`은 IPA의 위쪽 절반에 지정해야 합니다. IPA가 33-bit이고 emulated UART base가 `0x1000000`이면 command line에 `earlycon=uart,mmio,0x101000000`을 지정할 수 있습니다.
  • Linux는 unprotected device와 통신할 때 bounce buffer를 사용합니다. 일부 protected memory를 `RIPAS EMPTY`로 전환하고 같은 IPA address에서 highest valid IPA bit를 설정한 unprotected page에 접근할 수 있기를 기대합니다. VMM은 protected mapping에서 physical page를 제거하고 그 page를 unprotected page로 제공해야 합니다.

참고 자료

67-69

[1] Realm Management Monitor 사양 `DEN0137`.