@@ -34,14 +34,40 @@ into a single memory region. The memory region has been converted to dax. ::
34
34
decoder1.0 decoder5.0 endpoint5 port1 region0
35
35
decoder2.0 decoder5.1 endpoint6 port2 root0
36
36
37
+
38
+ .. kernel-render :: DOT
39
+ :alt: Digraph of CXL fabric describing host-bridge interleaving
40
+ :caption: Diagraph of CXL fabric with a host-bridge interleave memory region
41
+
42
+ digraph foo {
43
+ "root0" -> "port1";
44
+ "root0" -> "port3";
45
+ "root0" -> "decoder0.0";
46
+ "port1" -> "endpoint5";
47
+ "port3" -> "endpoint6";
48
+ "port1" -> "decoder1.0";
49
+ "port3" -> "decoder3.0";
50
+ "endpoint5" -> "decoder5.0";
51
+ "endpoint6" -> "decoder6.0";
52
+ "decoder0.0" -> "region0";
53
+ "decoder0.0" -> "decoder1.0";
54
+ "decoder0.0" -> "decoder3.0";
55
+ "decoder1.0" -> "decoder5.0";
56
+ "decoder3.0" -> "decoder6.0";
57
+ "decoder5.0" -> "region0";
58
+ "decoder6.0" -> "region0";
59
+ "region0" -> "dax_region0";
60
+ "dax_region0" -> "dax0.0";
61
+ }
62
+
37
63
For this section we'll explore the devices present in this configuration, but
38
64
we'll explore more configurations in-depth in example configurations below.
39
65
40
66
Base Devices
41
67
------------
42
68
Most devices in a CXL fabric are a `port ` of some kind (because each
43
69
device mostly routes request from one device to the next, rather than
44
- provide a manageable service).
70
+ provide a direct service).
45
71
46
72
Root
47
73
~~~~
@@ -53,6 +79,8 @@ The Root contains links to:
53
79
54
80
* `Host Bridge Ports ` defined by ACPI CEDT CHBS.
55
81
82
+ * `Downstream Ports ` typically connected to `Host Bridge Ports `.
83
+
56
84
* `Root Decoders ` defined by ACPI CEDT CFMWS.
57
85
58
86
::
@@ -150,6 +178,27 @@ device configuration data. ::
150
178
driver label_storage_size pmem serial
151
179
firmware numa_node ram subsystem
152
180
181
+ A Memory Device is a discrete base object that is not a port. While the
182
+ physical device it belongs to may also host an `endpoint `, the relationship
183
+ between an `endpoint ` and a `memdev ` is not captured in sysfs.
184
+
185
+ Port Relationships
186
+ ~~~~~~~~~~~~~~~~~~
187
+ In our example described above, there are four host bridges attached to the
188
+ root, and two of the host bridges have one endpoint attached.
189
+
190
+ .. kernel-render :: DOT
191
+ :alt: Digraph of CXL fabric describing host-bridge interleaving
192
+ :caption: Diagraph of CXL fabric with a host-bridge interleave memory region
193
+
194
+ digraph foo {
195
+ "root0" -> "port1";
196
+ "root0" -> "port2";
197
+ "root0" -> "port3";
198
+ "root0" -> "port4";
199
+ "port1" -> "endpoint5";
200
+ "port3" -> "endpoint6";
201
+ }
153
202
154
203
Decoders
155
204
--------
@@ -322,6 +371,29 @@ settings (granularity and ways must be the same).
322
371
Endpoint decoders are created during :code: `cxl_endpoint_port_probe ` in the
323
372
:code: `cxl_port ` driver, and is created based on a PCI device's DVSEC registers.
324
373
374
+ Decoder Relationships
375
+ ~~~~~~~~~~~~~~~~~~~~~
376
+ In our example described above, there is one root decoder which routes memory
377
+ accesses over two host bridges. Each host bridge has a decoder which routes
378
+ access to their singular endpoint targets. Each endpoint has a decoder which
379
+ translates HPA to DPA and services the memory request.
380
+
381
+ The driver validates relationships between ports by decoder programming, so
382
+ we can think of decoders being related in a similarly hierarchical fashion to
383
+ ports.
384
+
385
+ .. kernel-render :: DOT
386
+ :alt: Digraph of hierarchical relationship between root, switch, and endpoint decoders.
387
+ :caption: Diagraph of CXL root, switch, and endpoint decoders.
388
+
389
+ digraph foo {
390
+ "root0" -> "decoder0.0";
391
+ "decoder0.0" -> "decoder1.0";
392
+ "decoder0.0" -> "decoder3.0";
393
+ "decoder1.0" -> "decoder5.0";
394
+ "decoder3.0" -> "decoder6.0";
395
+ }
396
+
325
397
Regions
326
398
-------
327
399
@@ -348,6 +420,17 @@ The interleave settings in a `Memory Region` describe the configuration of the
348
420
`Interleave Set ` - and are what can be expected to be seen in the endpoint
349
421
interleave settings.
350
422
423
+ .. kernel-render :: DOT
424
+ :alt: Digraph of CXL memory region relationships between root and endpoint decoders.
425
+ :caption: Regions are created based on root decoder configurations. Endpoint decoders
426
+ must be programmed with the same interleave settings as the region.
427
+
428
+ digraph foo {
429
+ "root0" -> "decoder0.0";
430
+ "decoder0.0" -> "region0";
431
+ "region0" -> "decoder5.0";
432
+ "region0" -> "decoder6.0";
433
+ }
351
434
352
435
DAX Region
353
436
~~~~~~~~~~
@@ -360,7 +443,6 @@ for more details. ::
360
443
dax0.0 devtype modalias uevent
361
444
dax_region driver subsystem
362
445
363
-
364
446
Mailbox Interfaces
365
447
------------------
366
448
A mailbox command interface for each device is exposed in ::
@@ -418,17 +500,30 @@ the relationships between a decoder and it's parent.
418
500
419
501
For example, in a `Cross-Link First ` interleave setup with 16 endpoints
420
502
attached to 4 host bridges, linux expects the following ways/granularity
421
- across the root, host bridge, and endpoints respectively. ::
503
+ across the root, host bridge, and endpoints respectively.
504
+
505
+ .. flat-table :: 4x4 cross-link first interleave settings
506
+
507
+ * - decoder
508
+ - ways
509
+ - granularity
422
510
423
- ways granularity
424
- root 4 256
425
- host bridge 4 1024
426
- endpoint 16 256
511
+ * - root
512
+ - 4
513
+ - 256
514
+
515
+ * - host bridge
516
+ - 4
517
+ - 1024
518
+
519
+ * - endpoint
520
+ - 16
521
+ - 256
427
522
428
523
At the root, every a given access will be routed to the
429
524
:code: `((HPA / 256) % 4)th ` target host bridge. Within a host bridge, every
430
- :code: `((HPA / 1024) % 4)th ` target endpoint. Each endpoint will translate
431
- the access based on the entire 16 device interleave set.
525
+ :code: `((HPA / 1024) % 4)th ` target endpoint. Each endpoint translates based
526
+ on the entire 16 device interleave set.
432
527
433
528
Unbalanced interleave sets are not supported - decoders at a similar point
434
529
in the hierarchy (e.g. all host bridge decoders) must have the same ways and
@@ -467,7 +562,7 @@ In this example, the CFMWS defines two discrete non-interleaved 4GB regions
467
562
for each host bridge, and one interleaved 8GB region that targets both. This
468
563
would result in 3 root decoders presenting in the root. ::
469
564
470
- # ls /sys/bus/cxl/devices/root0
565
+ # ls /sys/bus/cxl/devices/root0/decoder*
471
566
decoder0.0 decoder0.1 decoder0.2
472
567
473
568
# cat /sys/bus/cxl/devices/decoder0.0/target_list start size
0 commit comments