Documentation/driver-api/cxl/linux/example-configurations/single-device.rst GitHub 원문 ↗

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

Single Device

하나의 Host Bridge와 하나의 Memory Expander를 잇는 1-way pass-through decoder 및 region mapping을 풀이합니다.

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

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

1. 요약·해설

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

요약과 해설

single-device.rst:1-246

이 예제에서는 `decoder0.0`, `decoder1.0`, `decoder5.0`이 모두 단일 target을 가리킵니다. `region0`의 HPA 128 GiB가 `mem0`의 DPA 128 GiB에 그대로 연결되므로 interleave가 발생하지 않습니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 =============
4 Single Device
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 CXL Host Bridges has a single CXL Memory Expander Attached
11 * No interleave is present.
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, 1, and 4), 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":137438953472,
103 "interleave_ways":1,
104 "region":"region0",
105 "dpa_resource":0,
106 "dpa_size":137438953472,
107 "mode":"ram"
108 }
109 ]
110 }
111 ],
112
113 This chunk shows the endpoints attached to the host bridge :code:`port1`.
114
115 :code:`endpoint5` contains a single configured decoder :code:`decoder5.0`
116 which has the same interleave configuration as :code:`region0` (shown later).
117
118 Next we have the decoders belonging to the host bridge:
119
120 ::
121
122 "decoders:port1":[
123 {
124 "decoder":"decoder1.0",
125 "resource":825975898112,
126 "size":137438953472,
127 "interleave_ways":1,
128 "region":"region0",
129 "nr_targets":1,
130 "targets":[
131 {
132 "target":"0000:d2:01.1",
133 "alias":"device:02",
134 "position":0,
135 "id":0
136 }
137 ]
138 }
139 ]
140 },
141
142 Host Bridge :code:`port1` has a single decoder (:code:`decoder1.0`), whose only
143 target is :code:`dport1` - which is attached to :code:`endpoint5`.
144
145 The next chunk shows the three CXL host bridges without attached endpoints.
146
147 ::
148
149 {
150 "port":"port2",
151 "host":"pci0000:00",
152 "depth":1,
153 "nr_dports":2,
154 "dports":[
155 {
156 "dport":"0000:00:01.3",
157 "alias":"device:55",
158 "id":2
159 },
160 {
161 "dport":"0000:00:07.1",
162 "alias":"device:5d",
163 "id":113
164 }
165 ]
166 },
167 {
168 "port":"port3",
169 "host":"pci0000:a8",
170 "depth":1,
171 "nr_dports":1,
172 "dports":[
173 {
174 "dport":"0000:a8:01.1",
175 "alias":"device:c3",
176 "id":0
177 }
178 ]
179 },
180 {
181 "port":"port4",
182 "host":"pci0000:2a",
183 "depth":1,
184 "nr_dports":1,
185 "dports":[
186 {
187 "dport":"0000:2a:01.1",
188 "alias":"device:d0",
189 "id":0
190 }
191 ]
192 }
193 ],
194
195 Next we have the `Root Decoders` belonging to :code:`root0`. This root decoder
196 is a pass-through decoder because :code:`interleave_ways` is set to :code:`1`.
197
198 This information is generated by the CXL driver reading the ACPI CEDT CMFWS.
199
200 ::
201
202 "decoders:root0":[
203 {
204 "decoder":"decoder0.0",
205 "resource":825975898112,
206 "size":137438953472,
207 "interleave_ways":1,
208 "max_available_extent":0,
209 "volatile_capable":true,
210 "nr_targets":1,
211 "targets":[
212 {
213 "target":"pci0000:d2",
214 "alias":"ACPI0016:00",
215 "position":0,
216 "id":5
217 }
218 ],
219
220 Finally we have the `Memory Region` associated with the `Root Decoder`
221 :code:`decoder0.0`. This region describes the discrete region associated
222 with the lone device.
223
224 ::
225
226 "regions:decoder0.0":[
227 {
228 "region":"region0",
229 "resource":825975898112,
230 "size":137438953472,
231 "type":"ram",
232 "interleave_ways":1,
233 "decode_state":"commit",
234 "mappings":[
235 {
236 "position":0,
237 "memdev":"mem0",
238 "decoder":"decoder5.0"
239 }
240 ]
241 }
242 ]
243 }
244 ]
245 }
246 ]
247

