14cdadfd5SDan Williams# SPDX-License-Identifier: GPL-2.0-only 24cdadfd5SDan Williamsmenuconfig CXL_BUS 34cdadfd5SDan Williams tristate "CXL (Compute Express Link) Devices Support" 44cdadfd5SDan Williams depends on PCI 59171dfcdSArnd Bergmann select FW_LOADER 69171dfcdSArnd Bergmann select FW_UPLOAD 73eddcc93SIra Weiny select PCI_DOE 8ad6f04c0SDave Jiang select FIRMWARE_TABLE 91b5695b0SMike Rapoport (Microsoft) select NUMA_KEEP_MEMINFO if NUMA_MEMBLKS 10858ce2f5SDave Jiang select FWCTL if CXL_FEATURES 114cdadfd5SDan Williams help 124cdadfd5SDan Williams CXL is a bus that is electrically compatible with PCI Express, but 134cdadfd5SDan Williams layers three protocols on that signalling (CXL.io, CXL.cache, and 144cdadfd5SDan Williams CXL.mem). The CXL.cache protocol allows devices to hold cachelines 154cdadfd5SDan Williams locally, the CXL.mem protocol allows devices to be fully coherent 164cdadfd5SDan Williams memory targets, the CXL.io protocol is equivalent to PCI Express. 174cdadfd5SDan Williams Say 'y' to enable support for the configuration and management of 184cdadfd5SDan Williams devices supporting these protocols. 194cdadfd5SDan Williams 204cdadfd5SDan Williamsif CXL_BUS 214cdadfd5SDan Williams 2268cdd3d2SBen Widawskyconfig CXL_PCI 2368cdd3d2SBen Widawsky tristate "PCI manageability" 243feaa2d3SDan Williams default CXL_BUS 251f1cb7f0SDan Williams select CXL_MEM 264cdadfd5SDan Williams help 2768cdd3d2SBen Widawsky The CXL specification defines a "CXL memory device" sub-class in the 2868cdd3d2SBen Widawsky PCI "memory controller" base class of devices. Device's identified by 2968cdd3d2SBen Widawsky this class code provide support for volatile and / or persistent 3068cdd3d2SBen Widawsky memory to be mapped into the system address map (Host-managed Device 3168cdd3d2SBen Widawsky Memory (HDM)). 324cdadfd5SDan Williams 3368cdd3d2SBen Widawsky Say 'y/m' to enable a driver that will attach to CXL memory expander 3468cdd3d2SBen Widawsky devices enumerated by the memory device class code for configuration 3568cdd3d2SBen Widawsky and management primarily via the mailbox interface. See Chapter 2.3 3668cdd3d2SBen Widawsky Type 3 CXL Device in the CXL 2.0 specification for more details. 374cdadfd5SDan Williams 384cdadfd5SDan Williams If unsure say 'm'. 3913237183SBen Widawsky 4013237183SBen Widawskyconfig CXL_MEM_RAW_COMMANDS 4113237183SBen Widawsky bool "RAW Command Interface for Memory Devices" 4268cdd3d2SBen Widawsky depends on CXL_PCI 4313237183SBen Widawsky help 4413237183SBen Widawsky Enable CXL RAW command interface. 4513237183SBen Widawsky 4613237183SBen Widawsky The CXL driver ioctl interface may assign a kernel ioctl command 4713237183SBen Widawsky number for each specification defined opcode. At any given point in 4813237183SBen Widawsky time the number of opcodes that the specification defines and a device 4913237183SBen Widawsky may implement may exceed the kernel's set of associated ioctl function 5013237183SBen Widawsky numbers. The mismatch is either by omission, specification is too new, 5113237183SBen Widawsky or by design. When prototyping new hardware, or developing / debugging 5213237183SBen Widawsky the driver it is useful to be able to submit any possible command to 5313237183SBen Widawsky the hardware, even commands that may crash the kernel due to their 5413237183SBen Widawsky potential impact to memory currently in use by the kernel. 5513237183SBen Widawsky 5613237183SBen Widawsky If developing CXL hardware or the driver say Y, otherwise say N. 574812be97SDan Williams 584812be97SDan Williamsconfig CXL_ACPI 594812be97SDan Williams tristate "CXL ACPI: Platform Support" 604812be97SDan Williams depends on ACPI 61ad6f04c0SDave Jiang depends on ACPI_NUMA 62*93d0fcddSKeith Busch depends on CXL_PMEM || !CXL_PMEM 633feaa2d3SDan Williams default CXL_BUS 64f4ce1f76SDan Williams select ACPI_TABLE_LIB 65ad6f04c0SDave Jiang select ACPI_HMAT 666575b268SDan Williams select CXL_PORT 674812be97SDan Williams help 684812be97SDan Williams Enable support for host managed device memory (HDM) resources 694812be97SDan Williams published by a platform's ACPI CXL memory layout description. See 704812be97SDan Williams Chapter 9.14.1 CXL Early Discovery Table (CEDT) in the CXL 2.0 714812be97SDan Williams specification, and CXL Fixed Memory Window Structures (CEDT.CFMWS) 724812be97SDan Williams (https://www.computeexpresslink.org/spec-landing). The CXL core 734812be97SDan Williams consumes these resource to publish the root of a cxl_port decode 744812be97SDan Williams hierarchy to map regions that represent System RAM, or Persistent 754812be97SDan Williams Memory regions to be managed by LIBNVDIMM. 764812be97SDan Williams 774812be97SDan Williams If unsure say 'm'. 788fdcb170SDan Williams 798fdcb170SDan Williamsconfig CXL_PMEM 808fdcb170SDan Williams tristate "CXL PMEM: Persistent Memory Support" 818fdcb170SDan Williams depends on LIBNVDIMM 828fdcb170SDan Williams default CXL_BUS 838fdcb170SDan Williams help 848fdcb170SDan Williams In addition to typical memory resources a platform may also advertise 858fdcb170SDan Williams support for persistent memory attached via CXL. This support is 868fdcb170SDan Williams managed via a bridge driver from CXL to the LIBNVDIMM system 878fdcb170SDan Williams subsystem. Say 'y/m' to enable support for enumerating and 888fdcb170SDan Williams provisioning the persistent memory capacity of CXL memory expanders. 898fdcb170SDan Williams 908fdcb170SDan Williams If unsure say 'm'. 9154cdbf84SBen Widawsky 928dd2bc0fSBen Widawskyconfig CXL_MEM 938dd2bc0fSBen Widawsky tristate "CXL: Memory Expansion" 948dd2bc0fSBen Widawsky default CXL_BUS 958dd2bc0fSBen Widawsky help 968dd2bc0fSBen Widawsky The CXL.mem protocol allows a device to act as a provider of "System 978dd2bc0fSBen Widawsky RAM" and/or "Persistent Memory" that is fully coherent as if the 988dd2bc0fSBen Widawsky memory were attached to the typical CPU memory controller. This is 998dd2bc0fSBen Widawsky known as HDM "Host-managed Device Memory". 1008dd2bc0fSBen Widawsky 1018dd2bc0fSBen Widawsky Say 'y/m' to enable a driver that will attach to CXL.mem devices for 1028dd2bc0fSBen Widawsky memory expansion and control of HDM. See Chapter 9.13 in the CXL 2.0 1038dd2bc0fSBen Widawsky specification for a detailed description of HDM. 1048dd2bc0fSBen Widawsky 1058dd2bc0fSBen Widawsky If unsure say 'm'. 1068dd2bc0fSBen Widawsky 107f0e6a232SDave Jiangconfig CXL_FEATURES 108f0e6a232SDave Jiang bool "CXL: Features" 109f0e6a232SDave Jiang depends on CXL_PCI 110f0e6a232SDave Jiang help 111f0e6a232SDave Jiang Enable support for CXL Features. A CXL device that includes a mailbox 112f0e6a232SDave Jiang supports commands that allows listing, getting, and setting of 113f0e6a232SDave Jiang optionally defined features such as memory sparing or post package 114f0e6a232SDave Jiang sparing. Vendors may define custom features for the device. 115f0e6a232SDave Jiang 116f0e6a232SDave Jiang If unsure say 'n' 117f0e6a232SDave Jiang 1180c6e6f13SShiju Joseconfig CXL_EDAC_MEM_FEATURES 1190c6e6f13SShiju Jose bool "CXL: EDAC Memory Features" 1200c6e6f13SShiju Jose depends on EXPERT 1210c6e6f13SShiju Jose depends on CXL_MEM 1220c6e6f13SShiju Jose depends on CXL_FEATURES 1230c6e6f13SShiju Jose depends on EDAC >= CXL_BUS 1240c6e6f13SShiju Jose help 1250c6e6f13SShiju Jose The CXL EDAC memory feature is optional and allows host to 1260c6e6f13SShiju Jose control the EDAC memory features configurations of CXL memory 1270c6e6f13SShiju Jose expander devices. 1280c6e6f13SShiju Jose 1290c6e6f13SShiju Jose Say 'y' if you have an expert need to change default settings 1300c6e6f13SShiju Jose of a memory RAS feature established by the platform/device. 1310c6e6f13SShiju Jose Otherwise say 'n'. 1320c6e6f13SShiju Jose 1330c6e6f13SShiju Joseconfig CXL_EDAC_SCRUB 1340c6e6f13SShiju Jose bool "Enable CXL Patrol Scrub Control (Patrol Read)" 1350c6e6f13SShiju Jose depends on CXL_EDAC_MEM_FEATURES 1360c6e6f13SShiju Jose depends on EDAC_SCRUB 1370c6e6f13SShiju Jose help 1380c6e6f13SShiju Jose The CXL EDAC scrub control is optional and allows host to 1390c6e6f13SShiju Jose control the scrub feature configurations of CXL memory expander 1400c6e6f13SShiju Jose devices. 1410c6e6f13SShiju Jose 1420c6e6f13SShiju Jose When enabled 'cxl_mem' and 'cxl_region' EDAC devices are 1430c6e6f13SShiju Jose published with memory scrub control attributes as described by 1440c6e6f13SShiju Jose Documentation/ABI/testing/sysfs-edac-scrub. 1450c6e6f13SShiju Jose 1460c6e6f13SShiju Jose Say 'y' if you have an expert need to change default settings 1470c6e6f13SShiju Jose of a memory scrub feature established by the platform/device 1480c6e6f13SShiju Jose (e.g. scrub rates for the patrol scrub feature). 1490c6e6f13SShiju Jose Otherwise say 'n'. 1500c6e6f13SShiju Jose 15185fb6a16SShiju Joseconfig CXL_EDAC_ECS 15285fb6a16SShiju Jose bool "Enable CXL Error Check Scrub (Repair)" 15385fb6a16SShiju Jose depends on CXL_EDAC_MEM_FEATURES 15485fb6a16SShiju Jose depends on EDAC_ECS 15585fb6a16SShiju Jose help 15685fb6a16SShiju Jose The CXL EDAC ECS control is optional and allows host to 15785fb6a16SShiju Jose control the ECS feature configurations of CXL memory expander 15885fb6a16SShiju Jose devices. 15985fb6a16SShiju Jose 16085fb6a16SShiju Jose When enabled 'cxl_mem' EDAC devices are published with memory 16185fb6a16SShiju Jose ECS control attributes as described by 16285fb6a16SShiju Jose Documentation/ABI/testing/sysfs-edac-ecs. 16385fb6a16SShiju Jose 16485fb6a16SShiju Jose Say 'y' if you have an expert need to change default settings 16585fb6a16SShiju Jose of a memory ECS feature established by the platform/device. 16685fb6a16SShiju Jose Otherwise say 'n'. 16785fb6a16SShiju Jose 1680b5ccb0dSShiju Joseconfig CXL_EDAC_MEM_REPAIR 1690b5ccb0dSShiju Jose bool "Enable CXL Memory Repair" 1700b5ccb0dSShiju Jose depends on CXL_EDAC_MEM_FEATURES 1710b5ccb0dSShiju Jose depends on EDAC_MEM_REPAIR 1720b5ccb0dSShiju Jose help 1730b5ccb0dSShiju Jose The CXL EDAC memory repair control is optional and allows host 1740b5ccb0dSShiju Jose to control the memory repair features (e.g. sparing, PPR) 1750b5ccb0dSShiju Jose configurations of CXL memory expander devices. 1760b5ccb0dSShiju Jose 1770b5ccb0dSShiju Jose When enabled, the memory repair feature requires an additional 1780b5ccb0dSShiju Jose memory of approximately 43KB to store CXL DRAM and CXL general 1790b5ccb0dSShiju Jose media event records. 1800b5ccb0dSShiju Jose 1810b5ccb0dSShiju Jose When enabled 'cxl_mem' EDAC devices are published with memory 1820b5ccb0dSShiju Jose repair control attributes as described by 1830b5ccb0dSShiju Jose Documentation/ABI/testing/sysfs-edac-memory-repair. 1840b5ccb0dSShiju Jose 1850b5ccb0dSShiju Jose Say 'y' if you have an expert need to change default settings 1860b5ccb0dSShiju Jose of a memory repair feature established by the platform/device. 1870b5ccb0dSShiju Jose Otherwise say 'n'. 1880b5ccb0dSShiju Jose 18954cdbf84SBen Widawskyconfig CXL_PORT 19054cdbf84SBen Widawsky default CXL_BUS 19154cdbf84SBen Widawsky tristate 19254cdbf84SBen Widawsky 1939ea4dcf4SDan Williamsconfig CXL_SUSPEND 1949ea4dcf4SDan Williams def_bool y 1959ea4dcf4SDan Williams depends on SUSPEND && CXL_MEM 1969ea4dcf4SDan Williams 197779dd20cSBen Widawskyconfig CXL_REGION 19845d235c5SDan Williams bool "CXL: Region Support" 199779dd20cSBen Widawsky default CXL_BUS 20023a22cd1SDan Williams # For MAX_PHYSMEM_BITS 20123a22cd1SDan Williams depends on SPARSEMEM 202779dd20cSBen Widawsky select MEMREGION 20323a22cd1SDan Williams select GET_FREE_REGION 20445d235c5SDan Williams help 20545d235c5SDan Williams Enable the CXL core to enumerate and provision CXL regions. A CXL 20645d235c5SDan Williams region is defined by one or more CXL expanders that decode a given 20745d235c5SDan Williams system-physical address range. For CXL regions established by 20845d235c5SDan Williams platform-firmware this option enables memory error handling to 20945d235c5SDan Williams identify the devices participating in a given interleaved memory 21045d235c5SDan Williams range. Otherwise, platform-firmware managed CXL is enabled by being 21145d235c5SDan Williams placed in the system address map and does not need a driver. 21245d235c5SDan Williams 21345d235c5SDan Williams If unsure say 'y' 214779dd20cSBen Widawsky 215d18bc74aSDan Williamsconfig CXL_REGION_INVALIDATION_TEST 216d18bc74aSDan Williams bool "CXL: Region Cache Management Bypass (TEST)" 217d18bc74aSDan Williams depends on CXL_REGION 218d18bc74aSDan Williams help 219d18bc74aSDan Williams CXL Region management and security operations potentially invalidate 220cbbd05d0SRandy Dunlap the content of CPU caches without notifying those caches to 221d18bc74aSDan Williams invalidate the affected cachelines. The CXL Region driver attempts 222d18bc74aSDan Williams to invalidate caches when those events occur. If that invalidation 223d18bc74aSDan Williams fails the region will fail to enable. Reasons for cache 224d18bc74aSDan Williams invalidation failure are due to the CPU not providing a cache 225d18bc74aSDan Williams invalidation mechanism. For example usage of wbinvd is restricted to 226d18bc74aSDan Williams bare metal x86. However, for testing purposes toggling this option 227d18bc74aSDan Williams can disable that data integrity safety and proceed with enabling 228d18bc74aSDan Williams regions when there might be conflicting contents in the CPU cache. 229d18bc74aSDan Williams 230d18bc74aSDan Williams If unsure, or if this kernel is meant for production environments, 231d18bc74aSDan Williams say N. 232d18bc74aSDan Williams 233516e5bd0SDave Jiangconfig CXL_MCE 234516e5bd0SDave Jiang def_bool y 235516e5bd0SDave Jiang depends on X86_MCE && MEMORY_FAILURE 236516e5bd0SDave Jiang 2377ff8b1d6SDave Jiangconfig CXL_RAS 2387ff8b1d6SDave Jiang def_bool y 239d18f1b7bSDan Williams depends on ACPI_APEI_GHES && PCIEAER && CXL_BUS 2407ff8b1d6SDave Jiang 241af74daf9SRobert Richterconfig CXL_ATL 242af74daf9SRobert Richter def_bool y 243af74daf9SRobert Richter depends on CXL_REGION 244af74daf9SRobert Richter depends on ACPI_PRMT && AMD_NB 245af74daf9SRobert Richter 2464cdadfd5SDan Williamsendif 247