---
# System prepended metadata

title: BIOS / EFI / UEFI for CXL - part 1

---

# BIOS / EFI / UEFI for CXL - part 1

# 1. BIOS / EFI / UEFI for CXL

## What is BIOS/UEFI
* BIOS - Basic Input/Output System
    * Running Bootloader in MBR
    * 16 bits environment
    * Developed by IBM
* EFI - Extensible Firmware Interface
    * Module/driver structure in a firmware
    * 32/64 bits environment
    * Support EFI System Partition, ESP as like a file
    * Suggested by Intel
* UEFI - Unified EFI
    * Supporting secure boot
    * Network boot, GUI

## Services of UEFI

* Boot Services
  * GRUB, systemd-boot, shim, EFI-stub등이 사용
  * ExitBootServices()가 마지막임
  * GetMemoryMap
* Runtime Services
  * OS가 부팅된 이후에도 제공하는 플랫폼의 표준 기능들
  * GetTime, SetTime, ResetSystem등
  * UEFI가 runtime용으로 남겨둔 메모리 영역 (EfiRuntimeServiesCode/Data)을 유지


# 2. BIOS/EFI CXL Configuration

https://docs.kernel.org/driver-api/cxl/platform/bios-and-efi.html

* early device probe to determine static configuration
* creates ACPI Tables that describe static config for the OS
* create the system memory map (EFI Memory Map, E820, etc)
* calls start_kernel and begins the Linux Early Boot process.


E820은 BIOS 시절 Memory map 정보를 읽어오기 위한 command가 INT 15h, AX=E820h라서 이름이 유래됨
https://en.wikipedia.org/wiki/E820

## UEFI Settings
EFI_MEMORY_SP (Specific Purpose) bit가 enable이면 리눅스의 드라이버(CXL driver)가 메모리 region을 직접 관리해야 함을 의미한다. 그렇지 않으면 'normal memory'로 취급하여 커널이 __init()동안에 page allocator의 관리를 받게 된다.
AMD platform에서 이 bit는 'CXL Memory Attribute' field를 통해 설정된다.

