← Documents Documentation/ABI/testing/debugfs-cxl GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

CXL poison and protocol error injection debugfs ABI

CXL memdev·region poison 주입과 해제, HPA-DPA translation, Poison List와 event 처리, platform 제공 protocol error types 및 dport error injection debugfs ABI를 설명합니다.

Source pathDocumentation/ABI/testing/debugfs-cxl
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

Memdev DPA poison injection

debugfs-cxl:1-35

64-byte aligned DPA에 64-byte poison을 주입하고 Poison List·informational event log·status·interrupt를 갱신합니다. PMEM data loss와 volatile memory system crash 위험 때문에 시험에만 사용해야 합니다.

Memdev DPA poison clear

debugfs-cxl:37-65

Poison List에서 DPA를 제거하면서 해당 주소부터 64 bytes를 0으로 덮어씁니다. 원본 data를 복구하거나 오류를 교정하는 interface가 아닙니다.

Region HPA poison injection과 clear

debugfs-cxl:67-123

Region driver가 HPA를 DPA로 변환해 해당 memdev에 poison command를 전달합니다. Region의 모든 memdev가 inject와 clear를 모두 지원할 때만 attributes가 보입니다.

CXL protocol error types와 dport injection

debugfs-cxl:125-157

Platform이 제공하는 CXL.cache·CXL.mem correctable·uncorrectable error number를 조회하고 선택한 PCI dport에 해당 protocol error를 주입합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 What: /sys/kernel/debug/cxl/memX/inject_poison
2 Date: April, 2023
3 KernelVersion: v6.4
4 Contact: linux-cxl@vger.kernel.org
5 Description:
6 (WO) When a Device Physical Address (DPA) is written to this
7 attribute, the memdev driver sends an inject poison command to
8 the device for the specified address. The DPA must be 64-byte
9 aligned and the length of the injected poison is 64-bytes. If
10 successful, the device returns poison when the address is
11 accessed through the CXL.mem bus. Injecting poison adds the
12 address to the device's Poison List and the error source is set
13 to Injected. In addition, the device adds a poison creation
14 event to its internal Informational Event log, updates the
15 Event Status register, and if configured, interrupts the host.
16 It is not an error to inject poison into an address that
17 already has poison present and no error is returned. If the
18 device returns 'Inject Poison Limit Reached' an -EBUSY error
19 is returned to the user. The inject_poison attribute is only
20 visible for devices supporting the capability.
21
22 TEST-ONLY INTERFACE: This interface is intended for testing
23 and validation purposes only. It is not a data repair mechanism
24 and should never be used on production systems or live data.
25
26 DATA LOSS RISK: For CXL persistent memory (PMEM) devices,
27 poison injection can result in permanent data loss. Injected
28 poison may render data permanently inaccessible even after
29 clearing, as the clear operation writes zeros and does not
30 recover original data.
31
32 SYSTEM STABILITY RISK: For volatile memory, poison injection
33 can cause kernel crashes, system instability, or unpredictable
34 behavior if the poisoned addresses are accessed by running code
35 or critical kernel structures.
36
37 What: /sys/kernel/debug/cxl/memX/clear_poison
38 Date: April, 2023
39 KernelVersion: v6.4
40 Contact: linux-cxl@vger.kernel.org
41 Description:
42 (WO) When a Device Physical Address (DPA) is written to this
43 attribute, the memdev driver sends a clear poison command to
44 the device for the specified address. Clearing poison removes
45 the address from the device's Poison List and writes 0 (zero)
46 for 64 bytes starting at address. It is not an error to clear
47 poison from an address that does not have poison set. If the
48 device cannot clear poison from the address, -ENXIO is returned.
49 The clear_poison attribute is only visible for devices
50 supporting the capability.
51
52 TEST-ONLY INTERFACE: This interface is intended for testing
53 and validation purposes only. It is not a data repair mechanism
54 and should never be used on production systems or live data.
55
56 CLEAR IS NOT DATA RECOVERY: This operation writes zeros to the
57 specified address range and removes the address from the poison
58 list. It does NOT recover or restore original data that may have
59 been present before poison injection. Any original data at the
60 cleared address is permanently lost and replaced with zeros.
61
62 CLEAR IS NOT A REPAIR MECHANISM: This interface is for testing
63 purposes only and should not be used as a data repair tool.
64 Clearing poison is fundamentally different from data recovery
65 or error correction.
66
67 What: /sys/kernel/debug/cxl/regionX/inject_poison
68 Date: August, 2025
69 Contact: linux-cxl@vger.kernel.org
70 Description:
71 (WO) When a Host Physical Address (HPA) is written to this
72 attribute, the region driver translates it to a Device
73 Physical Address (DPA) and identifies the corresponding
74 memdev. It then sends an inject poison command to that memdev
75 at the translated DPA. Refer to the memdev ABI entry at:
76 /sys/kernel/debug/cxl/memX/inject_poison for the detailed
77 behavior. This attribute is only visible if all memdevs
78 participating in the region support both inject and clear
79 poison commands.
80
81 TEST-ONLY INTERFACE: This interface is intended for testing
82 and validation purposes only. It is not a data repair mechanism
83 and should never be used on production systems or live data.
84
85 DATA LOSS RISK: For CXL persistent memory (PMEM) devices,
86 poison injection can result in permanent data loss. Injected
87 poison may render data permanently inaccessible even after
88 clearing, as the clear operation writes zeros and does not
89 recover original data.
90
91 SYSTEM STABILITY RISK: For volatile memory, poison injection
92 can cause kernel crashes, system instability, or unpredictable
93 behavior if the poisoned addresses are accessed by running code
94 or critical kernel structures.
95
96 What: /sys/kernel/debug/cxl/regionX/clear_poison
97 Date: August, 2025
98 Contact: linux-cxl@vger.kernel.org
99 Description:
100 (WO) When a Host Physical Address (HPA) is written to this
101 attribute, the region driver translates it to a Device
102 Physical Address (DPA) and identifies the corresponding
103 memdev. It then sends a clear poison command to that memdev
104 at the translated DPA. Refer to the memdev ABI entry at:
105 /sys/kernel/debug/cxl/memX/clear_poison for the detailed
106 behavior. This attribute is only visible if all memdevs
107 participating in the region support both inject and clear
108 poison commands.
109
110 TEST-ONLY INTERFACE: This interface is intended for testing
111 and validation purposes only. It is not a data repair mechanism
112 and should never be used on production systems or live data.
113
114 CLEAR IS NOT DATA RECOVERY: This operation writes zeros to the
115 specified address range and removes the address from the poison
116 list. It does NOT recover or restore original data that may have
117 been present before poison injection. Any original data at the
118 cleared address is permanently lost and replaced with zeros.
119
120 CLEAR IS NOT A REPAIR MECHANISM: This interface is for testing
121 purposes only and should not be used as a data repair tool.
122 Clearing poison is fundamentally different from data recovery
123 or error correction.
124
125 What: /sys/kernel/debug/cxl/einj_types
126 Date: January, 2024
127 KernelVersion: v6.9
128 Contact: linux-cxl@vger.kernel.org
129 Description:
130 (RO) Prints the CXL protocol error types made available by
131 the platform in the format:
132
133 0x<error number> <error type>
134
135 The possible error types are (as of ACPI v6.5):
136
137 0x1000 CXL.cache Protocol Correctable
138 0x2000 CXL.cache Protocol Uncorrectable non-fatal
139 0x4000 CXL.cache Protocol Uncorrectable fatal
140 0x8000 CXL.mem Protocol Correctable
141 0x10000 CXL.mem Protocol Uncorrectable non-fatal
142 0x20000 CXL.mem Protocol Uncorrectable fatal
143
144 The <error number> can be written to einj_inject to inject
145 <error type> into a chosen dport.
146
147 What: /sys/kernel/debug/cxl/$dport_dev/einj_inject
148 Date: January, 2024
149 KernelVersion: v6.9
150 Contact: linux-cxl@vger.kernel.org
151 Description:
152 (WO) Writing an integer to this file injects the corresponding
153 CXL protocol error into $dport_dev ($dport_dev will be a device
154 name from /sys/bus/pci/devices). The integer to type mapping for
155 injection can be found by reading from einj_types. If the dport
156 was enumerated in RCH mode, a CXL 1.1 error is injected, otherwise
157 a CXL 2.0 error is injected.
158

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Memdev poison injection

