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
31b39cb105SDan WilliamsWhat:		/sys/bus/cxl/devices/memX/pmem/size
32b39cb105SDan WilliamsDate:		December, 2020
33b39cb105SDan WilliamsKernelVersion:	v5.12
34b39cb105SDan WilliamsContact:	linux-cxl@vger.kernel.org
35b39cb105SDan WilliamsDescription:
36b39cb105SDan Williams		(RO) "Persistent Only Capacity" as bytes. Represents the
37b39cb105SDan Williams		identically named field in the Identify Memory Device Output
38b39cb105SDan Williams		Payload in the CXL-2.0 specification.
394812be97SDan Williams
406b625b2bSDan Williams
41bcc79ea3SDan WilliamsWhat:		/sys/bus/cxl/devices/memX/serial
42bcc79ea3SDan WilliamsDate:		January, 2022
43bcc79ea3SDan WilliamsKernelVersion:	v5.18
44bcc79ea3SDan WilliamsContact:	linux-cxl@vger.kernel.org
45bcc79ea3SDan WilliamsDescription:
46bcc79ea3SDan Williams		(RO) 64-bit serial number per the PCIe Device Serial Number
47bcc79ea3SDan Williams		capability. Mandatory for CXL devices, see CXL 2.0 8.1.12.2
48bcc79ea3SDan Williams		Memory Device PCIe Capabilities and Extended Capabilities.
49bcc79ea3SDan Williams
506b625b2bSDan Williams
51cf1f6877SDan WilliamsWhat:		/sys/bus/cxl/devices/memX/numa_node
52cf1f6877SDan WilliamsDate:		January, 2022
53cf1f6877SDan WilliamsKernelVersion:	v5.18
54cf1f6877SDan WilliamsContact:	linux-cxl@vger.kernel.org
55cf1f6877SDan WilliamsDescription:
56cf1f6877SDan Williams		(RO) If NUMA is enabled and the platform has affinitized the
57cf1f6877SDan Williams		host PCI device for this memory device, emit the CPU node
58cf1f6877SDan Williams		affinity for this device.
59cf1f6877SDan Williams
606b625b2bSDan Williams
614812be97SDan WilliamsWhat:		/sys/bus/cxl/devices/*/devtype
624812be97SDan WilliamsDate:		June, 2021
634812be97SDan WilliamsKernelVersion:	v5.14
644812be97SDan WilliamsContact:	linux-cxl@vger.kernel.org
654812be97SDan WilliamsDescription:
6686677a4eSDan Williams		(RO) CXL device objects export the devtype attribute which
6786677a4eSDan Williams		mirrors the same value communicated in the DEVTYPE environment
6886677a4eSDan Williams		variable for uevents for devices on the "cxl" bus.
694812be97SDan Williams
706b625b2bSDan Williams
7183fbdbe4SDan WilliamsWhat:		/sys/bus/cxl/devices/*/modalias
7283fbdbe4SDan WilliamsDate:		December, 2021
7383fbdbe4SDan WilliamsKernelVersion:	v5.18
7483fbdbe4SDan WilliamsContact:	linux-cxl@vger.kernel.org
7583fbdbe4SDan WilliamsDescription:
7686677a4eSDan Williams		(RO) CXL device objects export the modalias attribute which
7786677a4eSDan Williams		mirrors the same value communicated in the MODALIAS environment
7886677a4eSDan Williams		variable for uevents for devices on the "cxl" bus.
7983fbdbe4SDan Williams
806b625b2bSDan Williams
814812be97SDan WilliamsWhat:		/sys/bus/cxl/devices/portX/uport
824812be97SDan WilliamsDate:		June, 2021
834812be97SDan WilliamsKernelVersion:	v5.14
844812be97SDan WilliamsContact:	linux-cxl@vger.kernel.org
854812be97SDan WilliamsDescription:
8686677a4eSDan Williams		(RO) CXL port objects are enumerated from either a platform
8786677a4eSDan Williams		firmware device (ACPI0017 and ACPI0016) or PCIe switch upstream
8886677a4eSDan Williams		port with CXL component registers. The 'uport' symlink connects
8986677a4eSDan Williams		the CXL portX object to the device that published the CXL port
904812be97SDan Williams		capability.
917d4b5ca2SDan Williams
926b625b2bSDan Williams
937d4b5ca2SDan WilliamsWhat:		/sys/bus/cxl/devices/portX/dportY
947d4b5ca2SDan WilliamsDate:		June, 2021
957d4b5ca2SDan WilliamsKernelVersion:	v5.14
967d4b5ca2SDan WilliamsContact:	linux-cxl@vger.kernel.org
977d4b5ca2SDan WilliamsDescription:
9886677a4eSDan Williams		(RO) CXL port objects are enumerated from either a platform
9986677a4eSDan Williams		firmware device (ACPI0017 and ACPI0016) or PCIe switch upstream
10086677a4eSDan Williams		port with CXL component registers. The 'dportY' symlink
10186677a4eSDan Williams		identifies one or more downstream ports that the upstream port
10286677a4eSDan Williams		may target in its decode of CXL memory resources.  The 'Y'
10386677a4eSDan Williams		integer reflects the hardware port unique-id used in the
10486677a4eSDan Williams		hardware decoder target list.
10540ba17afSDan Williams
1066b625b2bSDan Williams
10740ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y
10840ba17afSDan WilliamsDate:		June, 2021
10940ba17afSDan WilliamsKernelVersion:	v5.14
11040ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
11140ba17afSDan WilliamsDescription:
11286677a4eSDan Williams		(RO) CXL decoder objects are enumerated from either a platform
11340ba17afSDan Williams		firmware description, or a CXL HDM decoder register set in a
11440ba17afSDan Williams		PCIe device (see CXL 2.0 section 8.2.5.12 CXL HDM Decoder
11540ba17afSDan Williams		Capability Structure). The 'X' in decoderX.Y represents the
11640ba17afSDan Williams		cxl_port container of this decoder, and 'Y' represents the
11740ba17afSDan Williams		instance id of a given decoder resource.
11840ba17afSDan Williams
1196b625b2bSDan Williams
12040ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/{start,size}
12140ba17afSDan WilliamsDate:		June, 2021
12240ba17afSDan WilliamsKernelVersion:	v5.14
12340ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
12440ba17afSDan WilliamsDescription:
12586677a4eSDan Williams		(RO) The 'start' and 'size' attributes together convey the
12686677a4eSDan Williams		physical address base and number of bytes mapped in the
12786677a4eSDan Williams		decoder's decode window. For decoders of devtype
12886677a4eSDan Williams		"cxl_decoder_root" the address range is fixed. For decoders of
12986677a4eSDan Williams		devtype "cxl_decoder_switch" the address is bounded by the
13086677a4eSDan Williams		decode range of the cxl_port ancestor of the decoder's cxl_port,
13186677a4eSDan Williams		and dynamically updates based on the active memory regions in
13286677a4eSDan Williams		that address space.
13340ba17afSDan Williams
1346b625b2bSDan Williams
13540ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/locked
13640ba17afSDan WilliamsDate:		June, 2021
13740ba17afSDan WilliamsKernelVersion:	v5.14
13840ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
13940ba17afSDan WilliamsDescription:
14086677a4eSDan Williams		(RO) CXL HDM decoders have the capability to lock the
14186677a4eSDan Williams		configuration until the next device reset. For decoders of
14286677a4eSDan Williams		devtype "cxl_decoder_root" there is no standard facility to
14386677a4eSDan Williams		unlock them.  For decoders of devtype "cxl_decoder_switch" a
14486677a4eSDan Williams		secondary bus reset, of the PCIe bridge that provides the bus
14586677a4eSDan Williams		for this decoders uport, unlocks / resets the decoder.
14640ba17afSDan Williams
1476b625b2bSDan Williams
14840ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/target_list
14940ba17afSDan WilliamsDate:		June, 2021
15040ba17afSDan WilliamsKernelVersion:	v5.14
15140ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
15240ba17afSDan WilliamsDescription:
15386677a4eSDan Williams		(RO) Display a comma separated list of the current decoder
15486677a4eSDan Williams		target configuration. The list is ordered by the current
15586677a4eSDan Williams		configured interleave order of the decoder's dport instances.
15686677a4eSDan Williams		Each entry in the list is a dport id.
15740ba17afSDan Williams
1586b625b2bSDan Williams
15940ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/cap_{pmem,ram,type2,type3}
16040ba17afSDan WilliamsDate:		June, 2021
16140ba17afSDan WilliamsKernelVersion:	v5.14
16240ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
16340ba17afSDan WilliamsDescription:
16486677a4eSDan Williams		(RO) When a CXL decoder is of devtype "cxl_decoder_root", it
16540ba17afSDan Williams		represents a fixed memory window identified by platform
16640ba17afSDan Williams		firmware. A fixed window may only support a subset of memory
16740ba17afSDan Williams		types. The 'cap_*' attributes indicate whether persistent
16840ba17afSDan Williams		memory, volatile memory, accelerator memory, and / or expander
16940ba17afSDan Williams		memory may be mapped behind this decoder's memory window.
17040ba17afSDan Williams
1716b625b2bSDan Williams
17240ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/target_type
17340ba17afSDan WilliamsDate:		June, 2021
17440ba17afSDan WilliamsKernelVersion:	v5.14
17540ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
17640ba17afSDan WilliamsDescription:
17786677a4eSDan Williams		(RO) When a CXL decoder is of devtype "cxl_decoder_switch", it
17886677a4eSDan Williams		can optionally decode either accelerator memory (type-2) or
17986677a4eSDan Williams		expander memory (type-3). The 'target_type' attribute indicates
18086677a4eSDan Williams		the current setting which may dynamically change based on what
18140ba17afSDan Williams		memory regions are activated in this decode hierarchy.
182c9700604SIra Weiny
1836b625b2bSDan Williams
184c9700604SIra WeinyWhat:		/sys/bus/cxl/devices/endpointX/CDAT
185c9700604SIra WeinyDate:		July, 2022
186c9700604SIra WeinyKernelVersion:	v5.20
187c9700604SIra WeinyContact:	linux-cxl@vger.kernel.org
188c9700604SIra WeinyDescription:
189c9700604SIra Weiny		(RO) If this sysfs entry is not present no DOE mailbox was
190c9700604SIra Weiny		found to support CDAT data.  If it is present and the length of
191c9700604SIra Weiny		the data is 0 reading the CDAT data failed.  Otherwise the CDAT
192c9700604SIra Weiny		data is reported.
1932c866903SDan Williams
1942c866903SDan Williams
1952c866903SDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/mode
1962c866903SDan WilliamsDate:		May, 2022
1972c866903SDan WilliamsKernelVersion:	v5.20
1982c866903SDan WilliamsContact:	linux-cxl@vger.kernel.org
1992c866903SDan WilliamsDescription:
200cf880423SDan Williams		(RW) When a CXL decoder is of devtype "cxl_decoder_endpoint" it
2012c866903SDan Williams		translates from a host physical address range, to a device local
2022c866903SDan Williams		address range. Device-local address ranges are further split
2032c866903SDan Williams		into a 'ram' (volatile memory) range and 'pmem' (persistent
2042c866903SDan Williams		memory) range. The 'mode' attribute emits one of 'ram', 'pmem',
2052c866903SDan Williams		'mixed', or 'none'. The 'mixed' indication is for error cases
2062c866903SDan Williams		when a decoder straddles the volatile/persistent partition
2072c866903SDan Williams		boundary, and 'none' indicates the decoder is not actively
2082c866903SDan Williams		decoding, or no DPA allocation policy has been set.
209cf880423SDan Williams
210cf880423SDan Williams		'mode' can be written, when the decoder is in the 'disabled'
211cf880423SDan Williams		state, with either 'ram' or 'pmem' to set the boundaries for the
212cf880423SDan Williams		next allocation.
213cf880423SDan Williams
214cf880423SDan Williams
215cf880423SDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/dpa_resource
216cf880423SDan WilliamsDate:		May, 2022
217cf880423SDan WilliamsKernelVersion:	v5.20
218cf880423SDan WilliamsContact:	linux-cxl@vger.kernel.org
219cf880423SDan WilliamsDescription:
220cf880423SDan Williams		(RO) When a CXL decoder is of devtype "cxl_decoder_endpoint",
221cf880423SDan Williams		and its 'dpa_size' attribute is non-zero, this attribute
222cf880423SDan Williams		indicates the device physical address (DPA) base address of the
223cf880423SDan Williams		allocation.
224cf880423SDan Williams
225cf880423SDan Williams
226cf880423SDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/dpa_size
227cf880423SDan WilliamsDate:		May, 2022
228cf880423SDan WilliamsKernelVersion:	v5.20
229cf880423SDan WilliamsContact:	linux-cxl@vger.kernel.org
230cf880423SDan WilliamsDescription:
231cf880423SDan Williams		(RW) When a CXL decoder is of devtype "cxl_decoder_endpoint" it
232cf880423SDan Williams		translates from a host physical address range, to a device local
233cf880423SDan Williams		address range. The range, base address plus length in bytes, of
234cf880423SDan Williams		DPA allocated to this decoder is conveyed in these 2 attributes.
235cf880423SDan Williams		Allocations can be mutated as long as the decoder is in the
236cf880423SDan Williams		disabled state. A write to 'dpa_size' releases the previous DPA
237cf880423SDan Williams		allocation and then attempts to allocate from the free capacity
238cf880423SDan Williams		in the device partition referred to by 'decoderX.Y/mode'.
239cf880423SDan Williams		Allocate and free requests can only be performed on the highest
240cf880423SDan Williams		instance number disabled decoder with non-zero size. I.e.
241cf880423SDan Williams		allocations are enforced to occur in increasing 'decoderX.Y/id'
242cf880423SDan Williams		order and frees are enforced to occur in decreasing
243cf880423SDan Williams		'decoderX.Y/id' order.
244538831f1SBen Widawsky
245538831f1SBen Widawsky
246538831f1SBen WidawskyWhat:		/sys/bus/cxl/devices/decoderX.Y/interleave_ways
247538831f1SBen WidawskyDate:		May, 2022
248538831f1SBen WidawskyKernelVersion:	v5.20
249538831f1SBen WidawskyContact:	linux-cxl@vger.kernel.org
250538831f1SBen WidawskyDescription:
251538831f1SBen Widawsky		(RO) The number of targets across which this decoder's host
252538831f1SBen Widawsky		physical address (HPA) memory range is interleaved. The device
253538831f1SBen Widawsky		maps every Nth block of HPA (of size ==
254538831f1SBen Widawsky		'interleave_granularity') to consecutive DPA addresses. The
255538831f1SBen Widawsky		decoder's position in the interleave is determined by the
256538831f1SBen Widawsky		device's (endpoint or switch) switch ancestry. For root
257538831f1SBen Widawsky		decoders their interleave is specified by platform firmware and
258538831f1SBen Widawsky		they only specify a downstream target order for host bridges.
259538831f1SBen Widawsky
260538831f1SBen Widawsky
261538831f1SBen WidawskyWhat:		/sys/bus/cxl/devices/decoderX.Y/interleave_granularity
262538831f1SBen WidawskyDate:		May, 2022
263538831f1SBen WidawskyKernelVersion:	v5.20
264538831f1SBen WidawskyContact:	linux-cxl@vger.kernel.org
265538831f1SBen WidawskyDescription:
266538831f1SBen Widawsky		(RO) The number of consecutive bytes of host physical address
267538831f1SBen Widawsky		space this decoder claims at address N before the decode rotates
268538831f1SBen Widawsky		to the next target in the interleave at address N +
269538831f1SBen Widawsky		interleave_granularity (assuming N is aligned to
270538831f1SBen Widawsky		interleave_granularity).
271779dd20cSBen Widawsky
272779dd20cSBen Widawsky
273779dd20cSBen WidawskyWhat:		/sys/bus/cxl/devices/decoderX.Y/create_pmem_region
274779dd20cSBen WidawskyDate:		May, 2022
275779dd20cSBen WidawskyKernelVersion:	v5.20
276779dd20cSBen WidawskyContact:	linux-cxl@vger.kernel.org
277779dd20cSBen WidawskyDescription:
278779dd20cSBen Widawsky		(RW) Write a string in the form 'regionZ' to start the process
279779dd20cSBen Widawsky		of defining a new persistent memory region (interleave-set)
280779dd20cSBen Widawsky		within the decode range bounded by root decoder 'decoderX.Y'.
281779dd20cSBen Widawsky		The value written must match the current value returned from
282779dd20cSBen Widawsky		reading this attribute. An atomic compare exchange operation is
283779dd20cSBen Widawsky		done on write to assign the requested id to a region and
284779dd20cSBen Widawsky		allocate the region-id for the next creation attempt. EBUSY is
285779dd20cSBen Widawsky		returned if the region name written does not match the current
286779dd20cSBen Widawsky		cached value.
287779dd20cSBen Widawsky
288779dd20cSBen Widawsky
289779dd20cSBen WidawskyWhat:		/sys/bus/cxl/devices/decoderX.Y/delete_region
290779dd20cSBen WidawskyDate:		May, 2022
291779dd20cSBen WidawskyKernelVersion:	v5.20
292779dd20cSBen WidawskyContact:	linux-cxl@vger.kernel.org
293779dd20cSBen WidawskyDescription:
294779dd20cSBen Widawsky		(WO) Write a string in the form 'regionZ' to delete that region,
295779dd20cSBen Widawsky		provided it is currently idle / not bound to a driver.
296*dd5ba0ebSBen Widawsky
297*dd5ba0ebSBen Widawsky
298*dd5ba0ebSBen WidawskyWhat:		/sys/bus/cxl/devices/regionZ/uuid
299*dd5ba0ebSBen WidawskyDate:		May, 2022
300*dd5ba0ebSBen WidawskyKernelVersion:	v5.20
301*dd5ba0ebSBen WidawskyContact:	linux-cxl@vger.kernel.org
302*dd5ba0ebSBen WidawskyDescription:
303*dd5ba0ebSBen Widawsky		(RW) Write a unique identifier for the region. This field must
304*dd5ba0ebSBen Widawsky		be set for persistent regions and it must not conflict with the
305*dd5ba0ebSBen Widawsky		UUID of another region.
306