Documentation/driver-api/cxl/devices/device-types.rst GitHub 원문 ↗

Linux 6.18.37 · Driver API / CXL / Devices

Devices and Protocols

CXL.io, CXL.cache, CXL.mem과 Type-1·2·3, switch, logical device와 DCD를 설명합니다.

Source pathDocumentation/driver-api/cxl/devices/device-types.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

device-types.rst:1-165

CXL.io, CXL.cache, CXL.mem과 Type-1·2·3, switch, logical device와 DCD를 설명합니다. 영어 원문 전체와 한국어 전문 번역을 함께 제공하며 표, protocol 이름, symbol, source path와 원문 줄 좌표를 보존합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 =====================
4 Devices and Protocols
5 =====================
6
7 The type of CXL device (Memory, Accelerator, etc) dictates many configuration steps. This section
8 covers some basic background on device types and on-device resources used by the platform and OS
9 which impact configuration.
10
11 Protocols
12 =========
13
14 There are three core protocols to CXL. For the purpose of this documentation,
15 we will only discuss very high level definitions as the specific hardware
16 details are largely abstracted away from Linux. See the CXL specification
17 for more details.
18
19 CXL.io
20 ------
21 The basic interaction protocol, similar to PCIe configuration mechanisms.
22 Typically used for initialization, configuration, and I/O access for anything
23 other than memory (CXL.mem) or cache (CXL.cache) operations.
24
25 The Linux CXL driver exposes access to .io functionality via the various sysfs
26 interfaces and /dev/cxl/ devices (which exposes direct access to device
27 mailboxes).
28
29 CXL.cache
30 ---------
31 The mechanism by which a device may coherently access and cache host memory.
32
33 Largely transparent to Linux once configured.
34
35 CXL.mem
36 ---------
37 The mechanism by which the CPU may coherently access and cache device memory.
38
39 Largely transparent to Linux once configured.
40
41
42 Device Types
43 ============
44
45 Type-1
46 ------
47
48 A Type-1 CXL device:
49
50 * Supports cxl.io and cxl.cache protocols
51 * Implements a fully coherent cache
52 * Allows Device-to-Host coherence and Host-to-Device snoops.
53 * Does NOT have host-managed device memory (HDM)
54
55 Typical examples of type-1 devices is a Smart NIC - which may want to
56 directly operate on host-memory (DMA) to store incoming packets. These
57 devices largely rely on CPU-attached memory.
58
59 Type-2
60 ------
61
62 A Type-2 CXL Device:
63
64 * Supports cxl.io, cxl.cache, and cxl.mem protocols
65 * Optionally implements coherent cache and Host-Managed Device Memory
66 * Is typically an accelerator device with high bandwidth memory.
67
68 The primary difference between a type-1 and type-2 device is the presence
69 of host-managed device memory, which allows the device to operate on a
70 local memory bank - while the CPU still has coherent DMA to the same memory.
71
72 This allows things like GPUs to expose their memory via DAX devices or file
73 descriptors, allows drivers and programs direct access to device memory
74 rather than use block-transfer semantics.
75
76 Type-3
77 ------
78
79 A Type-3 CXL Device
80
81 * Supports cxl.io and cxl.mem
82 * Implements Host-Managed Device Memory
83 * May provide either Volatile or Persistent memory capacity (or both).
84
85 A basic example of a type-3 device is a simple memory expander, whose
86 local memory capacity is exposed to the CPU for access directly via
87 basic coherent DMA.
88
89 Switch
90 ------
91
92 A CXL switch is a device capable of routing any CXL (and by extension, PCIe)
93 protocol between an upstream, downstream, or peer devices. Many devices, such
94 as Multi-Logical Devices, imply the presence of switching in some manner.
95
96 Logical Devices and Heads
97 -------------------------
98
99 A CXL device may present one or more "Logical Devices" to one or more hosts
100 (via physical "Heads").
101
102 A Single-Logical Device (SLD) is a device which presents a single device to
103 one or more heads.
104
105 A Multi-Logical Device (MLD) is a device which may present multiple devices
106 to one or more upstream devices.
107
108 A Single-Headed Device exposes only a single physical connection.
109
110 A Multi-Headed Device exposes multiple physical connections.
111
112 MHSLD
113 ~~~~~
114 A Multi-Headed Single-Logical Device (MHSLD) exposes a single logical
115 device to multiple heads which may be connected to one or more discrete
116 hosts. An example of this would be a simple memory-pool which may be
117 statically configured (prior to boot) to expose portions of its memory
118 to Linux via :doc:`CEDT <../platform/acpi/cedt>`.
119
120 MHMLD
121 ~~~~~
122 A Multi-Headed Multi-Logical Device (MHMLD) exposes multiple logical
123 devices to multiple heads which may be connected to one or more discrete
124 hosts. An example of this would be a Dynamic Capacity Device or which
125 may be configured at runtime to expose portions of its memory to Linux.
126
127 Example Devices
128 ===============
129
130 Memory Expander
131 ---------------
132 The simplest form of Type-3 device is a memory expander. A memory expander
133 exposes Host-Managed Device Memory (HDM) to Linux. This memory may be
134 Volatile or Non-Volatile (Persistent).
135
136 Memory Expanders will typically be considered a form of Single-Headed,
137 Single-Logical Device - as its form factor will typically be an add-in-card
138 (AIC) or some other similar form-factor.
139
140 The Linux CXL driver provides support for static or dynamic configuration of
141 basic memory expanders. The platform may program decoders prior to OS init
142 (e.g. auto-decoders), or the user may program the fabric if the platform
143 defers these operations to the OS.
144
145 Multiple Memory Expanders may be added to an external chassis and exposed to
146 a host via a head attached to a CXL switch. This is a "memory pool", and
147 would be considered an MHSLD or MHMLD depending on the management capabilities
148 provided by the switch platform.
149
150 As of v6.14, Linux does not provide a formalized interface to manage non-DCD
151 MHSLD or MHMLD devices.
152
153 Dynamic Capacity Device (DCD)
154 -----------------------------
155
156 A Dynamic Capacity Device is a Type-3 device which provides dynamic management
157 of memory capacity. The basic premise of a DCD to provide an allocator-like
158 interface for physical memory capacity to a "Fabric Manager" (an external,
159 privileged host with privileges to change configurations for other hosts).
160
161 A DCD manages "Memory Extents", which may be volatile or persistent. Extents
162 may also be exclusive to a single host or shared across multiple hosts.
163
164 As of v6.14, Linux does not provide a formalized interface to manage DCD
165 devices, however there is active work on LKML targeting future release.
166