1-35
항목내용
What/sys/kernel/debug/cxl/memX/inject_poison
Date2023년 4월
KernelVersionv6.4
Contactlinux-cxl@vger.kernel.org
권한WO

Device Physical Address(DPA)를 이 attribute에 쓰면 memdev driver가 해당 주소에 대한 inject poison command를 device로 보냅니다. DPA는 64-byte aligned여야 하며 주입되는 poison 길이는 64 bytes입니다.

성공하면 CXL.mem bus를 통해 해당 주소에 접근할 때 device가 poison을 반환합니다. Poison 주입은 주소를 device의 Poison List에 추가하고 error source를 Injected로 설정합니다. 또한 device는 내부 Informational Event log에 poison creation event를 추가하고 Event Status register를 갱신하며, 설정된 경우 host에 interrupt를 보냅니다.

이미 poison이 있는 주소에 다시 주입해도 오류가 아니며 error를 반환하지 않습니다. Device가 Inject Poison Limit Reached를 반환하면 user에게 -EBUSY를 반환합니다. 이 capability를 지원하는 device에서만 inject_poison attribute가 보입니다.

경고내용
시험 전용 interfaceTesting과 validation에만 사용합니다. Data repair mechanism이 아니며 production system 또는 live data에 절대 사용하면 안 됩니다.
Data loss 위험CXL PMEM device에서는 영구 data loss가 발생할 수 있습니다. Clear가 0을 쓰고 원본을 복구하지 않으므로 poison을 지운 뒤에도 data가 영구적으로 접근 불가능할 수 있습니다.
System stability 위험Volatile memory에서 실행 중인 code나 중요한 kernel structures가 poisoned address에 접근하면 kernel crash, system instability 또는 예측할 수 없는 동작이 발생할 수 있습니다.
Memdev poison injection의 device side effects
64-byte aligned DPAmemX/inject_poisonInject Poison command64-byte poisonCXL.mem access returns poison
Inject Poison commandPoison ListError source = Injected
Inject Poison commandInformational Event logEvent StatusOptional host interrupt

