xref: /linux/Documentation/ABI/testing/sysfs-bus-cxl (revision 79790b6818e96c58fe2bffee1b418c16e64e7b80)
18dd2bc0fSBen WidawskyWhat:		/sys/bus/cxl/flush
28dd2bc0fSBen WidawskyDate:		Januarry, 2022
38dd2bc0fSBen WidawskyKernelVersion:	v5.18
48dd2bc0fSBen WidawskyContact:	linux-cxl@vger.kernel.org
58dd2bc0fSBen WidawskyDescription:
68dd2bc0fSBen Widawsky		(WO) If userspace manually unbinds a port the kernel schedules
78dd2bc0fSBen Widawsky		all descendant memdevs for unbind. Writing '1' to this attribute
88dd2bc0fSBen Widawsky		flushes that work.
98dd2bc0fSBen Widawsky
106b625b2bSDan Williams
11b39cb105SDan WilliamsWhat:		/sys/bus/cxl/devices/memX/firmware_version
12b39cb105SDan WilliamsDate:		December, 2020
13b39cb105SDan WilliamsKernelVersion:	v5.12
14b39cb105SDan WilliamsContact:	linux-cxl@vger.kernel.org
15b39cb105SDan WilliamsDescription:
16b39cb105SDan Williams		(RO) "FW Revision" string as reported by the Identify
17b39cb105SDan Williams		Memory Device Output Payload in the CXL-2.0
18b39cb105SDan Williams		specification.
19b39cb105SDan Williams
206b625b2bSDan Williams
21b39cb105SDan WilliamsWhat:		/sys/bus/cxl/devices/memX/ram/size
22b39cb105SDan WilliamsDate:		December, 2020
23b39cb105SDan WilliamsKernelVersion:	v5.12
24b39cb105SDan WilliamsContact:	linux-cxl@vger.kernel.org
25b39cb105SDan WilliamsDescription:
26b39cb105SDan Williams		(RO) "Volatile Only Capacity" as bytes. Represents the
27b39cb105SDan Williams		identically named field in the Identify Memory Device Output
28b39cb105SDan Williams		Payload in the CXL-2.0 specification.
29b39cb105SDan Williams
306b625b2bSDan Williams
3142834b17SDave JiangWhat:		/sys/bus/cxl/devices/memX/ram/qos_class
3242834b17SDave JiangDate:		May, 2023
3342834b17SDave JiangKernelVersion:	v6.8
3442834b17SDave JiangContact:	linux-cxl@vger.kernel.org
3542834b17SDave JiangDescription:
3642834b17SDave Jiang		(RO) For CXL host platforms that support "QoS Telemmetry"
3742834b17SDave Jiang		this attribute conveys a comma delimited list of platform
3842834b17SDave Jiang		specific cookies that identifies a QoS performance class
3942834b17SDave Jiang		for the volatile partition of the CXL mem device. These
4042834b17SDave Jiang		class-ids can be compared against a similar "qos_class"
4142834b17SDave Jiang		published for a root decoder. While it is not required
4242834b17SDave Jiang		that the endpoints map their local memory-class to a
4342834b17SDave Jiang		matching platform class, mismatches are not recommended
4442834b17SDave Jiang		and there are platform specific performance related
4542834b17SDave Jiang		side-effects that may result. First class-id is displayed.
4642834b17SDave Jiang
4742834b17SDave Jiang
48b39cb105SDan WilliamsWhat:		/sys/bus/cxl/devices/memX/pmem/size
49b39cb105SDan WilliamsDate:		December, 2020
50b39cb105SDan WilliamsKernelVersion:	v5.12
51b39cb105SDan WilliamsContact:	linux-cxl@vger.kernel.org
52b39cb105SDan WilliamsDescription:
53b39cb105SDan Williams		(RO) "Persistent Only Capacity" as bytes. Represents the
54b39cb105SDan Williams		identically named field in the Identify Memory Device Output
55b39cb105SDan Williams		Payload in the CXL-2.0 specification.
564812be97SDan Williams
576b625b2bSDan Williams
5842834b17SDave JiangWhat:		/sys/bus/cxl/devices/memX/pmem/qos_class
5942834b17SDave JiangDate:		May, 2023
6042834b17SDave JiangKernelVersion:	v6.8
6142834b17SDave JiangContact:	linux-cxl@vger.kernel.org
6242834b17SDave JiangDescription:
6342834b17SDave Jiang		(RO) For CXL host platforms that support "QoS Telemmetry"
6442834b17SDave Jiang		this attribute conveys a comma delimited list of platform
6542834b17SDave Jiang		specific cookies that identifies a QoS performance class
6642834b17SDave Jiang		for the persistent partition of the CXL mem device. These
6742834b17SDave Jiang		class-ids can be compared against a similar "qos_class"
6842834b17SDave Jiang		published for a root decoder. While it is not required
6942834b17SDave Jiang		that the endpoints map their local memory-class to a
7042834b17SDave Jiang		matching platform class, mismatches are not recommended
7142834b17SDave Jiang		and there are platform specific performance related
7242834b17SDave Jiang		side-effects that may result. First class-id is displayed.
7342834b17SDave Jiang
7442834b17SDave Jiang
75bcc79ea3SDan WilliamsWhat:		/sys/bus/cxl/devices/memX/serial
76bcc79ea3SDan WilliamsDate:		January, 2022
77bcc79ea3SDan WilliamsKernelVersion:	v5.18
78bcc79ea3SDan WilliamsContact:	linux-cxl@vger.kernel.org
79bcc79ea3SDan WilliamsDescription:
80bcc79ea3SDan Williams		(RO) 64-bit serial number per the PCIe Device Serial Number
81bcc79ea3SDan Williams		capability. Mandatory for CXL devices, see CXL 2.0 8.1.12.2
82bcc79ea3SDan Williams		Memory Device PCIe Capabilities and Extended Capabilities.
83bcc79ea3SDan Williams
846b625b2bSDan Williams
85cf1f6877SDan WilliamsWhat:		/sys/bus/cxl/devices/memX/numa_node
86cf1f6877SDan WilliamsDate:		January, 2022
87cf1f6877SDan WilliamsKernelVersion:	v5.18
88cf1f6877SDan WilliamsContact:	linux-cxl@vger.kernel.org
89cf1f6877SDan WilliamsDescription:
90cf1f6877SDan Williams		(RO) If NUMA is enabled and the platform has affinitized the
91cf1f6877SDan Williams		host PCI device for this memory device, emit the CPU node
92cf1f6877SDan Williams		affinity for this device.
93cf1f6877SDan Williams
946b625b2bSDan Williams
959968c9ddSDavidlohr BuesoWhat:		/sys/bus/cxl/devices/memX/security/state
969968c9ddSDavidlohr BuesoDate:		June, 2023
979968c9ddSDavidlohr BuesoKernelVersion:	v6.5
989968c9ddSDavidlohr BuesoContact:	linux-cxl@vger.kernel.org
999968c9ddSDavidlohr BuesoDescription:
1009968c9ddSDavidlohr Bueso		(RO) Reading this file will display the CXL security state for
10148dcdbb1SDavidlohr Bueso		that device. Such states can be: 'disabled', 'sanitize', when
10248dcdbb1SDavidlohr Bueso		a sanitization is currently underway; or those available only
10348dcdbb1SDavidlohr Bueso		for persistent memory: 'locked', 'unlocked' or 'frozen'. This
10448dcdbb1SDavidlohr Bueso		sysfs entry is select/poll capable from userspace to notify
10548dcdbb1SDavidlohr Bueso		upon completion of a sanitize operation.
10648dcdbb1SDavidlohr Bueso
10748dcdbb1SDavidlohr Bueso
10848dcdbb1SDavidlohr BuesoWhat:           /sys/bus/cxl/devices/memX/security/sanitize
10948dcdbb1SDavidlohr BuesoDate:           June, 2023
11048dcdbb1SDavidlohr BuesoKernelVersion:  v6.5
11148dcdbb1SDavidlohr BuesoContact:        linux-cxl@vger.kernel.org
11248dcdbb1SDavidlohr BuesoDescription:
11348dcdbb1SDavidlohr Bueso		(WO) Write a boolean 'true' string value to this attribute to
11448dcdbb1SDavidlohr Bueso		sanitize the device to securely re-purpose or decommission it.
11548dcdbb1SDavidlohr Bueso		This is done by ensuring that all user data and meta-data,
11648dcdbb1SDavidlohr Bueso		whether it resides in persistent capacity, volatile capacity,
11748dcdbb1SDavidlohr Bueso		or the LSA, is made permanently unavailable by whatever means
11848dcdbb1SDavidlohr Bueso		is appropriate for the media type. This functionality requires
1190fcde598SDavidlohr Bueso		the device to be disabled, that is, not actively decoding any
1200fcde598SDavidlohr Bueso		HPA ranges. This permits avoiding explicit global CPU cache
1210fcde598SDavidlohr Bueso		management, relying instead for it to be done when a region
1220fcde598SDavidlohr Bueso		transitions between software programmed and hardware committed
123ad64f595SDavidlohr Bueso		states. If this file is not present, then there is no hardware
124ad64f595SDavidlohr Bueso		support for the operation.
1259968c9ddSDavidlohr Bueso
1269968c9ddSDavidlohr Bueso
127180ffd33SDavidlohr BuesoWhat            /sys/bus/cxl/devices/memX/security/erase
128180ffd33SDavidlohr BuesoDate:           June, 2023
129180ffd33SDavidlohr BuesoKernelVersion:  v6.5
130180ffd33SDavidlohr BuesoContact:        linux-cxl@vger.kernel.org
131180ffd33SDavidlohr BuesoDescription:
132180ffd33SDavidlohr Bueso		(WO) Write a boolean 'true' string value to this attribute to
133180ffd33SDavidlohr Bueso		secure erase user data by changing the media encryption keys for
1340fcde598SDavidlohr Bueso		all user data areas of the device. This functionality requires
1350fcde598SDavidlohr Bueso		the device to be disabled, that is, not actively decoding any
1360fcde598SDavidlohr Bueso		HPA ranges. This permits avoiding explicit global CPU cache
1370fcde598SDavidlohr Bueso		management, relying instead for it to be done when a region
1380fcde598SDavidlohr Bueso		transitions between software programmed and hardware committed
139ad64f595SDavidlohr Bueso		states. If this file is not present, then there is no hardware
140ad64f595SDavidlohr Bueso		support for the operation.
141180ffd33SDavidlohr Bueso
142180ffd33SDavidlohr Bueso
1439521875bSVishal VermaWhat:		/sys/bus/cxl/devices/memX/firmware/
1449521875bSVishal VermaDate:		April, 2023
1459521875bSVishal VermaKernelVersion:	v6.5
1469521875bSVishal VermaContact:	linux-cxl@vger.kernel.org
1479521875bSVishal VermaDescription:
1489521875bSVishal Verma		(RW) Firmware uploader mechanism. The different files under
1499521875bSVishal Verma		this directory can be used to upload and activate new
1509521875bSVishal Verma		firmware for CXL devices. The interfaces under this are
1519521875bSVishal Verma		documented in sysfs-class-firmware.
1529521875bSVishal Verma
1539521875bSVishal Verma
1544812be97SDan WilliamsWhat:		/sys/bus/cxl/devices/*/devtype
1554812be97SDan WilliamsDate:		June, 2021
1564812be97SDan WilliamsKernelVersion:	v5.14
1574812be97SDan WilliamsContact:	linux-cxl@vger.kernel.org
1584812be97SDan WilliamsDescription:
15986677a4eSDan Williams		(RO) CXL device objects export the devtype attribute which
16086677a4eSDan Williams		mirrors the same value communicated in the DEVTYPE environment
16186677a4eSDan Williams		variable for uevents for devices on the "cxl" bus.
1624812be97SDan Williams
1636b625b2bSDan Williams
16483fbdbe4SDan WilliamsWhat:		/sys/bus/cxl/devices/*/modalias
16583fbdbe4SDan WilliamsDate:		December, 2021
16683fbdbe4SDan WilliamsKernelVersion:	v5.18
16783fbdbe4SDan WilliamsContact:	linux-cxl@vger.kernel.org
16883fbdbe4SDan WilliamsDescription:
16986677a4eSDan Williams		(RO) CXL device objects export the modalias attribute which
17086677a4eSDan Williams		mirrors the same value communicated in the MODALIAS environment
17186677a4eSDan Williams		variable for uevents for devices on the "cxl" bus.
17283fbdbe4SDan Williams
1736b625b2bSDan Williams
1744812be97SDan WilliamsWhat:		/sys/bus/cxl/devices/portX/uport
1754812be97SDan WilliamsDate:		June, 2021
1764812be97SDan WilliamsKernelVersion:	v5.14
1774812be97SDan WilliamsContact:	linux-cxl@vger.kernel.org
1784812be97SDan WilliamsDescription:
17986677a4eSDan Williams		(RO) CXL port objects are enumerated from either a platform
18086677a4eSDan Williams		firmware device (ACPI0017 and ACPI0016) or PCIe switch upstream
18186677a4eSDan Williams		port with CXL component registers. The 'uport' symlink connects
18286677a4eSDan Williams		the CXL portX object to the device that published the CXL port
1834812be97SDan Williams		capability.
1847d4b5ca2SDan Williams
1856b625b2bSDan Williams
186172738bbSDan WilliamsWhat:		/sys/bus/cxl/devices/{port,endpoint}X/parent_dport
187172738bbSDan WilliamsDate:		January, 2023
188172738bbSDan WilliamsKernelVersion:	v6.3
189172738bbSDan WilliamsContact:	linux-cxl@vger.kernel.org
190172738bbSDan WilliamsDescription:
191172738bbSDan Williams		(RO) CXL port objects are instantiated for each upstream port in
192172738bbSDan Williams		a CXL/PCIe switch, and for each endpoint to map the
193172738bbSDan Williams		corresponding memory device into the CXL port hierarchy. When a
194172738bbSDan Williams		descendant CXL port (switch or endpoint) is enumerated it is
195172738bbSDan Williams		useful to know which 'dport' object in the parent CXL port
196172738bbSDan Williams		routes to this descendant. The 'parent_dport' symlink points to
197172738bbSDan Williams		the device representing the downstream port of a CXL switch that
198172738bbSDan Williams		routes to {port,endpoint}X.
199172738bbSDan Williams
200172738bbSDan Williams
2017d4b5ca2SDan WilliamsWhat:		/sys/bus/cxl/devices/portX/dportY
2027d4b5ca2SDan WilliamsDate:		June, 2021
2037d4b5ca2SDan WilliamsKernelVersion:	v5.14
2047d4b5ca2SDan WilliamsContact:	linux-cxl@vger.kernel.org
2057d4b5ca2SDan WilliamsDescription:
20686677a4eSDan Williams		(RO) CXL port objects are enumerated from either a platform
20786677a4eSDan Williams		firmware device (ACPI0017 and ACPI0016) or PCIe switch upstream
20886677a4eSDan Williams		port with CXL component registers. The 'dportY' symlink
20986677a4eSDan Williams		identifies one or more downstream ports that the upstream port
21086677a4eSDan Williams		may target in its decode of CXL memory resources.  The 'Y'
21186677a4eSDan Williams		integer reflects the hardware port unique-id used in the
21286677a4eSDan Williams		hardware decoder target list.
21340ba17afSDan Williams
2146b625b2bSDan Williams
21505e37b21SDave JiangWhat:		/sys/bus/cxl/devices/portX/decoders_committed
21605e37b21SDave JiangDate:		October, 2023
21705e37b21SDave JiangKernelVersion:	v6.7
21805e37b21SDave JiangContact:	linux-cxl@vger.kernel.org
21905e37b21SDave JiangDescription:
22005e37b21SDave Jiang		(RO) A memory device is considered active when any of its
22105e37b21SDave Jiang		decoders are in the "committed" state (See CXL 3.0 8.2.4.19.7
22205e37b21SDave Jiang		CXL HDM Decoder n Control Register). Hotplug and destructive
22305e37b21SDave Jiang		operations like "sanitize" are blocked while device is actively
22405e37b21SDave Jiang		decoding a Host Physical Address range. Note that this number
22505e37b21SDave Jiang		may be elevated without any regionX objects active or even
22605e37b21SDave Jiang		enumerated, as this may be due to decoders established by
22705e37b21SDave Jiang		platform firwmare or a previous kernel (kexec).
22805e37b21SDave Jiang
22905e37b21SDave Jiang
23040ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y
23140ba17afSDan WilliamsDate:		June, 2021
23240ba17afSDan WilliamsKernelVersion:	v5.14
23340ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
23440ba17afSDan WilliamsDescription:
23586677a4eSDan Williams		(RO) CXL decoder objects are enumerated from either a platform
23640ba17afSDan Williams		firmware description, or a CXL HDM decoder register set in a
23740ba17afSDan Williams		PCIe device (see CXL 2.0 section 8.2.5.12 CXL HDM Decoder
23840ba17afSDan Williams		Capability Structure). The 'X' in decoderX.Y represents the
23940ba17afSDan Williams		cxl_port container of this decoder, and 'Y' represents the
24040ba17afSDan Williams		instance id of a given decoder resource.
24140ba17afSDan Williams
2426b625b2bSDan Williams
24340ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/{start,size}
24440ba17afSDan WilliamsDate:		June, 2021
24540ba17afSDan WilliamsKernelVersion:	v5.14
24640ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
24740ba17afSDan WilliamsDescription:
24886677a4eSDan Williams		(RO) The 'start' and 'size' attributes together convey the
24986677a4eSDan Williams		physical address base and number of bytes mapped in the
25086677a4eSDan Williams		decoder's decode window. For decoders of devtype
25186677a4eSDan Williams		"cxl_decoder_root" the address range is fixed. For decoders of
25286677a4eSDan Williams		devtype "cxl_decoder_switch" the address is bounded by the
25386677a4eSDan Williams		decode range of the cxl_port ancestor of the decoder's cxl_port,
25486677a4eSDan Williams		and dynamically updates based on the active memory regions in
25586677a4eSDan Williams		that address space.
25640ba17afSDan Williams
2576b625b2bSDan Williams
25840ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/locked
25940ba17afSDan WilliamsDate:		June, 2021
26040ba17afSDan WilliamsKernelVersion:	v5.14
26140ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
26240ba17afSDan WilliamsDescription:
26386677a4eSDan Williams		(RO) CXL HDM decoders have the capability to lock the
26486677a4eSDan Williams		configuration until the next device reset. For decoders of
26586677a4eSDan Williams		devtype "cxl_decoder_root" there is no standard facility to
26686677a4eSDan Williams		unlock them.  For decoders of devtype "cxl_decoder_switch" a
26786677a4eSDan Williams		secondary bus reset, of the PCIe bridge that provides the bus
26886677a4eSDan Williams		for this decoders uport, unlocks / resets the decoder.
26940ba17afSDan Williams
2706b625b2bSDan Williams
27140ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/target_list
27240ba17afSDan WilliamsDate:		June, 2021
27340ba17afSDan WilliamsKernelVersion:	v5.14
27440ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
27540ba17afSDan WilliamsDescription:
27686677a4eSDan Williams		(RO) Display a comma separated list of the current decoder
27786677a4eSDan Williams		target configuration. The list is ordered by the current
27886677a4eSDan Williams		configured interleave order of the decoder's dport instances.
27986677a4eSDan Williams		Each entry in the list is a dport id.
28040ba17afSDan Williams
2816b625b2bSDan Williams
28240ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/cap_{pmem,ram,type2,type3}
28340ba17afSDan WilliamsDate:		June, 2021
28440ba17afSDan WilliamsKernelVersion:	v5.14
28540ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
28640ba17afSDan WilliamsDescription:
28786677a4eSDan Williams		(RO) When a CXL decoder is of devtype "cxl_decoder_root", it
28840ba17afSDan Williams		represents a fixed memory window identified by platform
28940ba17afSDan Williams		firmware. A fixed window may only support a subset of memory
29040ba17afSDan Williams		types. The 'cap_*' attributes indicate whether persistent
29140ba17afSDan Williams		memory, volatile memory, accelerator memory, and / or expander
29240ba17afSDan Williams		memory may be mapped behind this decoder's memory window.
29340ba17afSDan Williams
2946b625b2bSDan Williams
29540ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/target_type
29640ba17afSDan WilliamsDate:		June, 2021
29740ba17afSDan WilliamsKernelVersion:	v5.14
29840ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
29940ba17afSDan WilliamsDescription:
30086677a4eSDan Williams		(RO) When a CXL decoder is of devtype "cxl_decoder_switch", it
30186677a4eSDan Williams		can optionally decode either accelerator memory (type-2) or
30286677a4eSDan Williams		expander memory (type-3). The 'target_type' attribute indicates
30386677a4eSDan Williams		the current setting which may dynamically change based on what
30440ba17afSDan Williams		memory regions are activated in this decode hierarchy.
305c9700604SIra Weiny
3066b625b2bSDan Williams
307c9700604SIra WeinyWhat:		/sys/bus/cxl/devices/endpointX/CDAT
308c9700604SIra WeinyDate:		July, 2022
3098752efd2SDan WilliamsKernelVersion:	v6.0
310c9700604SIra WeinyContact:	linux-cxl@vger.kernel.org
311c9700604SIra WeinyDescription:
312c9700604SIra Weiny		(RO) If this sysfs entry is not present no DOE mailbox was
313c9700604SIra Weiny		found to support CDAT data.  If it is present and the length of
314c9700604SIra Weiny		the data is 0 reading the CDAT data failed.  Otherwise the CDAT
315c9700604SIra Weiny		data is reported.
3162c866903SDan Williams
3172c866903SDan Williams
3182c866903SDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/mode
3192c866903SDan WilliamsDate:		May, 2022
3208752efd2SDan WilliamsKernelVersion:	v6.0
3212c866903SDan WilliamsContact:	linux-cxl@vger.kernel.org
3222c866903SDan WilliamsDescription:
323cf880423SDan Williams		(RW) When a CXL decoder is of devtype "cxl_decoder_endpoint" it
3242c866903SDan Williams		translates from a host physical address range, to a device local
3252c866903SDan Williams		address range. Device-local address ranges are further split
3262c866903SDan Williams		into a 'ram' (volatile memory) range and 'pmem' (persistent
3272c866903SDan Williams		memory) range. The 'mode' attribute emits one of 'ram', 'pmem',
3282c866903SDan Williams		'mixed', or 'none'. The 'mixed' indication is for error cases
3292c866903SDan Williams		when a decoder straddles the volatile/persistent partition
3302c866903SDan Williams		boundary, and 'none' indicates the decoder is not actively
3312c866903SDan Williams		decoding, or no DPA allocation policy has been set.
332cf880423SDan Williams
333cf880423SDan Williams		'mode' can be written, when the decoder is in the 'disabled'
334cf880423SDan Williams		state, with either 'ram' or 'pmem' to set the boundaries for the
335cf880423SDan Williams		next allocation.
336cf880423SDan Williams
337cf880423SDan Williams
338cf880423SDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/dpa_resource
339cf880423SDan WilliamsDate:		May, 2022
3408752efd2SDan WilliamsKernelVersion:	v6.0
341cf880423SDan WilliamsContact:	linux-cxl@vger.kernel.org
342cf880423SDan WilliamsDescription:
343cf880423SDan Williams		(RO) When a CXL decoder is of devtype "cxl_decoder_endpoint",
344cf880423SDan Williams		and its 'dpa_size' attribute is non-zero, this attribute
345cf880423SDan Williams		indicates the device physical address (DPA) base address of the
346cf880423SDan Williams		allocation.
347cf880423SDan Williams
348cf880423SDan Williams
349cf880423SDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/dpa_size
350cf880423SDan WilliamsDate:		May, 2022
3518752efd2SDan WilliamsKernelVersion:	v6.0
352cf880423SDan WilliamsContact:	linux-cxl@vger.kernel.org
353cf880423SDan WilliamsDescription:
354cf880423SDan Williams		(RW) When a CXL decoder is of devtype "cxl_decoder_endpoint" it
355cf880423SDan Williams		translates from a host physical address range, to a device local
356cf880423SDan Williams		address range. The range, base address plus length in bytes, of
357cf880423SDan Williams		DPA allocated to this decoder is conveyed in these 2 attributes.
358cf880423SDan Williams		Allocations can be mutated as long as the decoder is in the
359cf880423SDan Williams		disabled state. A write to 'dpa_size' releases the previous DPA
360cf880423SDan Williams		allocation and then attempts to allocate from the free capacity
361cf880423SDan Williams		in the device partition referred to by 'decoderX.Y/mode'.
362cf880423SDan Williams		Allocate and free requests can only be performed on the highest
363cf880423SDan Williams		instance number disabled decoder with non-zero size. I.e.
364cf880423SDan Williams		allocations are enforced to occur in increasing 'decoderX.Y/id'
365cf880423SDan Williams		order and frees are enforced to occur in decreasing
366cf880423SDan Williams		'decoderX.Y/id' order.
367538831f1SBen Widawsky
368538831f1SBen Widawsky
369538831f1SBen WidawskyWhat:		/sys/bus/cxl/devices/decoderX.Y/interleave_ways
370538831f1SBen WidawskyDate:		May, 2022
3718752efd2SDan WilliamsKernelVersion:	v6.0
372538831f1SBen WidawskyContact:	linux-cxl@vger.kernel.org
373538831f1SBen WidawskyDescription:
374538831f1SBen Widawsky		(RO) The number of targets across which this decoder's host
375538831f1SBen Widawsky		physical address (HPA) memory range is interleaved. The device
376538831f1SBen Widawsky		maps every Nth block of HPA (of size ==
377538831f1SBen Widawsky		'interleave_granularity') to consecutive DPA addresses. The
378538831f1SBen Widawsky		decoder's position in the interleave is determined by the
379538831f1SBen Widawsky		device's (endpoint or switch) switch ancestry. For root
380538831f1SBen Widawsky		decoders their interleave is specified by platform firmware and
381538831f1SBen Widawsky		they only specify a downstream target order for host bridges.
382538831f1SBen Widawsky
383538831f1SBen Widawsky
384538831f1SBen WidawskyWhat:		/sys/bus/cxl/devices/decoderX.Y/interleave_granularity
385538831f1SBen WidawskyDate:		May, 2022
3868752efd2SDan WilliamsKernelVersion:	v6.0
387538831f1SBen WidawskyContact:	linux-cxl@vger.kernel.org
388538831f1SBen WidawskyDescription:
389538831f1SBen Widawsky		(RO) The number of consecutive bytes of host physical address
390538831f1SBen Widawsky		space this decoder claims at address N before the decode rotates
391538831f1SBen Widawsky		to the next target in the interleave at address N +
392538831f1SBen Widawsky		interleave_granularity (assuming N is aligned to
393538831f1SBen Widawsky		interleave_granularity).
394779dd20cSBen Widawsky
395779dd20cSBen Widawsky
3966e099264SDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/create_{pmem,ram}_region
3976e099264SDan WilliamsDate:		May, 2022, January, 2023
3986e099264SDan WilliamsKernelVersion:	v6.0 (pmem), v6.3 (ram)
399779dd20cSBen WidawskyContact:	linux-cxl@vger.kernel.org
400779dd20cSBen WidawskyDescription:
401779dd20cSBen Widawsky		(RW) Write a string in the form 'regionZ' to start the process
4026e099264SDan Williams		of defining a new persistent, or volatile memory region
4036e099264SDan Williams		(interleave-set) within the decode range bounded by root decoder
4046e099264SDan Williams		'decoderX.Y'. The value written must match the current value
4056e099264SDan Williams		returned from reading this attribute. An atomic compare exchange
4066e099264SDan Williams		operation is done on write to assign the requested id to a
4076e099264SDan Williams		region and allocate the region-id for the next creation attempt.
4086e099264SDan Williams		EBUSY is returned if the region name written does not match the
4096e099264SDan Williams		current cached value.
410779dd20cSBen Widawsky
411779dd20cSBen Widawsky
412779dd20cSBen WidawskyWhat:		/sys/bus/cxl/devices/decoderX.Y/delete_region
413779dd20cSBen WidawskyDate:		May, 2022
4148752efd2SDan WilliamsKernelVersion:	v6.0
415779dd20cSBen WidawskyContact:	linux-cxl@vger.kernel.org
416779dd20cSBen WidawskyDescription:
417779dd20cSBen Widawsky		(WO) Write a string in the form 'regionZ' to delete that region,
418779dd20cSBen Widawsky		provided it is currently idle / not bound to a driver.
419dd5ba0ebSBen Widawsky
420dd5ba0ebSBen Widawsky
421529c0a44SDave JiangWhat:		/sys/bus/cxl/devices/decoderX.Y/qos_class
422529c0a44SDave JiangDate:		May, 2023
423529c0a44SDave JiangKernelVersion:	v6.5
424529c0a44SDave JiangContact:	linux-cxl@vger.kernel.org
425529c0a44SDave JiangDescription:
426529c0a44SDave Jiang		(RO) For CXL host platforms that support "QoS Telemmetry" this
427529c0a44SDave Jiang		root-decoder-only attribute conveys a platform specific cookie
428529c0a44SDave Jiang		that identifies a QoS performance class for the CXL Window.
429529c0a44SDave Jiang		This class-id can be compared against a similar "qos_class"
430529c0a44SDave Jiang		published for each memory-type that an endpoint supports. While
431529c0a44SDave Jiang		it is not required that endpoints map their local memory-class
432529c0a44SDave Jiang		to a matching platform class, mismatches are not recommended and
433529c0a44SDave Jiang		there are platform specific side-effects that may result.
434529c0a44SDave Jiang
435529c0a44SDave Jiang
436dd5ba0ebSBen WidawskyWhat:		/sys/bus/cxl/devices/regionZ/uuid
437dd5ba0ebSBen WidawskyDate:		May, 2022
4388752efd2SDan WilliamsKernelVersion:	v6.0
439dd5ba0ebSBen WidawskyContact:	linux-cxl@vger.kernel.org
440dd5ba0ebSBen WidawskyDescription:
441dd5ba0ebSBen Widawsky		(RW) Write a unique identifier for the region. This field must
442dd5ba0ebSBen Widawsky		be set for persistent regions and it must not conflict with the
443a8e7d558SDan Williams		UUID of another region. For volatile ram regions this
444a8e7d558SDan Williams		attribute is a read-only empty string.
44580d10a6cSBen Widawsky
44680d10a6cSBen Widawsky
44780d10a6cSBen WidawskyWhat:		/sys/bus/cxl/devices/regionZ/interleave_granularity
44880d10a6cSBen WidawskyDate:		May, 2022
4498752efd2SDan WilliamsKernelVersion:	v6.0
45080d10a6cSBen WidawskyContact:	linux-cxl@vger.kernel.org
45180d10a6cSBen WidawskyDescription:
45280d10a6cSBen Widawsky		(RW) Set the number of consecutive bytes each device in the
45380d10a6cSBen Widawsky		interleave set will claim. The possible interleave granularity
45480d10a6cSBen Widawsky		values are determined by the CXL spec and the participating
45580d10a6cSBen Widawsky		devices.
45680d10a6cSBen Widawsky
45780d10a6cSBen Widawsky
45880d10a6cSBen WidawskyWhat:		/sys/bus/cxl/devices/regionZ/interleave_ways
45980d10a6cSBen WidawskyDate:		May, 2022
4608752efd2SDan WilliamsKernelVersion:	v6.0
46180d10a6cSBen WidawskyContact:	linux-cxl@vger.kernel.org
46280d10a6cSBen WidawskyDescription:
46380d10a6cSBen Widawsky		(RW) Configures the number of devices participating in the
46480d10a6cSBen Widawsky		region is set by writing this value. Each device will provide
46580d10a6cSBen Widawsky		1/interleave_ways of storage for the region.
46623a22cd1SDan Williams
46723a22cd1SDan Williams
46823a22cd1SDan WilliamsWhat:		/sys/bus/cxl/devices/regionZ/size
46923a22cd1SDan WilliamsDate:		May, 2022
4708752efd2SDan WilliamsKernelVersion:	v6.0
47123a22cd1SDan WilliamsContact:	linux-cxl@vger.kernel.org
47223a22cd1SDan WilliamsDescription:
47323a22cd1SDan Williams		(RW) System physical address space to be consumed by the region.
47423a22cd1SDan Williams		When written trigger the driver to allocate space out of the
47523a22cd1SDan Williams		parent root decoder's address space. When read the size of the
47623a22cd1SDan Williams		address space is reported and should match the span of the
47723a22cd1SDan Williams		region's resource attribute. Size shall be set after the
47823a22cd1SDan Williams		interleave configuration parameters. Once set it cannot be
47923a22cd1SDan Williams		changed, only freed by writing 0. The kernel makes no guarantees
48023a22cd1SDan Williams		that data is maintained over an address space freeing event, and
48123a22cd1SDan Williams		there is no guarantee that a free followed by an allocate
48223a22cd1SDan Williams		results in the same address being allocated.
48323a22cd1SDan Williams
48423a22cd1SDan Williams
4857d505f98SDan WilliamsWhat:		/sys/bus/cxl/devices/regionZ/mode
4867d505f98SDan WilliamsDate:		January, 2023
4877d505f98SDan WilliamsKernelVersion:	v6.3
4887d505f98SDan WilliamsContact:	linux-cxl@vger.kernel.org
4897d505f98SDan WilliamsDescription:
4907d505f98SDan Williams		(RO) The mode of a region is established at region creation time
4917d505f98SDan Williams		and dictates the mode of the endpoint decoder that comprise the
4927d505f98SDan Williams		region. For more details on the possible modes see
4937d505f98SDan Williams		/sys/bus/cxl/devices/decoderX.Y/mode
4947d505f98SDan Williams
4957d505f98SDan Williams
49623a22cd1SDan WilliamsWhat:		/sys/bus/cxl/devices/regionZ/resource
49723a22cd1SDan WilliamsDate:		May, 2022
4988752efd2SDan WilliamsKernelVersion:	v6.0
49923a22cd1SDan WilliamsContact:	linux-cxl@vger.kernel.org
50023a22cd1SDan WilliamsDescription:
50123a22cd1SDan Williams		(RO) A region is a contiguous partition of a CXL root decoder
50223a22cd1SDan Williams		address space. Region capacity is allocated by writing to the
50323a22cd1SDan Williams		size attribute, the resulting physical address space determined
50423a22cd1SDan Williams		by the driver is reflected here. It is therefore not useful to
50523a22cd1SDan Williams		read this before writing a value to the size attribute.
506b9686e8cSDan Williams
507b9686e8cSDan Williams
508b9686e8cSDan WilliamsWhat:		/sys/bus/cxl/devices/regionZ/target[0..N]
509b9686e8cSDan WilliamsDate:		May, 2022
5108752efd2SDan WilliamsKernelVersion:	v6.0
511b9686e8cSDan WilliamsContact:	linux-cxl@vger.kernel.org
512b9686e8cSDan WilliamsDescription:
513b9686e8cSDan Williams		(RW) Write an endpoint decoder object name to 'targetX' where X
514b9686e8cSDan Williams		is the intended position of the endpoint device in the region
515b9686e8cSDan Williams		interleave and N is the 'interleave_ways' setting for the
516b9686e8cSDan Williams		region. ENXIO is returned if the write results in an impossible
517b9686e8cSDan Williams		to map decode scenario, like the endpoint is unreachable at that
518b9686e8cSDan Williams		position relative to the root decoder interleave. EBUSY is
519b9686e8cSDan Williams		returned if the position in the region is already occupied, or
520b9686e8cSDan Williams		if the region is not in a state to accept interleave
521b9686e8cSDan Williams		configuration changes. EINVAL is returned if the object name is
522b9686e8cSDan Williams		not an endpoint decoder. Once all positions have been
523b9686e8cSDan Williams		successfully written a final validation for decode conflicts is
524b9686e8cSDan Williams		performed before activating the region.
525176baefbSDan Williams
526176baefbSDan Williams
527176baefbSDan WilliamsWhat:		/sys/bus/cxl/devices/regionZ/commit
528176baefbSDan WilliamsDate:		May, 2022
5298752efd2SDan WilliamsKernelVersion:	v6.0
530176baefbSDan WilliamsContact:	linux-cxl@vger.kernel.org
531176baefbSDan WilliamsDescription:
532176baefbSDan Williams		(RW) Write a boolean 'true' string value to this attribute to
533176baefbSDan Williams		trigger the region to transition from the software programmed
534176baefbSDan Williams		state to the actively decoding in hardware state. The commit
535176baefbSDan Williams		operation in addition to validating that the region is in proper
536176baefbSDan Williams		configured state, validates that the decoders are being
537176baefbSDan Williams		committed in spec mandated order (last committed decoder id +
538176baefbSDan Williams		1), and checks that the hardware accepts the commit request.
539176baefbSDan Williams		Reading this value indicates whether the region is committed or
540176baefbSDan Williams		not.
5417ff6ad10SAlison Schofield
5427ff6ad10SAlison Schofield
5437ff6ad10SAlison SchofieldWhat:		/sys/bus/cxl/devices/memX/trigger_poison_list
5447ff6ad10SAlison SchofieldDate:		April, 2023
5457ff6ad10SAlison SchofieldKernelVersion:	v6.4
5467ff6ad10SAlison SchofieldContact:	linux-cxl@vger.kernel.org
5477ff6ad10SAlison SchofieldDescription:
5487ff6ad10SAlison Schofield		(WO) When a boolean 'true' is written to this attribute the
5497ff6ad10SAlison Schofield		memdev driver retrieves the poison list from the device. The
5507ff6ad10SAlison Schofield		list consists of addresses that are poisoned, or would result
5517ff6ad10SAlison Schofield		in poison if accessed, and the source of the poison. This
5527ff6ad10SAlison Schofield		attribute is only visible for devices supporting the
5537ff6ad10SAlison Schofield		capability. The retrieved errors are logged as kernel
5547ff6ad10SAlison Schofield		events when cxl_poison event tracing is enabled.
555*c20eaf44SDave Jiang
556*c20eaf44SDave Jiang
557*c20eaf44SDave JiangWhat:		/sys/bus/cxl/devices/regionZ/accessY/read_bandwidth
558*c20eaf44SDave Jiang		/sys/bus/cxl/devices/regionZ/accessY/write_banwidth
559*c20eaf44SDave JiangDate:		Jan, 2024
560*c20eaf44SDave JiangKernelVersion:	v6.9
561*c20eaf44SDave JiangContact:	linux-cxl@vger.kernel.org
562*c20eaf44SDave JiangDescription:
563*c20eaf44SDave Jiang		(RO) The aggregated read or write bandwidth of the region. The
564*c20eaf44SDave Jiang		number is the accumulated read or write bandwidth of all CXL memory
565*c20eaf44SDave Jiang		devices that contributes to the region in MB/s. It is
566*c20eaf44SDave Jiang		identical data that should appear in
567*c20eaf44SDave Jiang		/sys/devices/system/node/nodeX/accessY/initiators/read_bandwidth or
568*c20eaf44SDave Jiang		/sys/devices/system/node/nodeX/accessY/initiators/write_bandwidth.
569*c20eaf44SDave Jiang		See Documentation/ABI/stable/sysfs-devices-node. access0 provides
570*c20eaf44SDave Jiang		the number to the closest initiator and access1 provides the
571*c20eaf44SDave Jiang		number to the closest CPU.
572*c20eaf44SDave Jiang
573*c20eaf44SDave Jiang
574*c20eaf44SDave JiangWhat:		/sys/bus/cxl/devices/regionZ/accessY/read_latency
575*c20eaf44SDave Jiang		/sys/bus/cxl/devices/regionZ/accessY/write_latency
576*c20eaf44SDave JiangDate:		Jan, 2024
577*c20eaf44SDave JiangKernelVersion:	v6.9
578*c20eaf44SDave JiangContact:	linux-cxl@vger.kernel.org
579*c20eaf44SDave JiangDescription:
580*c20eaf44SDave Jiang		(RO) The read or write latency of the region. The number is
581*c20eaf44SDave Jiang		the worst read or write latency of all CXL memory devices that
582*c20eaf44SDave Jiang		contributes to the region in nanoseconds. It is identical data
583*c20eaf44SDave Jiang		that should appear in
584*c20eaf44SDave Jiang		/sys/devices/system/node/nodeX/accessY/initiators/read_latency or
585*c20eaf44SDave Jiang		/sys/devices/system/node/nodeX/accessY/initiators/write_latency.
586*c20eaf44SDave Jiang		See Documentation/ABI/stable/sysfs-devices-node. access0 provides
587*c20eaf44SDave Jiang		the number to the closest initiator and access1 provides the
588*c20eaf44SDave Jiang		number to the closest CPU.
589