18dd2bc0fSBen WidawskyWhat: /sys/bus/cxl/flush 2eb8081bcSDavidlohr BuesoDate: January, 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 2117218b02SDavidlohr BuesoWhat: /sys/bus/cxl/devices/memX/payload_max 2217218b02SDavidlohr BuesoDate: December, 2020 2317218b02SDavidlohr BuesoKernelVersion: v5.12 2417218b02SDavidlohr BuesoContact: linux-cxl@vger.kernel.org 2517218b02SDavidlohr BuesoDescription: 2617218b02SDavidlohr Bueso (RO) Maximum size (in bytes) of the mailbox command payload 2717218b02SDavidlohr Bueso registers. Linux caps this at 1MB if the device reports a 2817218b02SDavidlohr Bueso larger size. 2917218b02SDavidlohr Bueso 3017218b02SDavidlohr Bueso 3117218b02SDavidlohr BuesoWhat: /sys/bus/cxl/devices/memX/label_storage_size 3217218b02SDavidlohr BuesoDate: May, 2021 3317218b02SDavidlohr BuesoKernelVersion: v5.13 3417218b02SDavidlohr BuesoContact: linux-cxl@vger.kernel.org 3517218b02SDavidlohr BuesoDescription: 3617218b02SDavidlohr Bueso (RO) Size (in bytes) of the Label Storage Area (LSA). 3717218b02SDavidlohr Bueso 3817218b02SDavidlohr Bueso 39b39cb105SDan WilliamsWhat: /sys/bus/cxl/devices/memX/ram/size 40b39cb105SDan WilliamsDate: December, 2020 41b39cb105SDan WilliamsKernelVersion: v5.12 42b39cb105SDan WilliamsContact: linux-cxl@vger.kernel.org 43b39cb105SDan WilliamsDescription: 44b39cb105SDan Williams (RO) "Volatile Only Capacity" as bytes. Represents the 45b39cb105SDan Williams identically named field in the Identify Memory Device Output 46b39cb105SDan Williams Payload in the CXL-2.0 specification. 47b39cb105SDan Williams 486b625b2bSDan Williams 4942834b17SDave JiangWhat: /sys/bus/cxl/devices/memX/ram/qos_class 5042834b17SDave JiangDate: May, 2023 5142834b17SDave JiangKernelVersion: v6.8 5242834b17SDave JiangContact: linux-cxl@vger.kernel.org 5342834b17SDave JiangDescription: 54eb8081bcSDavidlohr Bueso (RO) For CXL host platforms that support "QoS Telemetry" 5542834b17SDave Jiang this attribute conveys a comma delimited list of platform 5642834b17SDave Jiang specific cookies that identifies a QoS performance class 5742834b17SDave Jiang for the volatile partition of the CXL mem device. These 5842834b17SDave Jiang class-ids can be compared against a similar "qos_class" 5942834b17SDave Jiang published for a root decoder. While it is not required 6042834b17SDave Jiang that the endpoints map their local memory-class to a 6142834b17SDave Jiang matching platform class, mismatches are not recommended 6242834b17SDave Jiang and there are platform specific performance related 6342834b17SDave Jiang side-effects that may result. First class-id is displayed. 6442834b17SDave Jiang 6542834b17SDave Jiang 66b39cb105SDan WilliamsWhat: /sys/bus/cxl/devices/memX/pmem/size 67b39cb105SDan WilliamsDate: December, 2020 68b39cb105SDan WilliamsKernelVersion: v5.12 69b39cb105SDan WilliamsContact: linux-cxl@vger.kernel.org 70b39cb105SDan WilliamsDescription: 71b39cb105SDan Williams (RO) "Persistent Only Capacity" as bytes. Represents the 72b39cb105SDan Williams identically named field in the Identify Memory Device Output 73b39cb105SDan Williams Payload in the CXL-2.0 specification. 744812be97SDan Williams 756b625b2bSDan Williams 7642834b17SDave JiangWhat: /sys/bus/cxl/devices/memX/pmem/qos_class 7742834b17SDave JiangDate: May, 2023 7842834b17SDave JiangKernelVersion: v6.8 7942834b17SDave JiangContact: linux-cxl@vger.kernel.org 8042834b17SDave JiangDescription: 81eb8081bcSDavidlohr Bueso (RO) For CXL host platforms that support "QoS Telemetry" 8242834b17SDave Jiang this attribute conveys a comma delimited list of platform 8342834b17SDave Jiang specific cookies that identifies a QoS performance class 8442834b17SDave Jiang for the persistent partition of the CXL mem device. These 8542834b17SDave Jiang class-ids can be compared against a similar "qos_class" 8642834b17SDave Jiang published for a root decoder. While it is not required 8742834b17SDave Jiang that the endpoints map their local memory-class to a 8842834b17SDave Jiang matching platform class, mismatches are not recommended 8942834b17SDave Jiang and there are platform specific performance related 9042834b17SDave Jiang side-effects that may result. First class-id is displayed. 9142834b17SDave Jiang 9242834b17SDave Jiang 93bcc79ea3SDan WilliamsWhat: /sys/bus/cxl/devices/memX/serial 94bcc79ea3SDan WilliamsDate: January, 2022 95bcc79ea3SDan WilliamsKernelVersion: v5.18 96bcc79ea3SDan WilliamsContact: linux-cxl@vger.kernel.org 97bcc79ea3SDan WilliamsDescription: 98bcc79ea3SDan Williams (RO) 64-bit serial number per the PCIe Device Serial Number 99bcc79ea3SDan Williams capability. Mandatory for CXL devices, see CXL 2.0 8.1.12.2 100bcc79ea3SDan Williams Memory Device PCIe Capabilities and Extended Capabilities. 101bcc79ea3SDan Williams 1026b625b2bSDan Williams 103cf1f6877SDan WilliamsWhat: /sys/bus/cxl/devices/memX/numa_node 104cf1f6877SDan WilliamsDate: January, 2022 105cf1f6877SDan WilliamsKernelVersion: v5.18 106cf1f6877SDan WilliamsContact: linux-cxl@vger.kernel.org 107cf1f6877SDan WilliamsDescription: 108cf1f6877SDan Williams (RO) If NUMA is enabled and the platform has affinitized the 109cf1f6877SDan Williams host PCI device for this memory device, emit the CPU node 110cf1f6877SDan Williams affinity for this device. 111cf1f6877SDan Williams 1126b625b2bSDan Williams 1139968c9ddSDavidlohr BuesoWhat: /sys/bus/cxl/devices/memX/security/state 1149968c9ddSDavidlohr BuesoDate: June, 2023 1159968c9ddSDavidlohr BuesoKernelVersion: v6.5 1169968c9ddSDavidlohr BuesoContact: linux-cxl@vger.kernel.org 1179968c9ddSDavidlohr BuesoDescription: 1189968c9ddSDavidlohr Bueso (RO) Reading this file will display the CXL security state for 11948dcdbb1SDavidlohr Bueso that device. Such states can be: 'disabled', 'sanitize', when 12048dcdbb1SDavidlohr Bueso a sanitization is currently underway; or those available only 12148dcdbb1SDavidlohr Bueso for persistent memory: 'locked', 'unlocked' or 'frozen'. This 12248dcdbb1SDavidlohr Bueso sysfs entry is select/poll capable from userspace to notify 12348dcdbb1SDavidlohr Bueso upon completion of a sanitize operation. 12448dcdbb1SDavidlohr Bueso 12548dcdbb1SDavidlohr Bueso 12648dcdbb1SDavidlohr BuesoWhat: /sys/bus/cxl/devices/memX/security/sanitize 12748dcdbb1SDavidlohr BuesoDate: June, 2023 12848dcdbb1SDavidlohr BuesoKernelVersion: v6.5 12948dcdbb1SDavidlohr BuesoContact: linux-cxl@vger.kernel.org 13048dcdbb1SDavidlohr BuesoDescription: 13148dcdbb1SDavidlohr Bueso (WO) Write a boolean 'true' string value to this attribute to 13248dcdbb1SDavidlohr Bueso sanitize the device to securely re-purpose or decommission it. 13348dcdbb1SDavidlohr Bueso This is done by ensuring that all user data and meta-data, 13448dcdbb1SDavidlohr Bueso whether it resides in persistent capacity, volatile capacity, 13548dcdbb1SDavidlohr Bueso or the LSA, is made permanently unavailable by whatever means 13648dcdbb1SDavidlohr Bueso is appropriate for the media type. This functionality requires 1370fcde598SDavidlohr Bueso the device to be disabled, that is, not actively decoding any 1380fcde598SDavidlohr Bueso HPA ranges. This permits avoiding explicit global CPU cache 1390fcde598SDavidlohr Bueso management, relying instead for it to be done when a region 1400fcde598SDavidlohr Bueso transitions between software programmed and hardware committed 141ad64f595SDavidlohr Bueso states. If this file is not present, then there is no hardware 142ad64f595SDavidlohr Bueso support for the operation. 1439968c9ddSDavidlohr Bueso 1449968c9ddSDavidlohr Bueso 145180ffd33SDavidlohr BuesoWhat /sys/bus/cxl/devices/memX/security/erase 146180ffd33SDavidlohr BuesoDate: June, 2023 147180ffd33SDavidlohr BuesoKernelVersion: v6.5 148180ffd33SDavidlohr BuesoContact: linux-cxl@vger.kernel.org 149180ffd33SDavidlohr BuesoDescription: 150180ffd33SDavidlohr Bueso (WO) Write a boolean 'true' string value to this attribute to 151180ffd33SDavidlohr Bueso secure erase user data by changing the media encryption keys for 1520fcde598SDavidlohr Bueso all user data areas of the device. This functionality requires 1530fcde598SDavidlohr Bueso the device to be disabled, that is, not actively decoding any 1540fcde598SDavidlohr Bueso HPA ranges. This permits avoiding explicit global CPU cache 1550fcde598SDavidlohr Bueso management, relying instead for it to be done when a region 1560fcde598SDavidlohr Bueso transitions between software programmed and hardware committed 157ad64f595SDavidlohr Bueso states. If this file is not present, then there is no hardware 158ad64f595SDavidlohr Bueso support for the operation. 159180ffd33SDavidlohr Bueso 160180ffd33SDavidlohr Bueso 1619521875bSVishal VermaWhat: /sys/bus/cxl/devices/memX/firmware/ 1629521875bSVishal VermaDate: April, 2023 1639521875bSVishal VermaKernelVersion: v6.5 1649521875bSVishal VermaContact: linux-cxl@vger.kernel.org 1659521875bSVishal VermaDescription: 1669521875bSVishal Verma (RW) Firmware uploader mechanism. The different files under 1679521875bSVishal Verma this directory can be used to upload and activate new 1689521875bSVishal Verma firmware for CXL devices. The interfaces under this are 1699521875bSVishal Verma documented in sysfs-class-firmware. 1709521875bSVishal Verma 1719521875bSVishal Verma 1724812be97SDan WilliamsWhat: /sys/bus/cxl/devices/*/devtype 1734812be97SDan WilliamsDate: June, 2021 1744812be97SDan WilliamsKernelVersion: v5.14 1754812be97SDan WilliamsContact: linux-cxl@vger.kernel.org 1764812be97SDan WilliamsDescription: 17786677a4eSDan Williams (RO) CXL device objects export the devtype attribute which 17886677a4eSDan Williams mirrors the same value communicated in the DEVTYPE environment 17986677a4eSDan Williams variable for uevents for devices on the "cxl" bus. 1804812be97SDan Williams 1816b625b2bSDan Williams 18283fbdbe4SDan WilliamsWhat: /sys/bus/cxl/devices/*/modalias 18383fbdbe4SDan WilliamsDate: December, 2021 18483fbdbe4SDan WilliamsKernelVersion: v5.18 18583fbdbe4SDan WilliamsContact: linux-cxl@vger.kernel.org 18683fbdbe4SDan WilliamsDescription: 18786677a4eSDan Williams (RO) CXL device objects export the modalias attribute which 18886677a4eSDan Williams mirrors the same value communicated in the MODALIAS environment 18986677a4eSDan Williams variable for uevents for devices on the "cxl" bus. 19083fbdbe4SDan Williams 1916b625b2bSDan Williams 1924812be97SDan WilliamsWhat: /sys/bus/cxl/devices/portX/uport 1934812be97SDan WilliamsDate: June, 2021 1944812be97SDan WilliamsKernelVersion: v5.14 1954812be97SDan WilliamsContact: linux-cxl@vger.kernel.org 1964812be97SDan WilliamsDescription: 19786677a4eSDan Williams (RO) CXL port objects are enumerated from either a platform 19886677a4eSDan Williams firmware device (ACPI0017 and ACPI0016) or PCIe switch upstream 19986677a4eSDan Williams port with CXL component registers. The 'uport' symlink connects 20086677a4eSDan Williams the CXL portX object to the device that published the CXL port 2014812be97SDan Williams capability. 2027d4b5ca2SDan Williams 2036b625b2bSDan Williams 204172738bbSDan WilliamsWhat: /sys/bus/cxl/devices/{port,endpoint}X/parent_dport 205172738bbSDan WilliamsDate: January, 2023 206172738bbSDan WilliamsKernelVersion: v6.3 207172738bbSDan WilliamsContact: linux-cxl@vger.kernel.org 208172738bbSDan WilliamsDescription: 209172738bbSDan Williams (RO) CXL port objects are instantiated for each upstream port in 210172738bbSDan Williams a CXL/PCIe switch, and for each endpoint to map the 211172738bbSDan Williams corresponding memory device into the CXL port hierarchy. When a 212172738bbSDan Williams descendant CXL port (switch or endpoint) is enumerated it is 213172738bbSDan Williams useful to know which 'dport' object in the parent CXL port 214172738bbSDan Williams routes to this descendant. The 'parent_dport' symlink points to 215172738bbSDan Williams the device representing the downstream port of a CXL switch that 216172738bbSDan Williams routes to {port,endpoint}X. 217172738bbSDan Williams 218172738bbSDan Williams 2197d4b5ca2SDan WilliamsWhat: /sys/bus/cxl/devices/portX/dportY 2207d4b5ca2SDan WilliamsDate: June, 2021 2217d4b5ca2SDan WilliamsKernelVersion: v5.14 2227d4b5ca2SDan WilliamsContact: linux-cxl@vger.kernel.org 2237d4b5ca2SDan WilliamsDescription: 22486677a4eSDan Williams (RO) CXL port objects are enumerated from either a platform 22586677a4eSDan Williams firmware device (ACPI0017 and ACPI0016) or PCIe switch upstream 22686677a4eSDan Williams port with CXL component registers. The 'dportY' symlink 22786677a4eSDan Williams identifies one or more downstream ports that the upstream port 22886677a4eSDan Williams may target in its decode of CXL memory resources. The 'Y' 22986677a4eSDan Williams integer reflects the hardware port unique-id used in the 23086677a4eSDan Williams hardware decoder target list. 23140ba17afSDan Williams 2326b625b2bSDan Williams 23305e37b21SDave JiangWhat: /sys/bus/cxl/devices/portX/decoders_committed 23405e37b21SDave JiangDate: October, 2023 23505e37b21SDave JiangKernelVersion: v6.7 23605e37b21SDave JiangContact: linux-cxl@vger.kernel.org 23705e37b21SDave JiangDescription: 23805e37b21SDave Jiang (RO) A memory device is considered active when any of its 23905e37b21SDave Jiang decoders are in the "committed" state (See CXL 3.0 8.2.4.19.7 24005e37b21SDave Jiang CXL HDM Decoder n Control Register). Hotplug and destructive 24105e37b21SDave Jiang operations like "sanitize" are blocked while device is actively 24205e37b21SDave Jiang decoding a Host Physical Address range. Note that this number 24305e37b21SDave Jiang may be elevated without any regionX objects active or even 24405e37b21SDave Jiang enumerated, as this may be due to decoders established by 245*2c597549SSumanth Gavini platform firmware or a previous kernel (kexec). 24605e37b21SDave Jiang 24705e37b21SDave Jiang 24840ba17afSDan WilliamsWhat: /sys/bus/cxl/devices/decoderX.Y 24940ba17afSDan WilliamsDate: June, 2021 25040ba17afSDan WilliamsKernelVersion: v5.14 25140ba17afSDan WilliamsContact: linux-cxl@vger.kernel.org 25240ba17afSDan WilliamsDescription: 25386677a4eSDan Williams (RO) CXL decoder objects are enumerated from either a platform 25440ba17afSDan Williams firmware description, or a CXL HDM decoder register set in a 25540ba17afSDan Williams PCIe device (see CXL 2.0 section 8.2.5.12 CXL HDM Decoder 25640ba17afSDan Williams Capability Structure). The 'X' in decoderX.Y represents the 25740ba17afSDan Williams cxl_port container of this decoder, and 'Y' represents the 25840ba17afSDan Williams instance id of a given decoder resource. 25940ba17afSDan Williams 2606b625b2bSDan Williams 26140ba17afSDan WilliamsWhat: /sys/bus/cxl/devices/decoderX.Y/{start,size} 26240ba17afSDan WilliamsDate: June, 2021 26340ba17afSDan WilliamsKernelVersion: v5.14 26440ba17afSDan WilliamsContact: linux-cxl@vger.kernel.org 26540ba17afSDan WilliamsDescription: 26686677a4eSDan Williams (RO) The 'start' and 'size' attributes together convey the 26786677a4eSDan Williams physical address base and number of bytes mapped in the 26886677a4eSDan Williams decoder's decode window. For decoders of devtype 26986677a4eSDan Williams "cxl_decoder_root" the address range is fixed. For decoders of 27086677a4eSDan Williams devtype "cxl_decoder_switch" the address is bounded by the 27186677a4eSDan Williams decode range of the cxl_port ancestor of the decoder's cxl_port, 27286677a4eSDan Williams and dynamically updates based on the active memory regions in 27386677a4eSDan Williams that address space. 27440ba17afSDan Williams 2756b625b2bSDan Williams 27640ba17afSDan WilliamsWhat: /sys/bus/cxl/devices/decoderX.Y/locked 27740ba17afSDan WilliamsDate: June, 2021 27840ba17afSDan WilliamsKernelVersion: v5.14 27940ba17afSDan WilliamsContact: linux-cxl@vger.kernel.org 28040ba17afSDan WilliamsDescription: 28186677a4eSDan Williams (RO) CXL HDM decoders have the capability to lock the 28286677a4eSDan Williams configuration until the next device reset. For decoders of 28386677a4eSDan Williams devtype "cxl_decoder_root" there is no standard facility to 28486677a4eSDan Williams unlock them. For decoders of devtype "cxl_decoder_switch" a 28586677a4eSDan Williams secondary bus reset, of the PCIe bridge that provides the bus 28686677a4eSDan Williams for this decoders uport, unlocks / resets the decoder. 28740ba17afSDan Williams 2886b625b2bSDan Williams 28940ba17afSDan WilliamsWhat: /sys/bus/cxl/devices/decoderX.Y/target_list 29040ba17afSDan WilliamsDate: June, 2021 29140ba17afSDan WilliamsKernelVersion: v5.14 29240ba17afSDan WilliamsContact: linux-cxl@vger.kernel.org 29340ba17afSDan WilliamsDescription: 29486677a4eSDan Williams (RO) Display a comma separated list of the current decoder 29586677a4eSDan Williams target configuration. The list is ordered by the current 29686677a4eSDan Williams configured interleave order of the decoder's dport instances. 29786677a4eSDan Williams Each entry in the list is a dport id. 29840ba17afSDan Williams 2996b625b2bSDan Williams 30040ba17afSDan WilliamsWhat: /sys/bus/cxl/devices/decoderX.Y/cap_{pmem,ram,type2,type3} 30140ba17afSDan WilliamsDate: June, 2021 30240ba17afSDan WilliamsKernelVersion: v5.14 30340ba17afSDan WilliamsContact: linux-cxl@vger.kernel.org 30440ba17afSDan WilliamsDescription: 30586677a4eSDan Williams (RO) When a CXL decoder is of devtype "cxl_decoder_root", it 30640ba17afSDan Williams represents a fixed memory window identified by platform 30740ba17afSDan Williams firmware. A fixed window may only support a subset of memory 30840ba17afSDan Williams types. The 'cap_*' attributes indicate whether persistent 30940ba17afSDan Williams memory, volatile memory, accelerator memory, and / or expander 31040ba17afSDan Williams memory may be mapped behind this decoder's memory window. 31140ba17afSDan Williams 3126b625b2bSDan Williams 31340ba17afSDan WilliamsWhat: /sys/bus/cxl/devices/decoderX.Y/target_type 31440ba17afSDan WilliamsDate: June, 2021 31540ba17afSDan WilliamsKernelVersion: v5.14 31640ba17afSDan WilliamsContact: linux-cxl@vger.kernel.org 31740ba17afSDan WilliamsDescription: 31886677a4eSDan Williams (RO) When a CXL decoder is of devtype "cxl_decoder_switch", it 31986677a4eSDan Williams can optionally decode either accelerator memory (type-2) or 32086677a4eSDan Williams expander memory (type-3). The 'target_type' attribute indicates 32186677a4eSDan Williams the current setting which may dynamically change based on what 32240ba17afSDan Williams memory regions are activated in this decode hierarchy. 323c9700604SIra Weiny 3246b625b2bSDan Williams 325c9700604SIra WeinyWhat: /sys/bus/cxl/devices/endpointX/CDAT 326c9700604SIra WeinyDate: July, 2022 3278752efd2SDan WilliamsKernelVersion: v6.0 328c9700604SIra WeinyContact: linux-cxl@vger.kernel.org 329c9700604SIra WeinyDescription: 330c9700604SIra Weiny (RO) If this sysfs entry is not present no DOE mailbox was 331c9700604SIra Weiny found to support CDAT data. If it is present and the length of 332c9700604SIra Weiny the data is 0 reading the CDAT data failed. Otherwise the CDAT 333c9700604SIra Weiny data is reported. 3342c866903SDan Williams 3352c866903SDan Williams 3362c866903SDan WilliamsWhat: /sys/bus/cxl/devices/decoderX.Y/mode 3372c866903SDan WilliamsDate: May, 2022 3388752efd2SDan WilliamsKernelVersion: v6.0 3392c866903SDan WilliamsContact: linux-cxl@vger.kernel.org 3402c866903SDan WilliamsDescription: 341cf880423SDan Williams (RW) When a CXL decoder is of devtype "cxl_decoder_endpoint" it 342962ac4c8SIra Weiny translates from a host physical address range, to a device 343962ac4c8SIra Weiny local address range. Device-local address ranges are further 344962ac4c8SIra Weiny split into a 'ram' (volatile memory) range and 'pmem' 345962ac4c8SIra Weiny (persistent memory) range. The 'mode' attribute emits one of 346962ac4c8SIra Weiny 'ram', 'pmem', or 'none'. The 'none' indicates the decoder is 347962ac4c8SIra Weiny not actively decoding, or no DPA allocation policy has been 348962ac4c8SIra Weiny set. 349cf880423SDan Williams 350cf880423SDan Williams 'mode' can be written, when the decoder is in the 'disabled' 351cf880423SDan Williams state, with either 'ram' or 'pmem' to set the boundaries for the 352cf880423SDan Williams next allocation. 353cf880423SDan Williams 354cf880423SDan Williams 355cf880423SDan WilliamsWhat: /sys/bus/cxl/devices/decoderX.Y/dpa_resource 356cf880423SDan WilliamsDate: May, 2022 3578752efd2SDan WilliamsKernelVersion: v6.0 358cf880423SDan WilliamsContact: linux-cxl@vger.kernel.org 359cf880423SDan WilliamsDescription: 360cf880423SDan Williams (RO) When a CXL decoder is of devtype "cxl_decoder_endpoint", 361cf880423SDan Williams and its 'dpa_size' attribute is non-zero, this attribute 362cf880423SDan Williams indicates the device physical address (DPA) base address of the 363cf880423SDan Williams allocation. 364cf880423SDan Williams 365cf880423SDan Williams 366cf880423SDan WilliamsWhat: /sys/bus/cxl/devices/decoderX.Y/dpa_size 367cf880423SDan WilliamsDate: May, 2022 3688752efd2SDan WilliamsKernelVersion: v6.0 369cf880423SDan WilliamsContact: linux-cxl@vger.kernel.org 370cf880423SDan WilliamsDescription: 371cf880423SDan Williams (RW) When a CXL decoder is of devtype "cxl_decoder_endpoint" it 372cf880423SDan Williams translates from a host physical address range, to a device local 373cf880423SDan Williams address range. The range, base address plus length in bytes, of 374cf880423SDan Williams DPA allocated to this decoder is conveyed in these 2 attributes. 375cf880423SDan Williams Allocations can be mutated as long as the decoder is in the 376cf880423SDan Williams disabled state. A write to 'dpa_size' releases the previous DPA 377cf880423SDan Williams allocation and then attempts to allocate from the free capacity 378cf880423SDan Williams in the device partition referred to by 'decoderX.Y/mode'. 379cf880423SDan Williams Allocate and free requests can only be performed on the highest 380cf880423SDan Williams instance number disabled decoder with non-zero size. I.e. 381cf880423SDan Williams allocations are enforced to occur in increasing 'decoderX.Y/id' 382cf880423SDan Williams order and frees are enforced to occur in decreasing 383cf880423SDan Williams 'decoderX.Y/id' order. 384538831f1SBen Widawsky 385538831f1SBen Widawsky 386538831f1SBen WidawskyWhat: /sys/bus/cxl/devices/decoderX.Y/interleave_ways 387538831f1SBen WidawskyDate: May, 2022 3888752efd2SDan WilliamsKernelVersion: v6.0 389538831f1SBen WidawskyContact: linux-cxl@vger.kernel.org 390538831f1SBen WidawskyDescription: 391538831f1SBen Widawsky (RO) The number of targets across which this decoder's host 392538831f1SBen Widawsky physical address (HPA) memory range is interleaved. The device 393538831f1SBen Widawsky maps every Nth block of HPA (of size == 394538831f1SBen Widawsky 'interleave_granularity') to consecutive DPA addresses. The 395538831f1SBen Widawsky decoder's position in the interleave is determined by the 396538831f1SBen Widawsky device's (endpoint or switch) switch ancestry. For root 397538831f1SBen Widawsky decoders their interleave is specified by platform firmware and 398538831f1SBen Widawsky they only specify a downstream target order for host bridges. 399538831f1SBen Widawsky 400538831f1SBen Widawsky 401538831f1SBen WidawskyWhat: /sys/bus/cxl/devices/decoderX.Y/interleave_granularity 402538831f1SBen WidawskyDate: May, 2022 4038752efd2SDan WilliamsKernelVersion: v6.0 404538831f1SBen WidawskyContact: linux-cxl@vger.kernel.org 405538831f1SBen WidawskyDescription: 406538831f1SBen Widawsky (RO) The number of consecutive bytes of host physical address 407538831f1SBen Widawsky space this decoder claims at address N before the decode rotates 408538831f1SBen Widawsky to the next target in the interleave at address N + 409538831f1SBen Widawsky interleave_granularity (assuming N is aligned to 410538831f1SBen Widawsky interleave_granularity). 411779dd20cSBen Widawsky 412779dd20cSBen Widawsky 4136e099264SDan WilliamsWhat: /sys/bus/cxl/devices/decoderX.Y/create_{pmem,ram}_region 4146e099264SDan WilliamsDate: May, 2022, January, 2023 4156e099264SDan WilliamsKernelVersion: v6.0 (pmem), v6.3 (ram) 416779dd20cSBen WidawskyContact: linux-cxl@vger.kernel.org 417779dd20cSBen WidawskyDescription: 418779dd20cSBen Widawsky (RW) Write a string in the form 'regionZ' to start the process 4196e099264SDan Williams of defining a new persistent, or volatile memory region 4206e099264SDan Williams (interleave-set) within the decode range bounded by root decoder 4216e099264SDan Williams 'decoderX.Y'. The value written must match the current value 4226e099264SDan Williams returned from reading this attribute. An atomic compare exchange 4236e099264SDan Williams operation is done on write to assign the requested id to a 4246e099264SDan Williams region and allocate the region-id for the next creation attempt. 4256e099264SDan Williams EBUSY is returned if the region name written does not match the 4266e099264SDan Williams current cached value. 427779dd20cSBen Widawsky 428779dd20cSBen Widawsky 429779dd20cSBen WidawskyWhat: /sys/bus/cxl/devices/decoderX.Y/delete_region 430779dd20cSBen WidawskyDate: May, 2022 4318752efd2SDan WilliamsKernelVersion: v6.0 432779dd20cSBen WidawskyContact: linux-cxl@vger.kernel.org 433779dd20cSBen WidawskyDescription: 434779dd20cSBen Widawsky (WO) Write a string in the form 'regionZ' to delete that region, 435779dd20cSBen Widawsky provided it is currently idle / not bound to a driver. 436dd5ba0ebSBen Widawsky 437dd5ba0ebSBen Widawsky 438529c0a44SDave JiangWhat: /sys/bus/cxl/devices/decoderX.Y/qos_class 439529c0a44SDave JiangDate: May, 2023 440529c0a44SDave JiangKernelVersion: v6.5 441529c0a44SDave JiangContact: linux-cxl@vger.kernel.org 442529c0a44SDave JiangDescription: 443eb8081bcSDavidlohr Bueso (RO) For CXL host platforms that support "QoS Telemetry" this 444529c0a44SDave Jiang root-decoder-only attribute conveys a platform specific cookie 445529c0a44SDave Jiang that identifies a QoS performance class for the CXL Window. 446529c0a44SDave Jiang This class-id can be compared against a similar "qos_class" 447529c0a44SDave Jiang published for each memory-type that an endpoint supports. While 448529c0a44SDave Jiang it is not required that endpoints map their local memory-class 449529c0a44SDave Jiang to a matching platform class, mismatches are not recommended and 450529c0a44SDave Jiang there are platform specific side-effects that may result. 451529c0a44SDave Jiang 452529c0a44SDave Jiang 453dd5ba0ebSBen WidawskyWhat: /sys/bus/cxl/devices/regionZ/uuid 454dd5ba0ebSBen WidawskyDate: May, 2022 4558752efd2SDan WilliamsKernelVersion: v6.0 456dd5ba0ebSBen WidawskyContact: linux-cxl@vger.kernel.org 457dd5ba0ebSBen WidawskyDescription: 458dd5ba0ebSBen Widawsky (RW) Write a unique identifier for the region. This field must 459dd5ba0ebSBen Widawsky be set for persistent regions and it must not conflict with the 460a8e7d558SDan Williams UUID of another region. For volatile ram regions this 461a8e7d558SDan Williams attribute is a read-only empty string. 46280d10a6cSBen Widawsky 46380d10a6cSBen Widawsky 46480d10a6cSBen WidawskyWhat: /sys/bus/cxl/devices/regionZ/interleave_granularity 46580d10a6cSBen WidawskyDate: May, 2022 4668752efd2SDan WilliamsKernelVersion: v6.0 46780d10a6cSBen WidawskyContact: linux-cxl@vger.kernel.org 46880d10a6cSBen WidawskyDescription: 46980d10a6cSBen Widawsky (RW) Set the number of consecutive bytes each device in the 47080d10a6cSBen Widawsky interleave set will claim. The possible interleave granularity 47180d10a6cSBen Widawsky values are determined by the CXL spec and the participating 47280d10a6cSBen Widawsky devices. 47380d10a6cSBen Widawsky 47480d10a6cSBen Widawsky 47580d10a6cSBen WidawskyWhat: /sys/bus/cxl/devices/regionZ/interleave_ways 47680d10a6cSBen WidawskyDate: May, 2022 4778752efd2SDan WilliamsKernelVersion: v6.0 47880d10a6cSBen WidawskyContact: linux-cxl@vger.kernel.org 47980d10a6cSBen WidawskyDescription: 48080d10a6cSBen Widawsky (RW) Configures the number of devices participating in the 48180d10a6cSBen Widawsky region is set by writing this value. Each device will provide 48280d10a6cSBen Widawsky 1/interleave_ways of storage for the region. 48323a22cd1SDan Williams 48423a22cd1SDan Williams 48523a22cd1SDan WilliamsWhat: /sys/bus/cxl/devices/regionZ/size 48623a22cd1SDan WilliamsDate: May, 2022 4878752efd2SDan WilliamsKernelVersion: v6.0 48823a22cd1SDan WilliamsContact: linux-cxl@vger.kernel.org 48923a22cd1SDan WilliamsDescription: 49023a22cd1SDan Williams (RW) System physical address space to be consumed by the region. 49123a22cd1SDan Williams When written trigger the driver to allocate space out of the 49223a22cd1SDan Williams parent root decoder's address space. When read the size of the 49323a22cd1SDan Williams address space is reported and should match the span of the 49423a22cd1SDan Williams region's resource attribute. Size shall be set after the 49523a22cd1SDan Williams interleave configuration parameters. Once set it cannot be 49623a22cd1SDan Williams changed, only freed by writing 0. The kernel makes no guarantees 49723a22cd1SDan Williams that data is maintained over an address space freeing event, and 49823a22cd1SDan Williams there is no guarantee that a free followed by an allocate 49923a22cd1SDan Williams results in the same address being allocated. 50023a22cd1SDan Williams 50123a22cd1SDan Williams 5027d505f98SDan WilliamsWhat: /sys/bus/cxl/devices/regionZ/mode 5037d505f98SDan WilliamsDate: January, 2023 5047d505f98SDan WilliamsKernelVersion: v6.3 5057d505f98SDan WilliamsContact: linux-cxl@vger.kernel.org 5067d505f98SDan WilliamsDescription: 5077d505f98SDan Williams (RO) The mode of a region is established at region creation time 5087d505f98SDan Williams and dictates the mode of the endpoint decoder that comprise the 5097d505f98SDan Williams region. For more details on the possible modes see 5107d505f98SDan Williams /sys/bus/cxl/devices/decoderX.Y/mode 5117d505f98SDan Williams 5127d505f98SDan Williams 51323a22cd1SDan WilliamsWhat: /sys/bus/cxl/devices/regionZ/resource 51423a22cd1SDan WilliamsDate: May, 2022 5158752efd2SDan WilliamsKernelVersion: v6.0 51623a22cd1SDan WilliamsContact: linux-cxl@vger.kernel.org 51723a22cd1SDan WilliamsDescription: 51823a22cd1SDan Williams (RO) A region is a contiguous partition of a CXL root decoder 51923a22cd1SDan Williams address space. Region capacity is allocated by writing to the 52023a22cd1SDan Williams size attribute, the resulting physical address space determined 52123a22cd1SDan Williams by the driver is reflected here. It is therefore not useful to 52223a22cd1SDan Williams read this before writing a value to the size attribute. 523b9686e8cSDan Williams 524b9686e8cSDan Williams 525b9686e8cSDan WilliamsWhat: /sys/bus/cxl/devices/regionZ/target[0..N] 526b9686e8cSDan WilliamsDate: May, 2022 5278752efd2SDan WilliamsKernelVersion: v6.0 528b9686e8cSDan WilliamsContact: linux-cxl@vger.kernel.org 529b9686e8cSDan WilliamsDescription: 530b9686e8cSDan Williams (RW) Write an endpoint decoder object name to 'targetX' where X 531b9686e8cSDan Williams is the intended position of the endpoint device in the region 532b9686e8cSDan Williams interleave and N is the 'interleave_ways' setting for the 533b9686e8cSDan Williams region. ENXIO is returned if the write results in an impossible 534b9686e8cSDan Williams to map decode scenario, like the endpoint is unreachable at that 535b9686e8cSDan Williams position relative to the root decoder interleave. EBUSY is 536b9686e8cSDan Williams returned if the position in the region is already occupied, or 537b9686e8cSDan Williams if the region is not in a state to accept interleave 538b9686e8cSDan Williams configuration changes. EINVAL is returned if the object name is 539b9686e8cSDan Williams not an endpoint decoder. Once all positions have been 540b9686e8cSDan Williams successfully written a final validation for decode conflicts is 541b9686e8cSDan Williams performed before activating the region. 542176baefbSDan Williams 543176baefbSDan Williams 544176baefbSDan WilliamsWhat: /sys/bus/cxl/devices/regionZ/commit 545176baefbSDan WilliamsDate: May, 2022 5468752efd2SDan WilliamsKernelVersion: v6.0 547176baefbSDan WilliamsContact: linux-cxl@vger.kernel.org 548176baefbSDan WilliamsDescription: 549176baefbSDan Williams (RW) Write a boolean 'true' string value to this attribute to 550176baefbSDan Williams trigger the region to transition from the software programmed 551176baefbSDan Williams state to the actively decoding in hardware state. The commit 552176baefbSDan Williams operation in addition to validating that the region is in proper 553176baefbSDan Williams configured state, validates that the decoders are being 554176baefbSDan Williams committed in spec mandated order (last committed decoder id + 555176baefbSDan Williams 1), and checks that the hardware accepts the commit request. 556176baefbSDan Williams Reading this value indicates whether the region is committed or 557176baefbSDan Williams not. 5587ff6ad10SAlison Schofield 5597ff6ad10SAlison Schofield 5607ff6ad10SAlison SchofieldWhat: /sys/bus/cxl/devices/memX/trigger_poison_list 5617ff6ad10SAlison SchofieldDate: April, 2023 5627ff6ad10SAlison SchofieldKernelVersion: v6.4 5637ff6ad10SAlison SchofieldContact: linux-cxl@vger.kernel.org 5647ff6ad10SAlison SchofieldDescription: 5657ff6ad10SAlison Schofield (WO) When a boolean 'true' is written to this attribute the 5667ff6ad10SAlison Schofield memdev driver retrieves the poison list from the device. The 5677ff6ad10SAlison Schofield list consists of addresses that are poisoned, or would result 5687ff6ad10SAlison Schofield in poison if accessed, and the source of the poison. This 5697ff6ad10SAlison Schofield attribute is only visible for devices supporting the 5707ff6ad10SAlison Schofield capability. The retrieved errors are logged as kernel 5717ff6ad10SAlison Schofield events when cxl_poison event tracing is enabled. 572c20eaf44SDave Jiang 573c20eaf44SDave Jiang 574c20eaf44SDave JiangWhat: /sys/bus/cxl/devices/regionZ/accessY/read_bandwidth 575191679ecSAlok Tiwari /sys/bus/cxl/devices/regionZ/accessY/write_bandwidth 576c20eaf44SDave JiangDate: Jan, 2024 577c20eaf44SDave JiangKernelVersion: v6.9 578c20eaf44SDave JiangContact: linux-cxl@vger.kernel.org 579c20eaf44SDave JiangDescription: 580c20eaf44SDave Jiang (RO) The aggregated read or write bandwidth of the region. The 581c20eaf44SDave Jiang number is the accumulated read or write bandwidth of all CXL memory 582c20eaf44SDave Jiang devices that contributes to the region in MB/s. It is 583c20eaf44SDave Jiang identical data that should appear in 584c20eaf44SDave Jiang /sys/devices/system/node/nodeX/accessY/initiators/read_bandwidth or 585c20eaf44SDave Jiang /sys/devices/system/node/nodeX/accessY/initiators/write_bandwidth. 586c20eaf44SDave Jiang See Documentation/ABI/stable/sysfs-devices-node. access0 provides 587c20eaf44SDave Jiang the number to the closest initiator and access1 provides the 588c20eaf44SDave Jiang number to the closest CPU. 589c20eaf44SDave Jiang 590c20eaf44SDave Jiang 591c20eaf44SDave JiangWhat: /sys/bus/cxl/devices/regionZ/accessY/read_latency 592c20eaf44SDave Jiang /sys/bus/cxl/devices/regionZ/accessY/write_latency 593c20eaf44SDave JiangDate: Jan, 2024 594c20eaf44SDave JiangKernelVersion: v6.9 595c20eaf44SDave JiangContact: linux-cxl@vger.kernel.org 596c20eaf44SDave JiangDescription: 597c20eaf44SDave Jiang (RO) The read or write latency of the region. The number is 598c20eaf44SDave Jiang the worst read or write latency of all CXL memory devices that 599c20eaf44SDave Jiang contributes to the region in nanoseconds. It is identical data 600c20eaf44SDave Jiang that should appear in 601c20eaf44SDave Jiang /sys/devices/system/node/nodeX/accessY/initiators/read_latency or 602c20eaf44SDave Jiang /sys/devices/system/node/nodeX/accessY/initiators/write_latency. 603c20eaf44SDave Jiang See Documentation/ABI/stable/sysfs-devices-node. access0 provides 604c20eaf44SDave Jiang the number to the closest initiator and access1 provides the 605c20eaf44SDave Jiang number to the closest CPU. 6067d0ecc0bSDavidlohr Bueso 6077d0ecc0bSDavidlohr Bueso 6087d0ecc0bSDavidlohr BuesoWhat: /sys/bus/cxl/devices/nvdimm-bridge0/ndbusX/nmemY/cxl/dirty_shutdown 6097d0ecc0bSDavidlohr BuesoDate: Feb, 2025 6107d0ecc0bSDavidlohr BuesoKernelVersion: v6.15 6117d0ecc0bSDavidlohr BuesoContact: linux-cxl@vger.kernel.org 6127d0ecc0bSDavidlohr BuesoDescription: 6137d0ecc0bSDavidlohr Bueso (RO) The device dirty shutdown count value, which is the number 6147d0ecc0bSDavidlohr Bueso of times the device could have incurred in potential data loss. 6157d0ecc0bSDavidlohr Bueso The count is persistent across power loss and wraps back to 0 6167d0ecc0bSDavidlohr Bueso upon overflow. If this file is not present, the device does not 6177d0ecc0bSDavidlohr Bueso have the necessary support for dirty tracking. 618