xref: /linux/Documentation/ABI/testing/debugfs-cxl (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
150d527f5SAlison SchofieldWhat:		/sys/kernel/debug/cxl/memX/inject_poison
250d527f5SAlison SchofieldDate:		April, 2023
350d527f5SAlison SchofieldKernelVersion:	v6.4
450d527f5SAlison SchofieldContact:	linux-cxl@vger.kernel.org
550d527f5SAlison SchofieldDescription:
650d527f5SAlison Schofield		(WO) When a Device Physical Address (DPA) is written to this
750d527f5SAlison Schofield		attribute, the memdev driver sends an inject poison command to
850d527f5SAlison Schofield		the device for the specified address. The DPA must be 64-byte
950d527f5SAlison Schofield		aligned and the length of the injected poison is 64-bytes. If
1050d527f5SAlison Schofield		successful, the device returns poison when the address is
1150d527f5SAlison Schofield		accessed through the CXL.mem bus. Injecting poison adds the
1250d527f5SAlison Schofield		address to the device's Poison List and the error source is set
1350d527f5SAlison Schofield		to Injected. In addition, the device adds a poison creation
1450d527f5SAlison Schofield		event to its internal Informational Event log, updates the
1550d527f5SAlison Schofield		Event Status register, and if configured, interrupts the host.
1650d527f5SAlison Schofield		It is not an error to inject poison into an address that
17*591209c7SAlison Schofield		already has poison present and no error is returned. If the
18*591209c7SAlison Schofield		device returns 'Inject Poison Limit Reached' an -EBUSY error
19*591209c7SAlison Schofield		is returned to the user. The inject_poison attribute is only
20*591209c7SAlison Schofield		visible for devices supporting the capability.
2150d527f5SAlison Schofield
2250d527f5SAlison Schofield
2350d527f5SAlison SchofieldWhat:		/sys/kernel/debug/memX/clear_poison
2450d527f5SAlison SchofieldDate:		April, 2023
2550d527f5SAlison SchofieldKernelVersion:	v6.4
2650d527f5SAlison SchofieldContact:	linux-cxl@vger.kernel.org
2750d527f5SAlison SchofieldDescription:
2850d527f5SAlison Schofield		(WO) When a Device Physical Address (DPA) is written to this
2950d527f5SAlison Schofield		attribute, the memdev driver sends a clear poison command to
3050d527f5SAlison Schofield		the device for the specified address. Clearing poison removes
3150d527f5SAlison Schofield		the address from the device's Poison List and writes 0 (zero)
3250d527f5SAlison Schofield		for 64 bytes starting at address. It is not an error to clear
3350d527f5SAlison Schofield		poison from an address that does not have poison set. If the
3450d527f5SAlison Schofield		device cannot clear poison from the address, -ENXIO is returned.
3550d527f5SAlison Schofield		The clear_poison attribute is only visible for devices
3650d527f5SAlison Schofield		supporting the capability.
378039804cSBen Cheatham
388039804cSBen CheathamWhat:		/sys/kernel/debug/cxl/einj_types
398039804cSBen CheathamDate:		January, 2024
408039804cSBen CheathamKernelVersion:	v6.9
418039804cSBen CheathamContact:	linux-cxl@vger.kernel.org
428039804cSBen CheathamDescription:
438039804cSBen Cheatham		(RO) Prints the CXL protocol error types made available by
44edc12434SDan Williams		the platform in the format:
45edc12434SDan Williams
46edc12434SDan Williams			0x<error number> <error type>
47edc12434SDan Williams
488039804cSBen Cheatham		The possible error types are (as of ACPI v6.5):
49edc12434SDan Williams
508039804cSBen Cheatham			0x1000	CXL.cache Protocol Correctable
518039804cSBen Cheatham			0x2000	CXL.cache Protocol Uncorrectable non-fatal
528039804cSBen Cheatham			0x4000	CXL.cache Protocol Uncorrectable fatal
538039804cSBen Cheatham			0x8000	CXL.mem Protocol Correctable
548039804cSBen Cheatham			0x10000	CXL.mem Protocol Uncorrectable non-fatal
558039804cSBen Cheatham			0x20000	CXL.mem Protocol Uncorrectable fatal
568039804cSBen Cheatham
578039804cSBen Cheatham		The <error number> can be written to einj_inject to inject
588039804cSBen Cheatham		<error type> into a chosen dport.
598039804cSBen Cheatham
608039804cSBen CheathamWhat:		/sys/kernel/debug/cxl/$dport_dev/einj_inject
618039804cSBen CheathamDate:		January, 2024
628039804cSBen CheathamKernelVersion:	v6.9
638039804cSBen CheathamContact:	linux-cxl@vger.kernel.org
648039804cSBen CheathamDescription:
658039804cSBen Cheatham		(WO) Writing an integer to this file injects the corresponding
668039804cSBen Cheatham		CXL protocol error into $dport_dev ($dport_dev will be a device
678039804cSBen Cheatham		name from /sys/bus/pci/devices). The integer to type mapping for
688039804cSBen Cheatham		injection can be found by reading from einj_types. If the dport
698039804cSBen Cheatham		was enumerated in RCH mode, a CXL 1.1 error is injected, otherwise
708039804cSBen Cheatham		a CXL 2.0 error is injected.
71