정렬된 DPA 한 cache line에 poison을 주입하면 device 내부 목록과 event 상태가 갱신되고 이후 CXL.mem access에서 poison이 반환된다.

Memdev poison clear

37-65
항목내용
What/sys/kernel/debug/cxl/memX/clear_poison
Date2023년 4월
KernelVersionv6.4
Contactlinux-cxl@vger.kernel.org
권한WO

DPA를 이 attribute에 쓰면 memdev driver가 해당 주소에 대한 clear poison command를 device로 보냅니다. Clear는 주소를 device의 Poison List에서 제거하고 그 주소부터 64 bytes에 0을 씁니다.

Poison이 설정되지 않은 주소를 clear해도 오류가 아닙니다. Device가 해당 주소의 poison을 clear할 수 없으면 -ENXIO를 반환합니다. 이 capability를 지원하는 device에서만 clear_poison attribute가 보입니다.

경고내용
시험 전용 interfaceTesting과 validation에만 사용합니다. Data repair mechanism이 아니며 production system 또는 live data에 절대 사용하면 안 됩니다.
Clear는 data recovery가 아님지정 범위를 0으로 쓰고 Poison List에서 주소를 제거할 뿐, poison 주입 전 원본 data를 복구하지 않습니다. 원본은 영구적으로 사라지고 0으로 대체됩니다.
Clear는 repair mechanism이 아님시험 목적으로만 제공되며 data repair tool로 사용하면 안 됩니다. Poison clear는 data recovery 또는 error correction과 근본적으로 다릅니다.
clear_poison이 실제로 수행하는 작업
DPAmemX/clear_poisonClear Poison commandRemove from Poison List
Clear Poison commandWrite zero to 64 bytesOriginal data permanently lost

