요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
=====================================
Arm Confidential Compute Architecture
=====================================
Arm systems that support the Realm Management Extension (RME) contain
hardware to allow a VM guest to be run in a way which protects the code
and data of the guest from the hypervisor. It extends the older "two
world" model (Normal and Secure World) into four worlds: Normal, Secure,
Root and Realm. Linux can then also be run as a guest to a monitor
running in the Realm world.
The monitor running in the Realm world is known as the Realm Management
Monitor (RMM) and implements the Realm Management Monitor
specification[1]. The monitor acts a bit like a hypervisor (e.g. it runs
in EL2 and manages the stage 2 page tables etc of the guests running in
Realm world), however much of the control is handled by a hypervisor
running in the Normal World. The Normal World hypervisor uses the Realm
Management Interface (RMI) defined by the RMM specification to request
the RMM to perform operations (e.g. mapping memory or executing a vCPU).
The RMM defines an environment for guests where the address space (IPA)
is split into two. The lower half is protected - any memory that is
mapped in this half cannot be seen by the Normal World and the RMM
restricts what operations the Normal World can perform on this memory
(e.g. the Normal World cannot replace pages in this region without the
guest's cooperation). The upper half is shared, the Normal World is free
to make changes to the pages in this region, and is able to emulate MMIO
devices in this region too.
A guest running in a Realm may also communicate with the RMM using the
Realm Services Interface (RSI) to request changes in its environment or
to perform attestation about its environment. In particular it may
request that areas of the protected address space are transitioned
between 'RAM' and 'EMPTY' (in either direction). This allows a Realm
guest to give up memory to be returned to the Normal World, or to
request new memory from the Normal World. Without an explicit request
from the Realm guest the RMM will otherwise prevent the Normal World
from making these changes.
Linux as a Realm Guest
----------------------
To run Linux as a guest within a Realm, the following must be provided
either by the VMM or by a `boot loader` run in the Realm before Linux:
* All protected RAM described to Linux (by DT or ACPI) must be marked
RIPAS RAM before handing control over to Linux.
* MMIO devices must be either unprotected (e.g. emulated by the Normal
World) or marked RIPAS DEV.
* MMIO devices emulated by the Normal World and used very early in boot
(specifically earlycon) must be specified in the upper half of IPA.
For earlycon this can be done by specifying the address on the
command line, e.g. with an IPA size of 33 bits and the base address
of the emulated UART at 0x1000000: ``earlycon=uart,mmio,0x101000000``
* Linux will use bounce buffers for communicating with unprotected
devices. It will transition some protected memory to RIPAS EMPTY and
expect to be able to access unprotected pages at the same IPA address
but with the highest valid IPA bit set. The expectation is that the
VMM will remove the physical pages from the protected mapping and
provide those pages as unprotected pages.
References
----------
[1] https://developer.arm.com/documentation/den0137/
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
RME와 네 개의 world
1-12SPDX 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-30Realm 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-41Realm에서 실행되는 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-66Linux를 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`.
요약과 해설
arm-cca.rst:1-69CCA의 Realm은 Normal World hypervisor가 guest code와 data를 직접 볼 수 없게 하면서, RMM이 stage-2 mapping과 memory state 전환을 중재하는 confidential VM 환경입니다.
기존 두 world model에 Root와 Realm이 추가됩니다.
Normal World와 Realm guest는 서로 다른 interface로 RMM에 요청합니다.