xref: /linux/Documentation/driver-api/cxl/platform/acpi/srat.rst (revision e9ef810dfee7a2227da9d423aecb0ced35faddbe)
1d1ba3646SGregory Price.. SPDX-License-Identifier: GPL-2.0
2d1ba3646SGregory Price
3d1ba3646SGregory Price=====================================
4d1ba3646SGregory PriceSRAT - Static Resource Affinity Table
5d1ba3646SGregory Price=====================================
6d1ba3646SGregory Price
7d1ba3646SGregory PriceThe System/Static Resource Affinity Table describes resource (CPU, Memory)
8d1ba3646SGregory Priceaffinity to "Proximity Domains". This table is technically optional, but for
9d1ba3646SGregory Priceperformance information (see "HMAT") to be enumerated by linux it must be
10d1ba3646SGregory Pricepresent.
11d1ba3646SGregory Price
12d1ba3646SGregory PriceThere is a careful dance between the CEDT and SRAT tables and how NUMA nodes are
13d1ba3646SGregory Pricecreated.  If things don't look quite the way you expect - check the SRAT Memory
14d1ba3646SGregory PriceAffinity entries and CEDT CFMWS to determine what your platform actually
15d1ba3646SGregory Pricesupports in terms of flexible topologies.
16d1ba3646SGregory Price
17d1ba3646SGregory PriceThe SRAT may statically assign portions of a CFMWS SPA range to a specific
18d1ba3646SGregory Priceproximity domains.  See linux numa creation for more information about how
19d1ba3646SGregory Pricethis presents in the NUMA topology.
20d1ba3646SGregory Price
21d1ba3646SGregory PriceProximity Domain
22d1ba3646SGregory Price================
23d1ba3646SGregory PriceA proximity domain is ROUGHLY equivalent to "NUMA Node" - though a 1-to-1
24d1ba3646SGregory Pricemapping is not guaranteed.  There are scenarios where "Proximity Domain 4" may
25d1ba3646SGregory Pricemap to "NUMA Node 3", for example.  (See "NUMA Node Creation")
26d1ba3646SGregory Price
27d1ba3646SGregory PriceMemory Affinity
28d1ba3646SGregory Price===============
29d1ba3646SGregory PriceGenerally speaking, if a host does any amount of CXL fabric (decoder)
30d1ba3646SGregory Priceprogramming in BIOS - an SRAT entry for that memory needs to be present.
31d1ba3646SGregory Price
32d1ba3646SGregory PriceExample ::
33d1ba3646SGregory Price
34d1ba3646SGregory Price         Subtable Type : 01 [Memory Affinity]
35d1ba3646SGregory Price                Length : 28
36d1ba3646SGregory Price      Proximity Domain : 00000001          <- NUMA Node 1
37d1ba3646SGregory Price             Reserved1 : 0000
38d1ba3646SGregory Price          Base Address : 000000C050000000  <- Physical Memory Region
39d1ba3646SGregory Price        Address Length : 0000003CA0000000
40d1ba3646SGregory Price             Reserved2 : 00000000
41d1ba3646SGregory Price Flags (decoded below) : 0000000B
42d1ba3646SGregory Price              Enabled : 1
43d1ba3646SGregory Price        Hot Pluggable : 1
44d1ba3646SGregory Price         Non-Volatile : 0
45*1ce91b37SDave Jiang
46*1ce91b37SDave Jiang
47*1ce91b37SDave JiangGeneric Port Affinity
48*1ce91b37SDave Jiang=====================
49*1ce91b37SDave JiangThe Generic Port Affinity subtable provides an association between a proximity
50*1ce91b37SDave Jiangdomain and a device handle representing a Generic Port such as a CXL host
51*1ce91b37SDave Jiangbridge. With the association, latency and bandwidth numbers can be retrieved
52*1ce91b37SDave Jiangfrom the SRAT for the path between CPU(s) (initiator) and the Generic Port.
53*1ce91b37SDave JiangThis is used to construct performance coordinates for hotplugged CXL DEVICES,
54*1ce91b37SDave Jiangwhich cannot be enumerated at boot by platform firmware.
55*1ce91b37SDave Jiang
56*1ce91b37SDave JiangExample ::
57*1ce91b37SDave Jiang
58*1ce91b37SDave Jiang         Subtable Type : 06 [Generic Port Affinity]
59*1ce91b37SDave Jiang                Length : 20               <- 32d, length of table
60*1ce91b37SDave Jiang              Reserved : 00
61*1ce91b37SDave Jiang    Device Handle Type : 00               <- 0 - ACPI, 1 - PCI
62*1ce91b37SDave Jiang      Proximity Domain : 00000001
63*1ce91b37SDave Jiang         Device Handle : ACPI0016:01
64*1ce91b37SDave Jiang                 Flags : 00000001         <- Bit 0 (Enabled)
65*1ce91b37SDave Jiang              Reserved : 00000000
66*1ce91b37SDave Jiang
67*1ce91b37SDave JiangThe Proximity Domain is matched up to the :doc:`HMAT <hmat>` SSLBI Target
68*1ce91b37SDave JiangProximity Domain List for the related latency or bandwidth numbers. Those
69*1ce91b37SDave Jiangperformance numbers are tied to a CXL host bridge via the Device Handle.
70*1ce91b37SDave JiangThe driver uses the association to retrieve the Generic Port performance
71*1ce91b37SDave Jiangnumbers for the whole CXL path access coordinates calculation.
72