3. 한국어 전문 번역

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

CXL 장치와 프로토콜

1-10
.. SPDX-License-Identifier: GPL-2.0

Memory, Accelerator 같은 CXL 장치 유형에 따라 많은 구성 단계가 달라집니다. 이 문서는 구성에 영향을 주며 플랫폼과 OS가 사용하는 장치 유형과 장치 내 자원의 기본 배경을 설명합니다.

세 가지 핵심 프로토콜

11-40

CXL에는 세 가지 핵심 프로토콜이 있습니다. 구체적인 하드웨어 세부 사항은 대부분 Linux에서 추상화되므로 여기서는 상위 수준의 정의만 설명하며, 자세한 내용은 CXL 사양을 참고하십시오.

`CXL.io`는 PCIe 구성 메커니즘과 비슷한 기본 상호작용 프로토콜입니다. 보통 초기화, 구성, 그리고 memory(`CXL.mem`)나 cache(`CXL.cache`) 이외의 I/O 접근에 사용합니다.

Linux CXL 드라이버는 여러 sysfs 인터페이스와 장치 mailbox에 직접 접근하게 하는 `/dev/cxl/` 장치를 통해 `.io` 기능 접근을 제공합니다.

`CXL.cache`는 장치가 host memory에 coherent하게 접근하고 이를 cache할 수 있게 하는 메커니즘입니다. 구성한 뒤에는 대부분 Linux에 투명합니다.

`CXL.mem`은 CPU가 device memory에 coherent하게 접근하고 이를 cache할 수 있게 하는 메커니즘입니다. 이 역시 구성한 뒤에는 대부분 Linux에 투명합니다.

Type-1 장치

41-58

Type-1 CXL 장치는 다음 특성을 가집니다.

  • `CXL.io`와 `CXL.cache` 프로토콜을 지원합니다.
  • 완전한 coherent cache를 구현합니다.
  • Device-to-Host coherence와 Host-to-Device snoop을 허용합니다.
  • Host-Managed Device Memory(HDM)는 갖지 않습니다.

일반적인 예는 들어오는 packet을 저장하기 위해 host memory에 직접 DMA하려는 Smart NIC입니다. 이런 장치는 대체로 CPU에 연결된 메모리에 의존합니다.

Type-2 장치

59-75

Type-2 CXL 장치는 다음 특성을 가집니다.

  • `CXL.io`, `CXL.cache`, `CXL.mem` 프로토콜을 모두 지원합니다.
  • coherent cache와 Host-Managed Device Memory를 선택적으로 구현합니다.
  • 보통 high-bandwidth memory를 가진 accelerator 장치입니다.