Clear는 poison metadata를 제거하는 동시에 해당 cache line을 0으로 덮어쓴다. 원본 data로 되돌리는 경로는 없다.

Region HPA poison injection과 clear

67-123
WhatDateContact권한
/sys/kernel/debug/cxl/regionX/inject_poison2025년 8월linux-cxl@vger.kernel.orgWO
/sys/kernel/debug/cxl/regionX/clear_poison2025년 8월linux-cxl@vger.kernel.orgWO

Host Physical Address(HPA)를 regionX/inject_poison에 쓰면 region driver가 이를 DPA로 변환하고 해당 memdev를 식별한 뒤, 변환된 DPA에 inject poison command를 보냅니다. 세부 동작은 /sys/kernel/debug/cxl/memX/inject_poison ABI와 같습니다.

HPA를 regionX/clear_poison에 쓰면 같은 방식으로 DPA와 memdev를 찾고 clear poison command를 보냅니다. 세부 동작은 /sys/kernel/debug/cxl/memX/clear_poison ABI와 같습니다.

두 attributes는 region에 참여하는 모든 memdev가 inject와 clear poison commands를 모두 지원할 때만 보입니다.

공통 경고내용
시험 전용Testing과 validation만을 위한 interface이며 production system이나 live data에 사용하면 안 됩니다.
InjectPMEM에서는 영구 data loss가 발생할 수 있고 volatile memory에서는 kernel crash와 system instability가 발생할 수 있습니다.
Clear0을 덮어쓰므로 원본 data를 복구하지 않으며 data repair 또는 error correction mechanism이 아닙니다.
Region 주소를 memdev poison command로 변환
Region HPAregion driver translationTarget memdevDevice DPAInject Poison command
Region HPAregion driver translationTarget memdevDevice DPAClear Poison command
All region memdevsInject + clear capabilityRegion attributes visible

사용자는 region HPA를 지정하고 region driver가 interleave mapping을 따라 대상 memdev와 DPA를 찾아 memdev command를 실행한다.

CXL protocol error injection

125-157
항목내용
What/sys/kernel/debug/cxl/einj_types
Date2024년 1월
KernelVersionv6.9
Contactlinux-cxl@vger.kernel.org
권한RO

Platform이 제공하는 CXL protocol error types를 다음 형식으로 출력합니다.

0x<error number> <error type>

ACPI v6.5 기준 가능한 error types는 다음과 같습니다.

Error numberError type
0x1000CXL.cache Protocol Correctable
0x2000CXL.cache Protocol Uncorrectable non-fatal
0x4000CXL.cache Protocol Uncorrectable fatal
0x8000CXL.mem Protocol Correctable
0x10000CXL.mem Protocol Uncorrectable non-fatal
0x20000CXL.mem Protocol Uncorrectable fatal

<error number>를 einj_inject에 쓰면 선택한 dport에 해당 <error type>을 주입할 수 있습니다.

항목내용
What/sys/kernel/debug/cxl/$dport_dev/einj_inject
Date2024년 1월
KernelVersionv6.9
Contactlinux-cxl@vger.kernel.org
권한WO

이 file에 integer를 쓰면 $dport_dev에 대응하는 CXL protocol error를 주입합니다. $dport_dev는 /sys/bus/pci/devices의 device name입니다. Integer와 error type의 mapping은 einj_types에서 읽습니다.

Dport가 RCH mode로 enumerate되었다면 CXL 1.1 error를 주입하고, 그렇지 않으면 CXL 2.0 error를 주입합니다.

Platform CXL protocol error 선택과 주입
Read einj_typesSelect error number$dport_dev/einj_injectProtocol error
Dport enumerated in RCH modeCXL 1.1 error
Other enumeration modeCXL 2.0 error

먼저 platform이 허용한 번호를 조회하고 PCI dport의 einj_inject에 번호를 쓴다. Enumerated mode가 실제 주입할 CXL error generation을 결정한다.