3. 한국어 전문 번역

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

단일 CXL Memory Expander 구성

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

이 `Single Device`의 `cxl-cli` configuration dump는 다음 host 구성을 보여 줍니다.

  • CXL root가 하나인 single-socket system입니다.
  • CXL Root에는 CXL Host Bridge가 네 개 있습니다.
  • 그중 한 CXL Host Bridge에 CXL Memory Expander 하나가 연결되어 있습니다.
  • Interleave는 없습니다.

이 출력은 `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, 4는 이 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-119
"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":137438953472,
                "interleave_ways":1,
                "region":"region0",
                "dpa_resource":0,
                "dpa_size":137438953472,
                "mode":"ram"
            }
        ]
    }
],

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

`endpoint5`에는 구성된 decoder `decoder5.0`이 하나 있습니다. 이 decoder는 뒤에서 나오는 `region0`과 같은 1-way 구성을 사용하며 137438953472-byte region 전체를 같은 크기의 DPA에 mapping합니다. mode는 `ram`입니다.

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

port1의 Host Bridge decoder

120-146
    "decoders:port1":[
        {
            "decoder":"decoder1.0",
            "resource":825975898112,
            "size":137438953472,
            "interleave_ways":1,
            "region":"region0",
            "nr_targets":1,
            "targets":[
                {
                    "target":"0000:d2:01.1",
                    "alias":"device:02",
                    "position":0,
                    "id":0
                }
            ]
        }
    ]
},

Host Bridge `port1`에는 decoder `decoder1.0`이 하나 있습니다. 유일한 target은 `dport1`인 `0000:d2:01.1`이며, 이 port에는 `endpoint5`가 연결되어 있습니다.

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

Endpoint가 없는 세 Host Bridge

147-199
    {
        "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`입니다. `interleave_ways`가 `1`이므로 이 root decoder는 interleave 없이 request를 그대로 전달하는 pass-through decoder입니다.

이 정보는 CXL driver가 ACPI CEDT의 CFMWS를 읽어 생성하며, 원문에는 구조 이름이 `CMFWS`로 표기되어 있습니다.

root0의 pass-through Root Decoder

200-223
"decoders:root0":[
    {
        "decoder":"decoder0.0",
        "resource":825975898112,
        "size":137438953472,
        "interleave_ways":1,
        "max_available_extent":0,
        "volatile_capable":true,
        "nr_targets":1,
        "targets":[
            {
                "target":"pci0000:d2",
                "alias":"ACPI0016:00",
                "position":0,
                "id":5
            }
        ],

`decoder0.0`은 137438953472-byte HPA range를 1-way로 decode합니다. 유일한 target은 position 0의 `pci0000:d2`, 즉 `ACPI0016:00` Host Bridge입니다.

마지막은 `Root Decoder` `decoder0.0`과 연결된 `Memory Region`입니다. 이 region은 단일 device에 연결된 독립적인 region을 설명합니다.

단일 device의 Memory Region

224-246
              "regions:decoder0.0":[
                  {
                      "region":"region0",
                      "resource":825975898112,
                      "size":137438953472,
                      "type":"ram",
                      "interleave_ways":1,
                      "decode_state":"commit",
                      "mappings":[
                          {
                              "position":0,
                              "memdev":"mem0",
                              "decoder":"decoder5.0"
                          }
                      ]
                  }
              ]
          }
      ]
  }
]

`region0`은 137438953472-byte RAM region이며 `interleave_ways`가 1이고 `commit`된 상태입니다. 유일한 mapping은 position 0의 `mem0`과 `decoder5.0`입니다.

따라서 root decoder, host bridge decoder, endpoint decoder가 모두 하나의 target만 선택하며, HPA range 전체가 `mem0`의 DPA range 전체로 이어집니다.