Type-1과 Type-2의 주된 차이는 host-managed device memory의 존재입니다. 장치는 local memory bank에서 동작할 수 있고 CPU도 같은 메모리에 coherent DMA할 수 있습니다.

따라서 GPU 같은 장치는 자신의 메모리를 DAX 장치나 file descriptor로 노출할 수 있고, 드라이버와 프로그램은 block-transfer 방식 대신 device memory에 직접 접근할 수 있습니다.

Type-3 장치

76-88

Type-3 CXL 장치는 다음 특성을 가집니다.

  • `CXL.io`와 `CXL.mem`을 지원합니다.
  • Host-Managed Device Memory를 구현합니다.
  • volatile 또는 persistent memory 용량 중 하나나 둘 다 제공할 수 있습니다.

기본적인 예는 단순 memory expander입니다. 그 local memory 용량을 CPU에 노출해 기본 coherent DMA로 직접 접근하게 합니다.

CXL switch

89-95

CXL switch는 upstream, downstream 또는 peer 장치 사이에서 모든 CXL 프로토콜과 확장상 PCIe 프로토콜을 routing할 수 있습니다. Multi-Logical Device를 비롯한 여러 장치는 어떤 형태로든 switching이 있음을 전제로 합니다.

Logical Device와 Head

96-126

CXL 장치는 물리적 `Head`를 통해 하나 이상의 host에 하나 이상의 Logical Device를 제시할 수 있습니다. Single-Logical Device(SLD)는 하나 이상의 head에 단일 장치를 제시하고, Multi-Logical Device(MLD)는 하나 이상의 upstream 장치에 여러 장치를 제시할 수 있습니다.

Single-Headed Device는 물리 연결 하나만 노출하며 Multi-Headed Device는 여러 물리 연결을 노출합니다.

Multi-Headed Single-Logical Device(MHSLD)는 여러 head에 단일 logical device를 노출하며, head는 하나 이상의 개별 host에 연결될 수 있습니다. 예를 들어 부팅 전에 정적으로 구성해 `CEDT <../platform/acpi/cedt>`를 통해 메모리 일부를 Linux에 노출하는 단순 memory pool이 있습니다.

Multi-Headed Multi-Logical Device(MHMLD)는 여러 logical device를 여러 head에 노출하며, head는 하나 이상의 개별 host에 연결될 수 있습니다. 실행 중에 메모리 일부를 Linux에 노출하도록 구성할 수 있는 Dynamic Capacity Device가 예입니다.

Memory Expander

127-152

가장 단순한 Type-3 장치는 memory expander입니다. Host-Managed Device Memory(HDM)를 Linux에 노출하며 이 메모리는 volatile 또는 non-volatile(persistent)일 수 있습니다.

Memory Expander는 보통 add-in card(AIC)나 비슷한 form factor이므로 Single-Headed, Single-Logical Device로 간주합니다.

Linux CXL 드라이버는 기본 memory expander의 정적 또는 동적 구성을 지원합니다. 플랫폼이 OS 초기화 전에 decoder를 프로그래밍할 수도 있고, 플랫폼이 이 작업을 OS에 미룬다면 사용자가 fabric을 프로그래밍할 수도 있습니다.

여러 Memory Expander를 외부 chassis에 추가하고 CXL switch에 연결된 head를 통해 host에 노출하면 memory pool이 됩니다. switch 플랫폼의 관리 기능에 따라 MHSLD 또는 MHMLD로 간주합니다.

Linux v6.14 기준으로 non-DCD MHSLD 또는 MHMLD 장치를 관리하는 정형화된 인터페이스는 없습니다.

Dynamic Capacity Device

153-165

Dynamic Capacity Device(DCD)는 메모리 용량의 동적 관리를 제공하는 Type-3 장치입니다. 기본 개념은 물리 메모리 용량에 allocator와 비슷한 인터페이스를 Fabric Manager에 제공하는 것입니다. Fabric Manager는 다른 host의 구성을 바꿀 권한을 가진 외부의 privileged host입니다.

DCD는 volatile 또는 persistent일 수 있는 Memory Extent를 관리합니다. Extent는 한 host 전용일 수도 있고 여러 host가 공유할 수도 있습니다.

Linux v6.14 기준으로 DCD 장치를 관리하는 정형화된 인터페이스는 없지만, 향후 릴리스를 목표로 LKML에서 개발이 활발히 진행 중입니다.