![image](https://hackmd.io/_uploads/H1JTOePGZx.png)
![image](https://hackmd.io/_uploads/BJCsyCvGZl.png)



## Physical Memory Map
CXL spec에서는 256MB가 최소 memory region
Linux는 128MB가 최소이고 2의 지수승
CXL memory의 base address는 2GB aligned
region들도 2GB aligned

![image](https://hackmd.io/_uploads/Skva-CPzZg.png)


## Decoder Programming
CXL HDM decoder의 설정 (start, size, target_list of downstream port), interleave_ways, interleave_granularity) 을 채워 넣거나 검증하는 것을 의미함

### PCIe Decoder
TLP packet의 주소 필드를 바탕으로, 어느 장치의 BAR 범위에 속하는지, 스위치의 어떤 downstream 포트로 내려가야 하는지 등을 판별하고 이 결과에 따라서 해당 포트나 장치로 라우팅 한다.
![image](https://hackmd.io/_uploads/HJfHKqvG-e.png)


### CXL HDM Decoder
CXL 스위치 upstream port나 Root complex에서는 패브릭 상의 HPA 주소 범위를 여러 디바이스에 인터리빙하는데 사용하거나, HPA를 DPA로 변환하는 역할을 한다.

### Translation Point
Endpoint Decoder들은 Host Physical Address (HPA)를 Device Physical Address (DPA)로 변환까지 담당 한다. 해당 fabric에 있는 다른 종류의 decoder들(root/switch)은 변환 없이 요청되는 HPA를 그대로 route 한다.

* CXL Spec 3.1 - 8.2.4.20 CXL HDM Decoder Capability Structure
![image](https://hackmd.io/_uploads/Bk4Jf1wMWx.png)


```
-----------------------   -----------------------
| root-decoder-0      |   | root-decoder-1      |
|   base: 0x100000000 |   |   base: 0x200000000 |
|   size:  0xC0000000 |   |   size:  0x40000000 |
-----------------------   -----------------------
           |                         |
-----------------------   -----------------------
| HB-decoder-0        |   | HB-decoder-1        |
|   base: 0x100000000 |   |   base: 0x200000000 |
|   size:  0xC0000000 |   |   size:  0x40000000 |
-----------------------   -----------------------
           |                         |
-----------------------   -----------------------
| ep-decoder-0        |   | ep-decoder-1        |
|   base: 0x100000000 |   |   base: 0x200000000 |
|   size:  0xC0000000 |   |   size:  0x40000000 |
-----------------------   -----------------------
```

### Interleave and Configuration Flexibility
Cross-host-bridge interleave는 여러 호스트 브리지(여러 소켓/루트 포트) 사이에 하나의 CXL 메모리 영역을 interleave해서 배치하는 방식, 호스트 브리지 A,B,C...각각에 매달린 CXL 장치들의 메모리를 하나의 논리 영역으로 엮고, 주소 스트라이프를 브리지 단위로 번갈아 배분한다.
Intra-host-bridge interleaving은 CEDT에 단 하나의 CFMWS entry를 가지게 된다.
* ACPI CEDT의 CFMWS(고정 메모리 윈도우)에 루트/호스트브리지 레벨의 인터리브 구성이 기술
* Root decoder는 이 CFMWS기반으로 interleave way 값을 가지게 되고, 각 호스트 브리지 디코더가 그 하위 엔드포인트와 동일한 interleave way와 granularity를 따르게 된다.

각각의 CFMWS entry에서 SRAT의 memory region들에 대한 설명을 참조해서 NUMA node의 갯수를 결정하게 된다.


# 3. ACPI Tables
Advanced Configuration and Power Interface
https://docs.kernel.org/driver-api/cxl/platform/acpi.html

## CEDT - CXL Early Discovery Table
CHBS는 CXL Host Bridge들의 정보(특히 UUID)를 나타낸다.
CFMWS는 한개 혹은 여러개의 CXL Host bridges와 연관된 하나의 memory region 정보를 표현한다.

```
           Subtable Type : 00 [CXL Host Bridge Structure]
                Reserved : 00
                  Length : 0020
  Associated host bridge : 00000007
   Specification version : 00000001
                Reserved : 00000000
           Register base : 0000010370400000
         Register length : 0000000000010000

           Subtable Type : 00 [CXL Host Bridge Structure]
                Reserved : 00
                  Length : 0020
  Associated host bridge : 00000006
   Specification version : 00000001
                Reserved : 00000000
           Register base : 0000010380800000
         Register length : 0000000000010000

           Subtable Type : 01 [CXL Fixed Memory Window Structure]
                Reserved : 00
                  Length : 002C
                Reserved : 00000000
     Window base address : 0000001000000000
             Window size : 0000000100000000
Interleave Members (2^n) : 00
   Interleave Arithmetic : 00
                Reserved : 0000
             Granularity : 00000000
            Restrictions : 0006
                   QtgId : 0001
            First Target : 00000007

           Subtable Type : 01 [CXL Fixed Memory Window Structure]
                Reserved : 00
                  Length : 002C
                Reserved : 00000000
     Window base address : 0000001100000000
             Window size : 0000000100000000
Interleave Members (2^n) : 00
   Interleave Arithmetic : 00
                Reserved : 0000
             Granularity : 00000000
            Restrictions : 0006
                   QtgId : 0001
            First Target : 00000006
```

## SRAT - Static Resource Affinity Table
"Proximity Domains"의 resource(CPU와 Memory) affinity 정보롤 가지고 있다.
CEDT의 CFMWS와 함께 flexible topoligies를 구성한다.
- Proximity Domain은 Numa node를 의미하나 1대1 매핑은 아님
- Memory Affinity는 BIOS에서 host가 CXL fabric (decoder) programming을 수행시 기록됨
- Generic Port Affinity
- ACPI0016: CXL Host Bridge를 나타내는 ACPI 디바이스 ID. 각 호스트 브리지 포트가 이 ID로 노출
- ACPI0017: CXL Root Object를 나타내는 ACPI 디바이스 ID. CXL 루트(논리적 시작점)가 이 ID로 노출

```
        Subtable Type : 01 [Memory Affinity]
               Length : 28
     Proximity Domain : 00000001
            Reserved1 : 0000
         Base Address : 0000001000000000
       Address Length : 0000000100000000
            Reserved2 : 00000000
Flags (decoded below) : 0000000B
            Enabled : 1
      Hot Pluggable : 1
       Non-Volatile : 0

        Subtable Type : 01 [Memory Affinity]
               Length : 28
     Proximity Domain : 00000002
            Reserved1 : 0000
         Base Address : 0000001100000000
       Address Length : 0000000100000000
            Reserved2 : 00000000
Flags (decoded below) : 0000000B
            Enabled : 1
      Hot Pluggable : 1
       Non-Volatile : 0
```

## HMAT - Heterogeneous Memory Attribute Table
```
              Structure Type : 0001 [SLLBI]
                   Data Type : 00   [Latency]
Target Proximity Domain List : 00000000
Target Proximity Domain List : 00000001
Target Proximity Domain List : 00000002
                       Entry : 0080
                       Entry : 0100
                       Entry : 0100

              Structure Type : 0001 [SLLBI]
                   Data Type : 03   [Bandwidth]
Target Proximity Domain List : 00000000
Target Proximity Domain List : 00000001
Target Proximity Domain List : 00000002
                       Entry : 1200
                       Entry : 0200
                       Entry : 0200
```
![image](https://hackmd.io/_uploads/BySsWgvGZl.png)

## SLIT - System Locality Information Table

FF는 CPU에 직접 연결되지 않는 device를 의미
```
   Signature : "SLIT"    [System Locality Information Table]
  Localities : 0000000000000003
Locality   0 : 10 20 20
Locality   1 : FF 0A FF
Locality   2 : FF FF 0A
```

## DSDT - Differentiated system Description Table

```
Scope (_SB)
{
  Device (S0D0)
  {
      Name (_HID, "ACPI0016" /* Compute Express Link Host Bridge */)  // _HID: Hardware ID
      ...
      Name (_UID, 0x07)  // _UID: Unique ID
  }
  ...
  Device (S0D5)
  {
      Name (_HID, "ACPI0016" /* Compute Express Link Host Bridge */)  // _HID: Hardware ID
      ...
      Name (_UID, 0x06)  // _UID: Unique ID
  }
}
```

---
리눅스는 아래와 같은 커널 resource들을 설정하기 위해 위 테이블들을 사용하여 CXL device들에 대한 정적으로 구성된 정보를 획득한다.
- NUMA nodes
- Memory Tiers
- NUMA Abstract Distances
- SystemRAM Memory Regions
- Weighted Interleave Node Weights

리눅스 드라이버가 DAX node나 kmem으로 device를 노출시키는 것을 실패하는 경우의 예제는 아래와 같다.

* CEDT CFMWS targets list UIDs do not match CEDT CHBS UIDs.
* CEDT CFMWS targets list UIDs do not match DSDT CXL Host Bridge UIDs.
* CEDT CFMWS Restriction Bits are not correct.
* CEDT CFMWS Memory regions are poorly aligned.
* CEDT CFMWS Memory regions spans a platform memory hole.
* CEDT CHBS UIDs do not match DSDT CXL Host Bridge UIDs.
* CEDT CHBS Specification version is incorrect.
* SRAT is missing regions described in CEDT CFMWS.
   * Result: failure to create a NUMA node for the region, or region is placed in wrong node.
* HMAT is missing data for regions described in CEDT CFMWS.
   * Result: NUMA node being placed in the wrong memory tier.
* SLIT has bad data.
   *Result: Lots of performance mechanisms in the kernel will be very unhappy.

## how to check from Ubuntu

```
fwdev@fwdev-TURIND8UD-2T-X550:/sys/firmware/acpi/tables$ ls
APIC  ASPT  BGRT  data  dynamic  FACP  FIDT  HEST  HPET  MCFG  PHAT  SLIT  SPMI  SSDT1  SSDT3  SSDT5  SSDT7  WSMT
ARUF  BERT  CEDT  DSDT  ERST     FACS  FPDT  HMAT  IVRS  MSCT  PRMT  SPCR  SRAT  SSDT2  SSDT4  SSDT6  SSDT8


fwdev@fwdev-TURIND8UD-2T-X550:~$ sudo acpidump > acpi.dat
fwdev@fwdev-TURIND8UD-2T-X550:~$ cat acpi.dat
SSDT @ 0x0000000000000000
    0000: 53 53 44 54 67 00 00 00 02 99 41 4D 44 00 00 00  SSDTg.....AMD...
    0010: 43 50 4D 44 53 4D 00 00 01 00 00 00 49 4E 54 4C  CPMDSM......INTL
    0020: 31 03 22 20 5B 80 43 44 49 44 00 0C 00 80 B5 9B  1." [.CDID......
    0030: 0A 40 5B 81 14 43 44 49 44 01 4D 41 53 54 40 04  .@[..CDID.MAST@.
    0040: 43 46 4C 47 08 00 48 1B 5B 80 43 44 53 54 00 4D  CFLG..H.[.CDST.M
    0050: 41 53 54 0B 00 40 5B 81 0F 43 44 53 54 01 00 00  AST..@[..CDST...
    0060: 43 54 41 47 80 00 20                             CTAG..

SPCR @ 0x0000000000000000
...

fwdev@fwdev-TURIND8UD-2T-X550:~/work/gilbert$ sudo acpixtract -a acpi.dat

Intel ACPI Component Architecture
ACPI Binary Table Extraction Utility version 20230628
Copyright (c) 2000 - 2023 Intel Corporation

  SSDT -     103 bytes written (0x00000067) - ssdt1.dat
  SPCR -      80 bytes written (0x00000050) - spcr.dat
  MCFG -      60 bytes written (0x0000003C) - mcfg.dat
  PRMT -     406 bytes written (0x00000196) - prmt.dat
  APIC -    6348 bytes written (0x000018CC) - apic.dat
  SSDT -     259 bytes written (0x00000103) - ssdt2.dat
  HMAT -     216 bytes written (0x000000D8) - hmat.dat
  CEDT -     204 bytes written (0x000000CC) - cedt.dat
  SLIT -      48 bytes written (0x00000030) - slit.dat
  SPMI -      65 bytes written (0x00000041) - spmi.dat
  MSCT -     100 bytes written (0x00000064) - msct.dat
  ERST -     560 bytes written (0x00000230) - erst.dat
  IVRS -    1088 bytes written (0x00000440) - ivrs.dat
  DSDT -  151876 bytes written (0x00025144) - dsdt.dat
  SSDT -   31342 bytes written (0x00007A6E) - ssdt3.dat
  SRAT -     976 bytes written (0x000003D0) - srat.dat
  WSMT -      40 bytes written (0x00000028) - wsmt.dat
  SSDT -    1004 bytes written (0x000003EC) - ssdt4.dat
  HEST -    2580 bytes written (0x00000A14) - hest.dat
  ASPT -     112 bytes written (0x00000070) - aspt.dat
  BERT -      48 bytes written (0x00000030) - bert.dat
  SSDT -     243 bytes written (0x000000F3) - ssdt5.dat
  FACP -     276 bytes written (0x00000114) - facp.dat
  FPDT -      52 bytes written (0x00000034) - fpdt.dat
  PHAT -     267 bytes written (0x0000010B) - phat.dat
  SSDT -    4945 bytes written (0x00001351) - ssdt6.dat
  SSDT -    6184 bytes written (0x00001828) - ssdt7.dat
  HPET -      56 bytes written (0x00000038) - hpet.dat
  SSDT -    6627 bytes written (0x000019E3) - ssdt8.dat
  ARUF -     100 bytes written (0x00000064) - aruf.dat
  FIDT -     156 bytes written (0x0000009C) - fidt.dat
  FACS -      64 bytes written (0x00000040) - facs.dat
  BGRT -      56 bytes written (0x00000038) - bgrt.dat





```

### How to decode - iasl
```
fwdev@fwdev-TURIND8UD-2T-X550:~$ iasl -d cedt.dat

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20230628
Copyright (c) 2000 - 2023 Intel Corporation

File appears to be binary: found 172 non-ASCII characters, disassembling
Binary file appears to be a valid ACPI table, disassembling
Input file cedt.dat, Length 0xCC (204) bytes
ACPI: CEDT 0x0000000000000000 0000CC (v01 AMD    AMD CEDT 00000001 AMD  00000001)
Acpi Data Table [CEDT] decoded
Formatted output:  cedt.dsl - 4550 bytes


fwdev@fwdev-TURIND8UD-2T-X550:~$ cat cedt.dsl
/*
 * Intel ACPI Component Architecture
 * AML/ASL+ Disassembler version 20230628 (64-bit version)
 * Copyright (c) 2000 - 2023 Intel Corporation
 *
 * Disassembly of cedt.dat, Mon Dec 15 19:05:58 2025
 *
 * ACPI Data Table [CEDT]
 *
 * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue (in hex)
 */

[000h 0000 004h]                   Signature : "CEDT"    [CXL Early Discovery Table]
[004h 0004 004h]                Table Length : 000000CC
[008h 0008 001h]                    Revision : 01
[009h 0009 001h]                    Checksum : 7C
[00Ah 0010 006h]                      Oem ID : "AMD  "
[010h 0016 008h]                Oem Table ID : "AMD CEDT"
[018h 0024 004h]                Oem Revision : 00000001
[01Ch 0028 004h]             Asl Compiler ID : "AMD "
[020h 0032 004h]       Asl Compiler Revision : 00000001


[024h 0036 001h]               Subtable Type : 00 [CXL Host Bridge Structure]
[025h 0037 001h]                    Reserved : 00
[026h 0038 002h]                      Length : 0020
[028h 0040 004h]      Associated host bridge : 00000007
[02Ch 0044 004h]       Specification version : 00000001
[030h 0048 004h]                    Reserved : 00000000
[034h 0052 008h]               Register base : 0000010010400000
[03Ch 0060 008h]             Register length : 0000000000010000

```

# 4. CDAT, DSMAS, DSLBIS, SSLBIS

https://uefi.org/sites/default/files/resources/Coherent%20Device%20Attribute%20Table_1.01.pdf
![image](https://hackmd.io/_uploads/Hy7Yvnk7-x.png)

## CDAT : Coherent Device Attribute Table

## DSMAS : Device Scope Memory Affinity Structure

## DSLBIS : Device Scope Latency and Bandwidth Information Structure

## SSLBIS : Switch Scope Latency and Bandwidth Information Structure


# Example topology from Ubuntu

## AMD Turin

### Numa (normal memory mode)

![image](https://hackmd.io/_uploads/rkuuNDCMbg.png)

![image](https://hackmd.io/_uploads/rJeApPAMWl.png)

```
fwdev@fwdev-TURIND8UD-2T-X550:~/work/gilbert$ lspci -tv
-+-[0000:00]-+-00.0  Advanced Micro Devices, Inc. [AMD] Device 153a
 |           +-00.2  Advanced Micro Devices, Inc. [AMD] Device 153b
 |           +-00.3  Advanced Micro Devices, Inc. [AMD] Device 153c
 |           +-01.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-02.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-03.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-04.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-05.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-07.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-07.1-[01]----00.0  Advanced Micro Devices, Inc. [AMD] Device 1556
 |           +-14.0  Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller
 |           +-14.3  Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge
 |           +-18.0  Advanced Micro Devices, Inc. [AMD] Device 12c0
 |           +-18.1  Advanced Micro Devices, Inc. [AMD] Device 12c1
 |           +-18.2  Advanced Micro Devices, Inc. [AMD] Device 12c2
 |           +-18.3  Advanced Micro Devices, Inc. [AMD] Device 12c3
 |           +-18.4  Advanced Micro Devices, Inc. [AMD] Device 12c4
 |           +-18.5  Advanced Micro Devices, Inc. [AMD] Device 12c5
 |           +-18.6  Advanced Micro Devices, Inc. [AMD] Device 12c6
 |           \-18.7  Advanced Micro Devices, Inc. [AMD] Device 12c7
 +-[0000:20]-+-00.0  Advanced Micro Devices, Inc. [AMD] Device 153a
 |           +-00.3  Advanced Micro Devices, Inc. [AMD] Device 153c
 |           +-01.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           \-02.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 +-[0000:40]-+-00.0  Advanced Micro Devices, Inc. [AMD] Device 153a
 |           +-00.2  Advanced Micro Devices, Inc. [AMD] Device 153b
 |           +-01.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-01.1-[41-42]--
 |           +-02.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-03.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-04.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-05.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-07.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-07.1-[43]--+-00.0  Advanced Micro Devices, Inc. [AMD] Device 1556
 |           |            \-00.4  Advanced Micro Devices, Inc. [AMD] Device 1557
 |           \-07.2-[44]--+-00.0  Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode]
 |                        \-00.1  Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode]
 +-[0000:60]-+-00.0  Advanced Micro Devices, Inc. [AMD] Device 153a
 |           +-01.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-01.1-[61-62]--
 |           +-01.2-[63-64]--
 |           +-01.3-[65-66]--
 |           +-01.4-[67]----00.0  Micron/Crucial Technology T500 NVMe PCIe SSD
 |           \-02.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 +-[0000:80]-+-00.0  Advanced Micro Devices, Inc. [AMD] Device 153a
 |           +-01.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           \-02.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 +-[0000:a0]-+-00.0  Advanced Micro Devices, Inc. [AMD] Device 153a
 |           +-00.2  Advanced Micro Devices, Inc. [AMD] Device 153b
 |           +-01.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-02.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-03.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-03.1-[a1]--+-00.0  Broadcom Inc. and subsidiaries BCM57416 NetXtreme-E Dual-Media 10G RDMA Ethernet Controller
 |           |            \-00.1  Broadcom Inc. and subsidiaries BCM57416 NetXtreme-E Dual-Media 10G RDMA Ethernet Controller
 |           +-03.5-[a2-a3]----00.0-[a3]----00.0  ASPEED Technology, Inc. ASPEED Graphics Family
 |           +-04.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-05.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           +-07.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           \-07.1-[a4]--+-00.0  Advanced Micro Devices, Inc. [AMD] Device 1556
 |                        \-00.5  Advanced Micro Devices, Inc. [AMD] Device 156e
 +-[0000:c0]-+-00.0  Advanced Micro Devices, Inc. [AMD] Device 153a
 |           +-00.3  Advanced Micro Devices, Inc. [AMD] Device 153c
 |           +-01.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 |           \-02.0  Advanced Micro Devices, Inc. [AMD] Device 153d
 \-[0000:e0]-+-00.0  Advanced Micro Devices, Inc. [AMD] Device 153a
             +-00.2  Advanced Micro Devices, Inc. [AMD] Device 153b
             +-00.3  Advanced Micro Devices, Inc. [AMD] Device 153c
             +-01.0  Advanced Micro Devices, Inc. [AMD] Device 153d
             +-01.3-[e1]----00.0  Device 20ab:03e8
             +-02.0  Advanced Micro Devices, Inc. [AMD] Device 153d
             +-03.0  Advanced Micro Devices, Inc. [AMD] Device 153d
             +-04.0  Advanced Micro Devices, Inc. [AMD] Device 153d
             +-05.0  Advanced Micro Devices, Inc. [AMD] Device 153d
             +-07.0  Advanced Micro Devices, Inc. [AMD] Device 153d
             +-07.1-[e2]--+-00.0  Advanced Micro Devices, Inc. [AMD] Device 1556
             |            \-00.4  Advanced Micro Devices, Inc. [AMD] Device 1557
             \-07.2-[e3]--+-00.0  Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode]
                          \-00.1  Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode]


fwdev@fwdev-TURIND8UD-2T-X550:~/work/gilbert$ sudo cxl list -vv
[
  {
    "memdev":"mem0",
    "ram_size":68719476736,
    "host":"0000:e1:00.0",
    "state":"disabled"
  }
]

```

```
[000h 0000 004h]                   Signature : "CEDT"    [CXL Early Discovery Table]
[004h 0004 004h]                Table Length : 000000CC
[008h 0008 001h]                    Revision : 01
[009h 0009 001h]                    Checksum : 7C
[00Ah 0010 006h]                      Oem ID : "AMD  "
[010h 0016 008h]                Oem Table ID : "AMD CEDT"
[018h 0024 004h]                Oem Revision : 00000001
[01Ch 0028 004h]             Asl Compiler ID : "AMD "
[020h 0032 004h]       Asl Compiler Revision : 00000001


[024h 0036 001h]               Subtable Type : 00 [CXL Host Bridge Structure]
[025h 0037 001h]                    Reserved : 00
[026h 0038 002h]                      Length : 0020
[028h 0040 004h]      Associated host bridge : 00000007
[02Ch 0044 004h]       Specification version : 00000001
[030h 0048 004h]                    Reserved : 00000000
[034h 0052 008h]               Register base : 0000010010400000
[03Ch 0060 008h]             Register length : 0000000000010000

[044h 0068 001h]               Subtable Type : 00 [CXL Host Bridge Structure]
[045h 0069 001h]                    Reserved : 00
[046h 0070 002h]                      Length : 0020
[048h 0072 004h]      Associated host bridge : 00000006
[04Ch 0076 004h]       Specification version : 00000001
[050h 0080 004h]                    Reserved : 00000000
[054h 0084 008h]               Register base : 0000010010410000
[05Ch 0092 008h]             Register length : 0000000000010000

[064h 0100 001h]               Subtable Type : 00 [CXL Host Bridge Structure]
[065h 0101 001h]                    Reserved : 00
[066h 0102 002h]                      Length : 0020
[068h 0104 004h]      Associated host bridge : 00000000
[06Ch 0108 004h]       Specification version : 00000001
[070h 0112 004h]                    Reserved : 00000000
[074h 0116 008h]               Register base : 0000010010420000
[07Ch 0124 008h]             Register length : 0000000000010000

[084h 0132 001h]               Subtable Type : 00 [CXL Host Bridge Structure]
[085h 0133 001h]                    Reserved : 00
[086h 0134 002h]                      Length : 0020
[088h 0136 004h]      Associated host bridge : 00000001
[08Ch 0140 004h]       Specification version : 00000001
[090h 0144 004h]                    Reserved : 00000000
[094h 0148 008h]               Register base : 0000010010430000
[09Ch 0156 008h]             Register length : 0000000000010000

[0A4h 0164 001h]               Subtable Type : 01 [CXL Fixed Memory Window Structure]
[0A5h 0165 001h]                    Reserved : 00
[0A6h 0166 002h]                      Length : 0028
[0A8h 0168 004h]                    Reserved : 00000000
[0ACh 0172 008h]         Window base address : 0000000850000000
[0B4h 0180 008h]                 Window size : 0000001000000000
[0BCh 0188 001h]    Interleave Members (2^n) : 00
[0BDh 0189 001h]       Interleave Arithmetic : 00
[0BEh 0190 002h]                    Reserved : 0000
[0C0h 0192 004h]                 Granularity : 00000000
[0C4h 0196 002h]                Restrictions : 0006
[0C6h 0198 002h]                       QtgId : 0001
[0C8h 0200 004h]                First Target : 00000007

```

```
[000h 0000 004h]                   Signature : "SRAT"    [System Resource Affinity Table]
[004h 0004 004h]                Table Length : 000003D0
[008h 0008 001h]                    Revision : 03
[009h 0009 001h]                    Checksum : 09
[00Ah 0010 006h]                      Oem ID : "AMD"
[010h 0016 008h]                Oem Table ID : "AMD SRAT"
[018h 0024 004h]                Oem Revision : 00000001
[01Ch 0028 004h]             Asl Compiler ID : "AMD "
[020h 0032 004h]       Asl Compiler Revision : 00000001
...
[330h 0816 001h]               Subtable Type : 01 [Memory Affinity]
[331h 0817 001h]                      Length : 28

[332h 0818 004h]            Proximity Domain : 00000000
[336h 0822 002h]                   Reserved1 : 0000
[338h 0824 008h]                Base Address : 0000000000000000
[340h 0832 008h]              Address Length : 00000000000A0000
[348h 0840 004h]                   Reserved2 : 00000000
[34Ch 0844 004h]       Flags (decoded below) : 00000001
                                     Enabled : 1
                               Hot Pluggable : 0
                                Non-Volatile : 0
[350h 0848 008h]                   Reserved3 : 0000000000000000

[358h 0856 001h]               Subtable Type : 01 [Memory Affinity]
[359h 0857 001h]                      Length : 28

[35Ah 0858 004h]            Proximity Domain : 00000000
[35Eh 0862 002h]                   Reserved1 : 0000
[360h 0864 008h]                Base Address : 00000000000C0000
[368h 0872 008h]              Address Length : 00000000AFF40000
[370h 0880 004h]                   Reserved2 : 00000000
[374h 0884 004h]       Flags (decoded below) : 00000001
                                     Enabled : 1
                               Hot Pluggable : 0
                                Non-Volatile : 0
[378h 0888 008h]                   Reserved3 : 0000000000000000

[380h 0896 001h]               Subtable Type : 01 [Memory Affinity]
[381h 0897 001h]                      Length : 28

[382h 0898 004h]            Proximity Domain : 00000000
[386h 0902 002h]                   Reserved1 : 0000
[388h 0904 008h]                Base Address : 0000000100000000
[390h 0912 008h]              Address Length : 0000000750000000
[398h 0920 004h]                   Reserved2 : 00000000
[39Ch 0924 004h]       Flags (decoded below) : 00000001
                                     Enabled : 1
                               Hot Pluggable : 0
                                Non-Volatile : 0
[3A0h 0928 008h]                   Reserved3 : 0000000000000000

[3A8h 0936 001h]               Subtable Type : 01 [Memory Affinity]
[3A9h 0937 001h]                      Length : 28

[3AAh 0938 004h]            Proximity Domain : 00000001
[3AEh 0942 002h]                   Reserved1 : 0000
[3B0h 0944 008h]                Base Address : 0000000850000000
[3B8h 0952 008h]              Address Length : 0000001000000000
[3C0h 0960 004h]                   Reserved2 : 00000000
[3C4h 0964 004h]       Flags (decoded below) : 00000003
                                     Enabled : 1
                               Hot Pluggable : 1
                                Non-Volatile : 0
[3C8h 0968 008h]                   Reserved3 : 0000000000000000

```

```
[000h 0000 004h]                   Signature : "HMAT"    [Heterogeneous Memory Attributes Table]
[004h 0004 004h]                Table Length : 000000D8
[008h 0008 001h]                    Revision : 02
[009h 0009 001h]                    Checksum : 6D
[00Ah 0010 006h]                      Oem ID : "AMD"
[010h 0016 008h]                Oem Table ID : "AmdTable"
[018h 0024 004h]                Oem Revision : 00000001
[01Ch 0028 004h]             Asl Compiler ID : "AMD "
[020h 0032 004h]       Asl Compiler Revision : 00000001

[024h 0036 004h]                    Reserved : 00000000

[028h 0040 002h]              Structure Type : 0000 [Memory Proximity Domain Attributes]
[02Ah 0042 002h]                    Reserved : 0000
[02Ch 0044 004h]                      Length : 00000028
[030h 0048 002h]       Flags (decoded below) : 0001
            Processor Proximity Domain Valid : 1
[032h 0050 002h]                   Reserved1 : 0000
[034h 0052 004h] Attached Initiator Proximity Domain : 00000000
[038h 0056 004h]     Memory Proximity Domain : 00000000
[03Ch 0060 004h]                   Reserved2 : 00000000
[040h 0064 008h]                   Reserved3 : 0000000000000000
[048h 0072 008h]                   Reserved4 : 0000000000000000

[050h 0080 002h]              Structure Type : 0000 [Memory Proximity Domain Attributes]
[052h 0082 002h]                    Reserved : 0000
[054h 0084 004h]                      Length : 00000028
[058h 0088 002h]       Flags (decoded below) : 0000
            Processor Proximity Domain Valid : 0
[05Ah 0090 002h]                   Reserved1 : 0000
[05Ch 0092 004h] Attached Initiator Proximity Domain : 00000001
[060h 0096 004h]     Memory Proximity Domain : 00000001
[064h 0100 004h]                   Reserved2 : 00000000
[068h 0104 008h]                   Reserved3 : 0000000000000000
[070h 0112 008h]                   Reserved4 : 0000000000000000

[078h 0120 002h]              Structure Type : 0001 [System Locality Latency and Bandwidth Information]
[07Ah 0122 002h]                    Reserved : 0000
[07Ch 0124 004h]                      Length : 00000030
[080h 0128 001h]       Flags (decoded below) : 00
                            Memory Hierarchy : 0
                   Use Minimum Transfer Size : 0
                    Non-sequential Transfers : 0
[081h 0129 001h]                   Data Type : 00
[082h 0130 001h]       Minimum Transfer Size : 00
[083h 0131 001h]                   Reserved1 : 00
[084h 0132 004h] Initiator Proximity Domains # : 00000001
[088h 0136 004h]  Target Proximity Domains # : 00000002
[08Ch 0140 004h]                   Reserved2 : 00000000
[090h 0144 008h]             Entry Base Unit : 00000000000003E8
[098h 0152 004h] Initiator Proximity Domain List : 00000000
[09Ch 0156 004h] Target Proximity Domain List : 00000000
[0A0h 0160 004h] Target Proximity Domain List : 00000001
[0A4h 0164 002h]                       Entry : 006E
[0A6h 0166 002h]                       Entry : 01FE

[0A8h 0168 002h]              Structure Type : 0001 [System Locality Latency and Bandwidth Information]
[0AAh 0170 002h]                    Reserved : 0000
[0ACh 0172 004h]                      Length : 00000030
[0B0h 0176 001h]       Flags (decoded below) : 00
                            Memory Hierarchy : 0
                   Use Minimum Transfer Size : 0
                    Non-sequential Transfers : 0
[0B1h 0177 001h]                   Data Type : 03
[0B2h 0178 001h]       Minimum Transfer Size : 00
[0B3h 0179 001h]                   Reserved1 : 00
[0B4h 0180 004h] Initiator Proximity Domains # : 00000001
[0B8h 0184 004h]  Target Proximity Domains # : 00000002
[0BCh 0188 004h]                   Reserved2 : 00000000
[0C0h 0192 008h]             Entry Base Unit : 0000000000000064
[0C8h 0200 004h] Initiator Proximity Domain List : 00000000
[0CCh 0204 004h] Target Proximity Domain List : 00000000
[0D0h 0208 004h] Target Proximity Domain List : 00000001
[0D4h 0212 002h]                       Entry : 0120
[0D6h 0214 002h]                       Entry : 0032

```

```
[000h 0000 004h]                   Signature : "SLIT"    [System Locality Information Table]
[004h 0004 004h]                Table Length : 00000030
[008h 0008 001h]                    Revision : 01
[009h 0009 001h]                    Checksum : 78
[00Ah 0010 006h]                      Oem ID : "AMD"
[010h 0016 008h]                Oem Table ID : "AMD SLIT"
[018h 0024 004h]                Oem Revision : 00000001
[01Ch 0028 004h]             Asl Compiler ID : "AMD "
[020h 0032 004h]       Asl Compiler Revision : 00000001

[024h 0036 008h]                  Localities : 0000000000000002
[02Ch 0044 002h]                 Locality   0 : 0A 12
[02Eh 0046 002h]                 Locality   1 : FF 0A

Raw Table Data: Length 48 (0x30)

    0000: 53 4C 49 54 30 00 00 00 01 78 41 4D 44 00 00 00  // SLIT0....xAMD...
    0010: 41 4D 44 20 53 4C 49 54 01 00 00 00 41 4D 44 20  // AMD SLIT....AMD
    0020: 01 00 00 00 02 00 00 00 00 00 00 00 0A 12 FF 0A  // ................
    
fwdev@fwdev-TURIND8UD-2T-X550:~/work/gilbert$ sudo numactl -H
available: 2 nodes (0-1)
node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
node 0 size: 31734 MB
node 0 free: 29790 MB
node 1 cpus:
node 1 size: 64509 MB
node 1 free: 64414 MB
node distances:
node   0   1
  0:  10  18
  1:  255  10

```

