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
619968c9ddSDavidlohr BuesoWhat:		/sys/bus/cxl/devices/memX/security/state
629968c9ddSDavidlohr BuesoDate:		June, 2023
639968c9ddSDavidlohr BuesoKernelVersion:	v6.5
649968c9ddSDavidlohr BuesoContact:	linux-cxl@vger.kernel.org
659968c9ddSDavidlohr BuesoDescription:
669968c9ddSDavidlohr Bueso		(RO) Reading this file will display the CXL security state for
6748dcdbb1SDavidlohr Bueso		that device. Such states can be: 'disabled', 'sanitize', when
6848dcdbb1SDavidlohr Bueso		a sanitization is currently underway; or those available only
6948dcdbb1SDavidlohr Bueso		for persistent memory: 'locked', 'unlocked' or 'frozen'. This
7048dcdbb1SDavidlohr Bueso		sysfs entry is select/poll capable from userspace to notify
7148dcdbb1SDavidlohr Bueso		upon completion of a sanitize operation.
7248dcdbb1SDavidlohr Bueso
7348dcdbb1SDavidlohr Bueso
7448dcdbb1SDavidlohr BuesoWhat:           /sys/bus/cxl/devices/memX/security/sanitize
7548dcdbb1SDavidlohr BuesoDate:           June, 2023
7648dcdbb1SDavidlohr BuesoKernelVersion:  v6.5
7748dcdbb1SDavidlohr BuesoContact:        linux-cxl@vger.kernel.org
7848dcdbb1SDavidlohr BuesoDescription:
7948dcdbb1SDavidlohr Bueso		(WO) Write a boolean 'true' string value to this attribute to
8048dcdbb1SDavidlohr Bueso		sanitize the device to securely re-purpose or decommission it.
8148dcdbb1SDavidlohr Bueso		This is done by ensuring that all user data and meta-data,
8248dcdbb1SDavidlohr Bueso		whether it resides in persistent capacity, volatile capacity,
8348dcdbb1SDavidlohr Bueso		or the LSA, is made permanently unavailable by whatever means
8448dcdbb1SDavidlohr Bueso		is appropriate for the media type. This functionality requires
850fcde598SDavidlohr Bueso		the device to be disabled, that is, not actively decoding any
860fcde598SDavidlohr Bueso		HPA ranges. This permits avoiding explicit global CPU cache
870fcde598SDavidlohr Bueso		management, relying instead for it to be done when a region
880fcde598SDavidlohr Bueso		transitions between software programmed and hardware committed
89*ad64f595SDavidlohr Bueso		states. If this file is not present, then there is no hardware
90*ad64f595SDavidlohr Bueso		support for the operation.
919968c9ddSDavidlohr Bueso
929968c9ddSDavidlohr Bueso
93180ffd33SDavidlohr BuesoWhat            /sys/bus/cxl/devices/memX/security/erase
94180ffd33SDavidlohr BuesoDate:           June, 2023
95180ffd33SDavidlohr BuesoKernelVersion:  v6.5
96180ffd33SDavidlohr BuesoContact:        linux-cxl@vger.kernel.org
97180ffd33SDavidlohr BuesoDescription:
98180ffd33SDavidlohr Bueso		(WO) Write a boolean 'true' string value to this attribute to
99180ffd33SDavidlohr Bueso		secure erase user data by changing the media encryption keys for
1000fcde598SDavidlohr Bueso		all user data areas of the device. This functionality requires
1010fcde598SDavidlohr Bueso		the device to be disabled, that is, not actively decoding any
1020fcde598SDavidlohr Bueso		HPA ranges. This permits avoiding explicit global CPU cache
1030fcde598SDavidlohr Bueso		management, relying instead for it to be done when a region
1040fcde598SDavidlohr Bueso		transitions between software programmed and hardware committed
105*ad64f595SDavidlohr Bueso		states. If this file is not present, then there is no hardware
106*ad64f595SDavidlohr Bueso		support for the operation.
107180ffd33SDavidlohr Bueso
108180ffd33SDavidlohr Bueso
1099521875bSVishal VermaWhat:		/sys/bus/cxl/devices/memX/firmware/
1109521875bSVishal VermaDate:		April, 2023
1119521875bSVishal VermaKernelVersion:	v6.5
1129521875bSVishal VermaContact:	linux-cxl@vger.kernel.org
1139521875bSVishal VermaDescription:
1149521875bSVishal Verma		(RW) Firmware uploader mechanism. The different files under
1159521875bSVishal Verma		this directory can be used to upload and activate new
1169521875bSVishal Verma		firmware for CXL devices. The interfaces under this are
1179521875bSVishal Verma		documented in sysfs-class-firmware.
1189521875bSVishal Verma
1199521875bSVishal Verma
1204812be97SDan WilliamsWhat:		/sys/bus/cxl/devices/*/devtype
1214812be97SDan WilliamsDate:		June, 2021
1224812be97SDan WilliamsKernelVersion:	v5.14
1234812be97SDan WilliamsContact:	linux-cxl@vger.kernel.org
1244812be97SDan WilliamsDescription:
12586677a4eSDan Williams		(RO) CXL device objects export the devtype attribute which
12686677a4eSDan Williams		mirrors the same value communicated in the DEVTYPE environment
12786677a4eSDan Williams		variable for uevents for devices on the "cxl" bus.
1284812be97SDan Williams
1296b625b2bSDan Williams
13083fbdbe4SDan WilliamsWhat:		/sys/bus/cxl/devices/*/modalias
13183fbdbe4SDan WilliamsDate:		December, 2021
13283fbdbe4SDan WilliamsKernelVersion:	v5.18
13383fbdbe4SDan WilliamsContact:	linux-cxl@vger.kernel.org
13483fbdbe4SDan WilliamsDescription:
13586677a4eSDan Williams		(RO) CXL device objects export the modalias attribute which
13686677a4eSDan Williams		mirrors the same value communicated in the MODALIAS environment
13786677a4eSDan Williams		variable for uevents for devices on the "cxl" bus.
13883fbdbe4SDan Williams
1396b625b2bSDan Williams
1404812be97SDan WilliamsWhat:		/sys/bus/cxl/devices/portX/uport
1414812be97SDan WilliamsDate:		June, 2021
1424812be97SDan WilliamsKernelVersion:	v5.14
1434812be97SDan WilliamsContact:	linux-cxl@vger.kernel.org
1444812be97SDan WilliamsDescription:
14586677a4eSDan Williams		(RO) CXL port objects are enumerated from either a platform
14686677a4eSDan Williams		firmware device (ACPI0017 and ACPI0016) or PCIe switch upstream
14786677a4eSDan Williams		port with CXL component registers. The 'uport' symlink connects
14886677a4eSDan Williams		the CXL portX object to the device that published the CXL port
1494812be97SDan Williams		capability.
1507d4b5ca2SDan Williams
1516b625b2bSDan Williams
152172738bbSDan WilliamsWhat:		/sys/bus/cxl/devices/{port,endpoint}X/parent_dport
153172738bbSDan WilliamsDate:		January, 2023
154172738bbSDan WilliamsKernelVersion:	v6.3
155172738bbSDan WilliamsContact:	linux-cxl@vger.kernel.org
156172738bbSDan WilliamsDescription:
157172738bbSDan Williams		(RO) CXL port objects are instantiated for each upstream port in
158172738bbSDan Williams		a CXL/PCIe switch, and for each endpoint to map the
159172738bbSDan Williams		corresponding memory device into the CXL port hierarchy. When a
160172738bbSDan Williams		descendant CXL port (switch or endpoint) is enumerated it is
161172738bbSDan Williams		useful to know which 'dport' object in the parent CXL port
162172738bbSDan Williams		routes to this descendant. The 'parent_dport' symlink points to
163172738bbSDan Williams		the device representing the downstream port of a CXL switch that
164172738bbSDan Williams		routes to {port,endpoint}X.
165172738bbSDan Williams
166172738bbSDan Williams
1677d4b5ca2SDan WilliamsWhat:		/sys/bus/cxl/devices/portX/dportY
1687d4b5ca2SDan WilliamsDate:		June, 2021
1697d4b5ca2SDan WilliamsKernelVersion:	v5.14
1707d4b5ca2SDan WilliamsContact:	linux-cxl@vger.kernel.org
1717d4b5ca2SDan WilliamsDescription:
17286677a4eSDan Williams		(RO) CXL port objects are enumerated from either a platform
17386677a4eSDan Williams		firmware device (ACPI0017 and ACPI0016) or PCIe switch upstream
17486677a4eSDan Williams		port with CXL component registers. The 'dportY' symlink
17586677a4eSDan Williams		identifies one or more downstream ports that the upstream port
17686677a4eSDan Williams		may target in its decode of CXL memory resources.  The 'Y'
17786677a4eSDan Williams		integer reflects the hardware port unique-id used in the
17886677a4eSDan Williams		hardware decoder target list.
17940ba17afSDan Williams
1806b625b2bSDan Williams
18140ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y
18240ba17afSDan WilliamsDate:		June, 2021
18340ba17afSDan WilliamsKernelVersion:	v5.14
18440ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
18540ba17afSDan WilliamsDescription:
18686677a4eSDan Williams		(RO) CXL decoder objects are enumerated from either a platform
18740ba17afSDan Williams		firmware description, or a CXL HDM decoder register set in a
18840ba17afSDan Williams		PCIe device (see CXL 2.0 section 8.2.5.12 CXL HDM Decoder
18940ba17afSDan Williams		Capability Structure). The 'X' in decoderX.Y represents the
19040ba17afSDan Williams		cxl_port container of this decoder, and 'Y' represents the
19140ba17afSDan Williams		instance id of a given decoder resource.
19240ba17afSDan Williams
1936b625b2bSDan Williams
19440ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/{start,size}
19540ba17afSDan WilliamsDate:		June, 2021
19640ba17afSDan WilliamsKernelVersion:	v5.14
19740ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
19840ba17afSDan WilliamsDescription:
19986677a4eSDan Williams		(RO) The 'start' and 'size' attributes together convey the
20086677a4eSDan Williams		physical address base and number of bytes mapped in the
20186677a4eSDan Williams		decoder's decode window. For decoders of devtype
20286677a4eSDan Williams		"cxl_decoder_root" the address range is fixed. For decoders of
20386677a4eSDan Williams		devtype "cxl_decoder_switch" the address is bounded by the
20486677a4eSDan Williams		decode range of the cxl_port ancestor of the decoder's cxl_port,
20586677a4eSDan Williams		and dynamically updates based on the active memory regions in
20686677a4eSDan Williams		that address space.
20740ba17afSDan Williams
2086b625b2bSDan Williams
20940ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/locked
21040ba17afSDan WilliamsDate:		June, 2021
21140ba17afSDan WilliamsKernelVersion:	v5.14
21240ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
21340ba17afSDan WilliamsDescription:
21486677a4eSDan Williams		(RO) CXL HDM decoders have the capability to lock the
21586677a4eSDan Williams		configuration until the next device reset. For decoders of
21686677a4eSDan Williams		devtype "cxl_decoder_root" there is no standard facility to
21786677a4eSDan Williams		unlock them.  For decoders of devtype "cxl_decoder_switch" a
21886677a4eSDan Williams		secondary bus reset, of the PCIe bridge that provides the bus
21986677a4eSDan Williams		for this decoders uport, unlocks / resets the decoder.
22040ba17afSDan Williams
2216b625b2bSDan Williams
22240ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/target_list
22340ba17afSDan WilliamsDate:		June, 2021
22440ba17afSDan WilliamsKernelVersion:	v5.14
22540ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
22640ba17afSDan WilliamsDescription:
22786677a4eSDan Williams		(RO) Display a comma separated list of the current decoder
22886677a4eSDan Williams		target configuration. The list is ordered by the current
22986677a4eSDan Williams		configured interleave order of the decoder's dport instances.
23086677a4eSDan Williams		Each entry in the list is a dport id.
23140ba17afSDan Williams
2326b625b2bSDan Williams
23340ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/cap_{pmem,ram,type2,type3}
23440ba17afSDan WilliamsDate:		June, 2021
23540ba17afSDan WilliamsKernelVersion:	v5.14
23640ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
23740ba17afSDan WilliamsDescription:
23886677a4eSDan Williams		(RO) When a CXL decoder is of devtype "cxl_decoder_root", it
23940ba17afSDan Williams		represents a fixed memory window identified by platform
24040ba17afSDan Williams		firmware. A fixed window may only support a subset of memory
24140ba17afSDan Williams		types. The 'cap_*' attributes indicate whether persistent
24240ba17afSDan Williams		memory, volatile memory, accelerator memory, and / or expander
24340ba17afSDan Williams		memory may be mapped behind this decoder's memory window.
24440ba17afSDan Williams
2456b625b2bSDan Williams
24640ba17afSDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/target_type
24740ba17afSDan WilliamsDate:		June, 2021
24840ba17afSDan WilliamsKernelVersion:	v5.14
24940ba17afSDan WilliamsContact:	linux-cxl@vger.kernel.org
25040ba17afSDan WilliamsDescription:
25186677a4eSDan Williams		(RO) When a CXL decoder is of devtype "cxl_decoder_switch", it
25286677a4eSDan Williams		can optionally decode either accelerator memory (type-2) or
25386677a4eSDan Williams		expander memory (type-3). The 'target_type' attribute indicates
25486677a4eSDan Williams		the current setting which may dynamically change based on what
25540ba17afSDan Williams		memory regions are activated in this decode hierarchy.
256c9700604SIra Weiny
2576b625b2bSDan Williams
258c9700604SIra WeinyWhat:		/sys/bus/cxl/devices/endpointX/CDAT
259c9700604SIra WeinyDate:		July, 2022
2608752efd2SDan WilliamsKernelVersion:	v6.0
261c9700604SIra WeinyContact:	linux-cxl@vger.kernel.org
262c9700604SIra WeinyDescription:
263c9700604SIra Weiny		(RO) If this sysfs entry is not present no DOE mailbox was
264c9700604SIra Weiny		found to support CDAT data.  If it is present and the length of
265c9700604SIra Weiny		the data is 0 reading the CDAT data failed.  Otherwise the CDAT
266c9700604SIra Weiny		data is reported.
2672c866903SDan Williams
2682c866903SDan Williams
2692c866903SDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/mode
2702c866903SDan WilliamsDate:		May, 2022
2718752efd2SDan WilliamsKernelVersion:	v6.0
2722c866903SDan WilliamsContact:	linux-cxl@vger.kernel.org
2732c866903SDan WilliamsDescription:
274cf880423SDan Williams		(RW) When a CXL decoder is of devtype "cxl_decoder_endpoint" it
2752c866903SDan Williams		translates from a host physical address range, to a device local
2762c866903SDan Williams		address range. Device-local address ranges are further split
2772c866903SDan Williams		into a 'ram' (volatile memory) range and 'pmem' (persistent
2782c866903SDan Williams		memory) range. The 'mode' attribute emits one of 'ram', 'pmem',
2792c866903SDan Williams		'mixed', or 'none'. The 'mixed' indication is for error cases
2802c866903SDan Williams		when a decoder straddles the volatile/persistent partition
2812c866903SDan Williams		boundary, and 'none' indicates the decoder is not actively
2822c866903SDan Williams		decoding, or no DPA allocation policy has been set.
283cf880423SDan Williams
284cf880423SDan Williams		'mode' can be written, when the decoder is in the 'disabled'
285cf880423SDan Williams		state, with either 'ram' or 'pmem' to set the boundaries for the
286cf880423SDan Williams		next allocation.
287cf880423SDan Williams
288cf880423SDan Williams
289cf880423SDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/dpa_resource
290cf880423SDan WilliamsDate:		May, 2022
2918752efd2SDan WilliamsKernelVersion:	v6.0
292cf880423SDan WilliamsContact:	linux-cxl@vger.kernel.org
293cf880423SDan WilliamsDescription:
294cf880423SDan Williams		(RO) When a CXL decoder is of devtype "cxl_decoder_endpoint",
295cf880423SDan Williams		and its 'dpa_size' attribute is non-zero, this attribute
296cf880423SDan Williams		indicates the device physical address (DPA) base address of the
297cf880423SDan Williams		allocation.
298cf880423SDan Williams
299cf880423SDan Williams
300cf880423SDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/dpa_size
301cf880423SDan WilliamsDate:		May, 2022
3028752efd2SDan WilliamsKernelVersion:	v6.0
303cf880423SDan WilliamsContact:	linux-cxl@vger.kernel.org
304cf880423SDan WilliamsDescription:
305cf880423SDan Williams		(RW) When a CXL decoder is of devtype "cxl_decoder_endpoint" it
306cf880423SDan Williams		translates from a host physical address range, to a device local
307cf880423SDan Williams		address range. The range, base address plus length in bytes, of
308cf880423SDan Williams		DPA allocated to this decoder is conveyed in these 2 attributes.
309cf880423SDan Williams		Allocations can be mutated as long as the decoder is in the
310cf880423SDan Williams		disabled state. A write to 'dpa_size' releases the previous DPA
311cf880423SDan Williams		allocation and then attempts to allocate from the free capacity
312cf880423SDan Williams		in the device partition referred to by 'decoderX.Y/mode'.
313cf880423SDan Williams		Allocate and free requests can only be performed on the highest
314cf880423SDan Williams		instance number disabled decoder with non-zero size. I.e.
315cf880423SDan Williams		allocations are enforced to occur in increasing 'decoderX.Y/id'
316cf880423SDan Williams		order and frees are enforced to occur in decreasing
317cf880423SDan Williams		'decoderX.Y/id' order.
318538831f1SBen Widawsky
319538831f1SBen Widawsky
320538831f1SBen WidawskyWhat:		/sys/bus/cxl/devices/decoderX.Y/interleave_ways
321538831f1SBen WidawskyDate:		May, 2022
3228752efd2SDan WilliamsKernelVersion:	v6.0
323538831f1SBen WidawskyContact:	linux-cxl@vger.kernel.org
324538831f1SBen WidawskyDescription:
325538831f1SBen Widawsky		(RO) The number of targets across which this decoder's host
326538831f1SBen Widawsky		physical address (HPA) memory range is interleaved. The device
327538831f1SBen Widawsky		maps every Nth block of HPA (of size ==
328538831f1SBen Widawsky		'interleave_granularity') to consecutive DPA addresses. The
329538831f1SBen Widawsky		decoder's position in the interleave is determined by the
330538831f1SBen Widawsky		device's (endpoint or switch) switch ancestry. For root
331538831f1SBen Widawsky		decoders their interleave is specified by platform firmware and
332538831f1SBen Widawsky		they only specify a downstream target order for host bridges.
333538831f1SBen Widawsky
334538831f1SBen Widawsky
335538831f1SBen WidawskyWhat:		/sys/bus/cxl/devices/decoderX.Y/interleave_granularity
336538831f1SBen WidawskyDate:		May, 2022
3378752efd2SDan WilliamsKernelVersion:	v6.0
338538831f1SBen WidawskyContact:	linux-cxl@vger.kernel.org
339538831f1SBen WidawskyDescription:
340538831f1SBen Widawsky		(RO) The number of consecutive bytes of host physical address
341538831f1SBen Widawsky		space this decoder claims at address N before the decode rotates
342538831f1SBen Widawsky		to the next target in the interleave at address N +
343538831f1SBen Widawsky		interleave_granularity (assuming N is aligned to
344538831f1SBen Widawsky		interleave_granularity).
345779dd20cSBen Widawsky
346779dd20cSBen Widawsky
3476e099264SDan WilliamsWhat:		/sys/bus/cxl/devices/decoderX.Y/create_{pmem,ram}_region
3486e099264SDan WilliamsDate:		May, 2022, January, 2023
3496e099264SDan WilliamsKernelVersion:	v6.0 (pmem), v6.3 (ram)
350779dd20cSBen WidawskyContact:	linux-cxl@vger.kernel.org
351779dd20cSBen WidawskyDescription:
352779dd20cSBen Widawsky		(RW) Write a string in the form 'regionZ' to start the process
3536e099264SDan Williams		of defining a new persistent, or volatile memory region
3546e099264SDan Williams		(interleave-set) within the decode range bounded by root decoder
3556e099264SDan Williams		'decoderX.Y'. The value written must match the current value
3566e099264SDan Williams		returned from reading this attribute. An atomic compare exchange
3576e099264SDan Williams		operation is done on write to assign the requested id to a
3586e099264SDan Williams		region and allocate the region-id for the next creation attempt.
3596e099264SDan Williams		EBUSY is returned if the region name written does not match the
3606e099264SDan Williams		current cached value.
361779dd20cSBen Widawsky
362779dd20cSBen Widawsky
363779dd20cSBen WidawskyWhat:		/sys/bus/cxl/devices/decoderX.Y/delete_region
364779dd20cSBen WidawskyDate:		May, 2022
3658752efd2SDan WilliamsKernelVersion:	v6.0
366779dd20cSBen WidawskyContact:	linux-cxl@vger.kernel.org
367779dd20cSBen WidawskyDescription:
368779dd20cSBen Widawsky		(WO) Write a string in the form 'regionZ' to delete that region,
369779dd20cSBen Widawsky		provided it is currently idle / not bound to a driver.
370dd5ba0ebSBen Widawsky
371dd5ba0ebSBen Widawsky
372dd5ba0ebSBen WidawskyWhat:		/sys/bus/cxl/devices/regionZ/uuid
373dd5ba0ebSBen WidawskyDate:		May, 2022
3748752efd2SDan WilliamsKernelVersion:	v6.0
375dd5ba0ebSBen WidawskyContact:	linux-cxl@vger.kernel.org
376dd5ba0ebSBen WidawskyDescription:
377dd5ba0ebSBen Widawsky		(RW) Write a unique identifier for the region. This field must
378dd5ba0ebSBen Widawsky		be set for persistent regions and it must not conflict with the
379a8e7d558SDan Williams		UUID of another region. For volatile ram regions this
380a8e7d558SDan Williams		attribute is a read-only empty string.
38180d10a6cSBen Widawsky
38280d10a6cSBen Widawsky
38380d10a6cSBen WidawskyWhat:		/sys/bus/cxl/devices/regionZ/interleave_granularity
38480d10a6cSBen WidawskyDate:		May, 2022
3858752efd2SDan WilliamsKernelVersion:	v6.0
38680d10a6cSBen WidawskyContact:	linux-cxl@vger.kernel.org
38780d10a6cSBen WidawskyDescription:
38880d10a6cSBen Widawsky		(RW) Set the number of consecutive bytes each device in the
38980d10a6cSBen Widawsky		interleave set will claim. The possible interleave granularity
39080d10a6cSBen Widawsky		values are determined by the CXL spec and the participating
39180d10a6cSBen Widawsky		devices.
39280d10a6cSBen Widawsky
39380d10a6cSBen Widawsky
39480d10a6cSBen WidawskyWhat:		/sys/bus/cxl/devices/regionZ/interleave_ways
39580d10a6cSBen WidawskyDate:		May, 2022
3968752efd2SDan WilliamsKernelVersion:	v6.0
39780d10a6cSBen WidawskyContact:	linux-cxl@vger.kernel.org
39880d10a6cSBen WidawskyDescription:
39980d10a6cSBen Widawsky		(RW) Configures the number of devices participating in the
40080d10a6cSBen Widawsky		region is set by writing this value. Each device will provide
40180d10a6cSBen Widawsky		1/interleave_ways of storage for the region.
40223a22cd1SDan Williams
40323a22cd1SDan Williams
40423a22cd1SDan WilliamsWhat:		/sys/bus/cxl/devices/regionZ/size
40523a22cd1SDan WilliamsDate:		May, 2022
4068752efd2SDan WilliamsKernelVersion:	v6.0
40723a22cd1SDan WilliamsContact:	linux-cxl@vger.kernel.org
40823a22cd1SDan WilliamsDescription:
40923a22cd1SDan Williams		(RW) System physical address space to be consumed by the region.
41023a22cd1SDan Williams		When written trigger the driver to allocate space out of the
41123a22cd1SDan Williams		parent root decoder's address space. When read the size of the
41223a22cd1SDan Williams		address space is reported and should match the span of the
41323a22cd1SDan Williams		region's resource attribute. Size shall be set after the
41423a22cd1SDan Williams		interleave configuration parameters. Once set it cannot be
41523a22cd1SDan Williams		changed, only freed by writing 0. The kernel makes no guarantees
41623a22cd1SDan Williams		that data is maintained over an address space freeing event, and
41723a22cd1SDan Williams		there is no guarantee that a free followed by an allocate
41823a22cd1SDan Williams		results in the same address being allocated.
41923a22cd1SDan Williams
42023a22cd1SDan Williams
4217d505f98SDan WilliamsWhat:		/sys/bus/cxl/devices/regionZ/mode
4227d505f98SDan WilliamsDate:		January, 2023
4237d505f98SDan WilliamsKernelVersion:	v6.3
4247d505f98SDan WilliamsContact:	linux-cxl@vger.kernel.org
4257d505f98SDan WilliamsDescription:
4267d505f98SDan Williams		(RO) The mode of a region is established at region creation time
4277d505f98SDan Williams		and dictates the mode of the endpoint decoder that comprise the
4287d505f98SDan Williams		region. For more details on the possible modes see
4297d505f98SDan Williams		/sys/bus/cxl/devices/decoderX.Y/mode
4307d505f98SDan Williams
4317d505f98SDan Williams
43223a22cd1SDan WilliamsWhat:		/sys/bus/cxl/devices/regionZ/resource
43323a22cd1SDan WilliamsDate:		May, 2022
4348752efd2SDan WilliamsKernelVersion:	v6.0
43523a22cd1SDan WilliamsContact:	linux-cxl@vger.kernel.org
43623a22cd1SDan WilliamsDescription:
43723a22cd1SDan Williams		(RO) A region is a contiguous partition of a CXL root decoder
43823a22cd1SDan Williams		address space. Region capacity is allocated by writing to the
43923a22cd1SDan Williams		size attribute, the resulting physical address space determined
44023a22cd1SDan Williams		by the driver is reflected here. It is therefore not useful to
44123a22cd1SDan Williams		read this before writing a value to the size attribute.
442b9686e8cSDan Williams
443b9686e8cSDan Williams
444b9686e8cSDan WilliamsWhat:		/sys/bus/cxl/devices/regionZ/target[0..N]
445b9686e8cSDan WilliamsDate:		May, 2022
4468752efd2SDan WilliamsKernelVersion:	v6.0
447b9686e8cSDan WilliamsContact:	linux-cxl@vger.kernel.org
448b9686e8cSDan WilliamsDescription:
449b9686e8cSDan Williams		(RW) Write an endpoint decoder object name to 'targetX' where X
450b9686e8cSDan Williams		is the intended position of the endpoint device in the region
451b9686e8cSDan Williams		interleave and N is the 'interleave_ways' setting for the
452b9686e8cSDan Williams		region. ENXIO is returned if the write results in an impossible
453b9686e8cSDan Williams		to map decode scenario, like the endpoint is unreachable at that
454b9686e8cSDan Williams		position relative to the root decoder interleave. EBUSY is
455b9686e8cSDan Williams		returned if the position in the region is already occupied, or
456b9686e8cSDan Williams		if the region is not in a state to accept interleave
457b9686e8cSDan Williams		configuration changes. EINVAL is returned if the object name is
458b9686e8cSDan Williams		not an endpoint decoder. Once all positions have been
459b9686e8cSDan Williams		successfully written a final validation for decode conflicts is
460b9686e8cSDan Williams		performed before activating the region.
461176baefbSDan Williams
462176baefbSDan Williams
463176baefbSDan WilliamsWhat:		/sys/bus/cxl/devices/regionZ/commit
464176baefbSDan WilliamsDate:		May, 2022
4658752efd2SDan WilliamsKernelVersion:	v6.0
466176baefbSDan WilliamsContact:	linux-cxl@vger.kernel.org
467176baefbSDan WilliamsDescription:
468176baefbSDan Williams		(RW) Write a boolean 'true' string value to this attribute to
469176baefbSDan Williams		trigger the region to transition from the software programmed
470176baefbSDan Williams		state to the actively decoding in hardware state. The commit
471176baefbSDan Williams		operation in addition to validating that the region is in proper
472176baefbSDan Williams		configured state, validates that the decoders are being
473176baefbSDan Williams		committed in spec mandated order (last committed decoder id +
474176baefbSDan Williams		1), and checks that the hardware accepts the commit request.
475176baefbSDan Williams		Reading this value indicates whether the region is committed or
476176baefbSDan Williams		not.
4777ff6ad10SAlison Schofield
4787ff6ad10SAlison Schofield
4797ff6ad10SAlison SchofieldWhat:		/sys/bus/cxl/devices/memX/trigger_poison_list
4807ff6ad10SAlison SchofieldDate:		April, 2023
4817ff6ad10SAlison SchofieldKernelVersion:	v6.4
4827ff6ad10SAlison SchofieldContact:	linux-cxl@vger.kernel.org
4837ff6ad10SAlison SchofieldDescription:
4847ff6ad10SAlison Schofield		(WO) When a boolean 'true' is written to this attribute the
4857ff6ad10SAlison Schofield		memdev driver retrieves the poison list from the device. The
4867ff6ad10SAlison Schofield		list consists of addresses that are poisoned, or would result
4877ff6ad10SAlison Schofield		in poison if accessed, and the source of the poison. This
4887ff6ad10SAlison Schofield		attribute is only visible for devices supporting the
4897ff6ad10SAlison Schofield		capability. The retrieved errors are logged as kernel
4907ff6ad10SAlison Schofield		events when cxl_poison event tracing is enabled.
491