Documentation/driver-api/cxl/linux/example-configurations/intra-hb-interleave.rst GitHub 원문 ↗

Linux 6.18.37 · Driver API / CXL / Linux / Example Configurations

Intra-Host-Bridge Interleave

하나의 CXL Host Bridge 아래 두 Memory Expander를 2-way로 interleave하는 endpoint, bridge decoder 및 region mapping을 풀이합니다.

Source pathDocumentation/driver-api/cxl/linux/example-configurations/intra-hb-interleave.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

intra-hb-interleave.rst:1-291

이 예제는 `port1` 아래의 두 endpoint를 `decoder1.0`이 256-byte 단위로 번갈아 선택하고, `region0`이 `mem0`과 `mem1`의 endpoint decoder를 mapping하는 구성을 보여 줍니다. 원문 JSON의 따옴표 누락과 root decoder 설명·dump 사이의 불일치도 수정 없이 보존하고 별도로 해설합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ============================
4 Intra-Host-Bridge Interleave
5 ============================
6 This cxl-cli configuration dump shows the following host configuration:
7
8 * A single socket system with one CXL root
9 * CXL Root has Four (4) CXL Host Bridges
10 * One (1) CXL Host Bridges has two CXL Memory Expanders Attached
11 * The Host bridge decoder is programmed to interleave across the expanders.
12
13 This output is generated by :code:`cxl list -v` and describes the relationships
14 between objects exposed in :code:`/sys/bus/cxl/devices/`.
15
16 ::
17
18 [
19 {
20 "bus":"root0",
21 "provider":"ACPI.CXL",
22 "nr_dports":4,
23 "dports":[
24 {
25 "dport":"pci0000:00",
26 "alias":"ACPI0016:01",
27 "id":0
28 },
29 {
30 "dport":"pci0000:a8",
31 "alias":"ACPI0016:02",
32 "id":4
33 },
34 {
35 "dport":"pci0000:2a",
36 "alias":"ACPI0016:03",
37 "id":1
38 },
39 {
40 "dport":"pci0000:d2",
41 "alias":"ACPI0016:00",
42 "id":5
43 }
44 ],
45
46 This chunk shows the CXL "bus" (root0) has 4 downstream ports attached to CXL
47 Host Bridges. The `Root` can be considered the singular upstream port attached
48 to the platform's memory controller - which routes memory requests to it.
49
50 The `ports:root0` section lays out how each of these downstream ports are
51 configured. If a port is not configured (id's 0 and 1), they are omitted.
52
53 ::
54
55 "ports:root0":[
56 {
57 "port":"port1",
58 "host":"pci0000:d2",
59 "depth":1,
60 "nr_dports":3,
61 "dports":[
62 {
63 "dport":"0000:d2:01.1",
64 "alias":"device:02",
65 "id":0
66 },
67 {
68 "dport":"0000:d2:01.3",
69 "alias":"device:05",
70 "id":2
71 },
72 {
73 "dport":"0000:d2:07.1",
74 "alias":"device:0d",
75 "id":113
76 }
77 ],
78
79 This chunk shows the available downstream ports associated with the CXL Host
80 Bridge :code:`port1`. In this case, :code:`port1` has 3 available downstream
81 ports: :code:`dport1`, :code:`dport2`, and :code:`dport113`..
82
83 ::
84
85 "endpoints:port1":[
86 {
87 "endpoint":"endpoint5",
88 "host":"mem0",
89 "parent_dport":"0000:d2:01.1",
90 "depth":2,
91 "memdev":{
92 "memdev":"mem0",
93 "ram_size":137438953472,
94 "serial":0,
95 "numa_node":0,
96 "host":"0000:d3:00.0"
97 },
98 "decoders:endpoint5":[
99 {
100 "decoder":"decoder5.0",
101 "resource":825975898112,
102 "size":274877906944,
103 "interleave_ways":2,
104 "interleave_granularity":256,
105 "region":"region0",
106 "dpa_resource":0,
107 "dpa_size":137438953472,
108 "mode":"ram"
109 }
110 ]
111 },
112 {
113 "endpoint":"endpoint6",
114 "host":"mem1",
115 "parent_dport":"0000:d2:01.3,
116 "depth":2,
117 "memdev":{
118 "memdev":"mem1",
119 "ram_size":137438953472,
120 "serial":0,
121 "numa_node":0,
122 "host":"0000:a9:00.0"
123 },
124 "decoders:endpoint6":[
125 {
126 "decoder":"decoder6.0",
127 "resource":825975898112,
128 "size":274877906944,
129 "interleave_ways":2,
130 "interleave_granularity":256,
131 "region":"region0",
132 "dpa_resource":0,
133 "dpa_size":137438953472,
134 "mode":"ram"
135 }
136 ]
137 }
138 ],
139
140 This chunk shows the endpoints attached to the host bridge :code:`port1`.
141
142 :code:`endpoint5` contains a single configured decoder :code:`decoder5.0`
143 which has the same interleave configuration memory region they belong to
144 (show later).
145
146 Next we have the decoders belonging to the host bridge:
147
148 ::
149
150 "decoders:port1":[
151 {
152 "decoder":"decoder1.0",
153 "resource":825975898112,
154 "size":274877906944,
155 "interleave_ways":2,
156 "interleave_granularity":256,
157 "region":"region0",
158 "nr_targets":2,
159 "targets":[
160 {
161 "target":"0000:d2:01.1",
162 "alias":"device:02",
163 "position":0,
164 "id":0
165 },
166 {
167 "target":"0000:d2:01.3",
168 "alias":"device:05",
169 "position":1,
170 "id":0
171 }
172 ]
173 }
174 ]
175 },
176
177 Host Bridge :code:`port1` has a single decoder (:code:`decoder1.0`) with two
178 targets: :code:`dport1` and :code:`dport3` - which are attached to
179 :code:`endpoint5` and :code:`endpoint6` respectively.
180
181 The host bridge decoder interleaves these devices at a 256 byte granularity.
182
183 The next chunk shows the three CXL host bridges without attached endpoints.
184
185 ::
186
187 {
188 "port":"port2",
189 "host":"pci0000:00",
190 "depth":1,
191 "nr_dports":2,
192 "dports":[
193 {
194 "dport":"0000:00:01.3",
195 "alias":"device:55",
196 "id":2
197 },
198 {
199 "dport":"0000:00:07.1",
200 "alias":"device:5d",
201 "id":113
202 }
203 ]
204 },
205 {
206 "port":"port3",
207 "host":"pci0000:a8",
208 "depth":1,
209 "nr_dports":1,
210 "dports":[
211 {
212 "dport":"0000:a8:01.1",
213 "alias":"device:c3",
214 "id":0
215 }
216 ],
217 },
218 {
219 "port":"port4",
220 "host":"pci0000:2a",
221 "depth":1,
222 "nr_dports":1,
223 "dports":[
224 {
225 "dport":"0000:2a:01.1",
226 "alias":"device:d0",
227 "id":0
228 }
229 ]
230 }
231 ],
232
233 Next we have the `Root Decoders` belonging to :code:`root0`. This root decoder
234 applies the interleave across the downstream ports :code:`port1` and
235 :code:`port3` - with a granularity of 256 bytes.
236
237 This information is generated by the CXL driver reading the ACPI CEDT CMFWS.
238
239 ::
240
241 "decoders:root0":[
242 {
243 "decoder":"decoder0.0",
244 "resource":825975898112,
245 "size":274877906944,
246 "interleave_ways":1,
247 "max_available_extent":0,
248 "volatile_capable":true,
249 "nr_targets":2,
250 "targets":[
251 {
252 "target":"pci0000:a8",
253 "alias":"ACPI0016:02",
254 "position":1,
255 "id":4
256 },
257 ],
258
259 Finally we have the `Memory Region` associated with the `Root Decoder`
260 :code:`decoder0.0`. This region describes the overall interleave configuration
261 of the interleave set.
262
263 ::
264
265 "regions:decoder0.0":[
266 {
267 "region":"region0",
268 "resource":825975898112,
269 "size":274877906944,
270 "type":"ram",
271 "interleave_ways":2,
272 "interleave_granularity":256,
273 "decode_state":"commit",
274 "mappings":[
275 {
276 "position":1,
277 "memdev":"mem1",
278 "decoder":"decoder6.0"
279 },
280 {
281 "position":0,
282 "memdev":"mem0",
283 "decoder":"decoder5.0"
284 }
285 ]
286 }
287 ]
288 }
289 ]
290 }
291 ]
292

3. 한국어 전문 번역

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

Host Bridge 내부 interleave 구성

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

이 `Intra-Host-Bridge Interleave`의 `cxl-cli` configuration dump는 다음 host 구성을 보여 줍니다.

  • CXL root가 하나인 single-socket system입니다.
  • CXL Root에는 CXL Host Bridge가 네 개 있습니다.
  • 그중 한 CXL Host Bridge에 CXL Memory Expander 두 개가 연결되어 있습니다.
  • Host bridge decoder는 두 expander에 걸쳐 interleave하도록 programming되어 있습니다.

이 출력은 `cxl list -v`로 생성했으며 `/sys/bus/cxl/devices/`에 노출되는 object 사이의 관계를 설명합니다.

CXL root bus와 downstream port

18-52
[
  {
      "bus":"root0",
      "provider":"ACPI.CXL",
      "nr_dports":4,
      "dports":[
          {
              "dport":"pci0000:00",
              "alias":"ACPI0016:01",
              "id":0
          },
          {
              "dport":"pci0000:a8",
              "alias":"ACPI0016:02",
              "id":4
          },
          {
              "dport":"pci0000:2a",
              "alias":"ACPI0016:03",
              "id":1
          },
          {
              "dport":"pci0000:d2",
              "alias":"ACPI0016:00",
              "id":5
          }
      ],

이 부분은 CXL `bus`인 `root0`에 CXL Host Bridge로 연결되는 downstream port 네 개가 있음을 보여 줍니다. `Root`는 platform memory controller에 연결된 하나의 upstream port로 볼 수 있고, memory controller는 memory request를 이 port로 routing합니다.

`ports:root0` section은 각 downstream port의 구성을 펼쳐 보여 줍니다. 구성되지 않은 port, 즉 ID 0과 1은 이 section에서 생략됩니다.

Host Bridge port1의 downstream port

53-82
"ports:root0":[
    {
        "port":"port1",
        "host":"pci0000:d2",
        "depth":1,
        "nr_dports":3,
        "dports":[
            {
                "dport":"0000:d2:01.1",
                "alias":"device:02",
                "id":0
            },
            {
                "dport":"0000:d2:01.3",
                "alias":"device:05",
                "id":2
            },
            {
                "dport":"0000:d2:07.1",
                "alias":"device:0d",
                "id":113
            }
        ],

이 부분은 CXL Host Bridge `port1`에 연결된 사용 가능한 downstream port를 보여 줍니다. 여기서 `port1`에는 `dport1`, `dport2`, `dport113`이라는 downstream port 세 개가 있습니다.

port1의 두 endpoint

83-147
"endpoints:port1":[
    {
        "endpoint":"endpoint5",
        "host":"mem0",
        "parent_dport":"0000:d2:01.1",
        "depth":2,
        "memdev":{
            "memdev":"mem0",
            "ram_size":137438953472,
            "serial":0,
            "numa_node":0,
            "host":"0000:d3:00.0"
        },
        "decoders:endpoint5":[
            {
                "decoder":"decoder5.0",
                "resource":825975898112,
                "size":274877906944,
                "interleave_ways":2,
                "interleave_granularity":256,
                "region":"region0",
                "dpa_resource":0,
                "dpa_size":137438953472,
                "mode":"ram"
            }
        ]
    },
    {
        "endpoint":"endpoint6",
        "host":"mem1",
        "parent_dport":"0000:d2:01.3,
        "depth":2,
        "memdev":{
            "memdev":"mem1",
            "ram_size":137438953472,
            "serial":0,
            "numa_node":0,
            "host":"0000:a9:00.0"
        },
        "decoders:endpoint6":[
            {
                "decoder":"decoder6.0",
                "resource":825975898112,
                "size":274877906944,
                "interleave_ways":2,
                "interleave_granularity":256,
                "region":"region0",
                "dpa_resource":0,
                "dpa_size":137438953472,
                "mode":"ram"
            }
        ]
    }
],

이 부분은 host bridge `port1`에 연결된 endpoint를 보여 줍니다. `endpoint5`는 `mem0`과 `0000:d2:01.1`에 연결되고, `endpoint6`은 `mem1`과 `0000:d2:01.3`에 연결됩니다.

`endpoint5`의 `decoder5.0`과 `endpoint6`의 `decoder6.0`은 모두 뒤에서 나오는 memory region과 같은 2-way, 256-byte granularity 구성을 사용합니다. 각 decoder는 전체 274877906944-byte region 가운데 137438953472-byte DPA를 담당하며 mode는 `ram`입니다.

원문 JSON의 `endpoint6.parent_dport` 값은 닫는 따옴표가 빠진 `"0000:d2:01.3,` 형태입니다. 위 원문 블록은 이 표기를 수정하지 않고 그대로 보존합니다.

다음으로 host bridge 자체에 속한 decoder가 이어집니다.

port1의 Host Bridge decoder

148-184
    "decoders:port1":[
        {
            "decoder":"decoder1.0",
            "resource":825975898112,
            "size":274877906944,
            "interleave_ways":2,
            "interleave_granularity":256,
            "region":"region0",
            "nr_targets":2,
            "targets":[
                {
                    "target":"0000:d2:01.1",
                    "alias":"device:02",
                    "position":0,
                    "id":0
                },
                {
                    "target":"0000:d2:01.3",
                    "alias":"device:05",
                    "position":1,
                    "id":0
                }
            ]
        }
    ]
},

Host Bridge `port1`에는 decoder `decoder1.0`이 하나 있으며 target은 `dport1`과 원문 표기의 `dport3` 두 개입니다. 각각 `endpoint5`와 `endpoint6`에 연결됩니다. dump에서 실제 target 주소는 `0000:d2:01.1`과 `0000:d2:01.3`입니다.

이 host bridge decoder는 두 장치를 256-byte granularity로 interleave합니다.

다음 부분은 endpoint가 연결되지 않은 CXL host bridge 세 개를 보여 줍니다.

Endpoint가 없는 세 Host Bridge

185-232
    {
        "port":"port2",
        "host":"pci0000:00",
        "depth":1,
        "nr_dports":2,
        "dports":[
            {
                "dport":"0000:00:01.3",
                "alias":"device:55",
                "id":2
            },
            {
                "dport":"0000:00:07.1",
                "alias":"device:5d",
                "id":113
            }
        ]
    },
    {
        "port":"port3",
        "host":"pci0000:a8",
        "depth":1,
        "nr_dports":1,
        "dports":[
            {
                "dport":"0000:a8:01.1",
                "alias":"device:c3",
                "id":0
            }
        ],
    },
    {
        "port":"port4",
        "host":"pci0000:2a",
        "depth":1,
        "nr_dports":1,
        "dports":[
            {
                "dport":"0000:2a:01.1",
                "alias":"device:d0",
                "id":0
            }
        ]
    }
],

`port2`에는 downstream port 두 개가 있고 `port3`과 `port4`에는 하나씩 있지만, 어느 bridge에도 endpoint나 구성된 decoder가 표시되지 않습니다.

root0의 Root Decoder

233-258

원문 설명에 따르면 `root0`의 `Root Decoder`는 downstream port `port1`과 `port3`에 걸쳐 256-byte granularity로 interleave를 적용합니다. 이 정보는 CXL driver가 ACPI CEDT의 CFMWS를 읽어 생성하며, 원문에는 구조 이름이 `CMFWS`로 표기되어 있습니다.

"decoders:root0":[
    {
        "decoder":"decoder0.0",
        "resource":825975898112,
        "size":274877906944,
        "interleave_ways":1,
        "max_available_extent":0,
        "volatile_capable":true,
        "nr_targets":2,
        "targets":[
            {
                "target":"pci0000:a8",
                "alias":"ACPI0016:02",
                "position":1,
                "id":4
            },
        ],

다만 보존된 dump의 `decoder0.0`은 `interleave_ways`가 1이고 target list에는 `pci0000:a8` 하나만 기록되어 있어 앞 문장의 `port1`·`port3` 2-way 설명과 일치하지 않습니다. 번역은 설명과 dump를 각각 원문 그대로 반영합니다.

Root Decoder의 Memory Region

259-291

마지막은 `Root Decoder` `decoder0.0`과 연결된 `Memory Region`입니다. 이 region은 interleave set 전체의 구성을 설명합니다.

              "regions:decoder0.0":[
                  {
                      "region":"region0",
                      "resource":825975898112,
                      "size":274877906944,
                      "type":"ram",
                      "interleave_ways":2,
                      "interleave_granularity":256,
                      "decode_state":"commit",
                      "mappings":[
                          {
                              "position":1,
                              "memdev":"mem1",
                              "decoder":"decoder6.0"
                          },
                          {
                              "position":0,
                              "memdev":"mem0",
                              "decoder":"decoder5.0"
                          }
                      ]
                  }
              ]
          }
      ]
  }
]

`region0`은 274877906944-byte RAM region이며 2-way, 256-byte granularity로 `commit`된 상태입니다. mapping position 0은 `mem0`의 `decoder5.0`, position 1은 `mem1`의 `decoder6.0`입니다.

두 endpoint가 같은 `port1` 아래에 있으므로 실제 endpoint 선택 interleave는 `decoder1.0`에서 수행되고, 각 endpoint decoder는 자기 장치의 DPA 절반을 제공합니다.