요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
Memdev DPA poison clear
debugfs-cxl:37-65Poison List에서 DPA를 제거하면서 해당 주소부터 64 bytes를 0으로 덮어씁니다. 원본 data를 복구하거나 오류를 교정하는 interface가 아닙니다.
Region HPA poison injection과 clear
debugfs-cxl:67-123Region driver가 HPA를 DPA로 변환해 해당 memdev에 poison command를 전달합니다. Region의 모든 memdev가 inject와 clear를 모두 지원할 때만 attributes가 보입니다.
CXL protocol error types와 dport injection
debugfs-cxl:125-157Platform이 제공하는 CXL.cache·CXL.mem correctable·uncorrectable error number를 조회하고 선택한 PCI dport에 해당 protocol error를 주입합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
What: /sys/kernel/debug/cxl/memX/inject_poison
Date: April, 2023
KernelVersion: v6.4
Contact: linux-cxl@vger.kernel.org
Description:
(WO) When a Device Physical Address (DPA) is written to this
attribute, the memdev driver sends an inject poison command to
the device for the specified address. The DPA must be 64-byte
aligned and the length of the injected poison is 64-bytes. If
successful, the device returns poison when the address is
accessed through the CXL.mem bus. Injecting poison adds the
address to the device's Poison List and the error source is set
to Injected. In addition, the device adds a poison creation
event to its internal Informational Event log, updates the
Event Status register, and if configured, interrupts the host.
It is not an error to inject poison into an address that
already has poison present and no error is returned. If the
device returns 'Inject Poison Limit Reached' an -EBUSY error
is returned to the user. The inject_poison attribute is only
visible for devices supporting the capability.
TEST-ONLY INTERFACE: This interface is intended for testing
and validation purposes only. It is not a data repair mechanism
and should never be used on production systems or live data.
DATA LOSS RISK: For CXL persistent memory (PMEM) devices,
poison injection can result in permanent data loss. Injected
poison may render data permanently inaccessible even after
clearing, as the clear operation writes zeros and does not
recover original data.
SYSTEM STABILITY RISK: For volatile memory, poison injection
can cause kernel crashes, system instability, or unpredictable
behavior if the poisoned addresses are accessed by running code
or critical kernel structures.
What: /sys/kernel/debug/cxl/memX/clear_poison
Date: April, 2023
KernelVersion: v6.4
Contact: linux-cxl@vger.kernel.org
Description:
(WO) When a Device Physical Address (DPA) is written to this
attribute, the memdev driver sends a clear poison command to
the device for the specified address. Clearing poison removes
the address from the device's Poison List and writes 0 (zero)
for 64 bytes starting at address. It is not an error to clear
poison from an address that does not have poison set. If the
device cannot clear poison from the address, -ENXIO is returned.
The clear_poison attribute is only visible for devices
supporting the capability.
TEST-ONLY INTERFACE: This interface is intended for testing
and validation purposes only. It is not a data repair mechanism
and should never be used on production systems or live data.
CLEAR IS NOT DATA RECOVERY: This operation writes zeros to the
specified address range and removes the address from the poison
list. It does NOT recover or restore original data that may have
been present before poison injection. Any original data at the
cleared address is permanently lost and replaced with zeros.
CLEAR IS NOT A REPAIR MECHANISM: This interface is for testing
purposes only and should not be used as a data repair tool.
Clearing poison is fundamentally different from data recovery
or error correction.
What: /sys/kernel/debug/cxl/regionX/inject_poison
Date: August, 2025
Contact: linux-cxl@vger.kernel.org
Description:
(WO) When a Host Physical Address (HPA) is written to this
attribute, the region driver translates it to a Device
Physical Address (DPA) and identifies the corresponding
memdev. It then sends an inject poison command to that memdev
at the translated DPA. Refer to the memdev ABI entry at:
/sys/kernel/debug/cxl/memX/inject_poison for the detailed
behavior. This attribute is only visible if all memdevs
participating in the region support both inject and clear
poison commands.
TEST-ONLY INTERFACE: This interface is intended for testing
and validation purposes only. It is not a data repair mechanism
and should never be used on production systems or live data.
DATA LOSS RISK: For CXL persistent memory (PMEM) devices,
poison injection can result in permanent data loss. Injected
poison may render data permanently inaccessible even after
clearing, as the clear operation writes zeros and does not
recover original data.
SYSTEM STABILITY RISK: For volatile memory, poison injection
can cause kernel crashes, system instability, or unpredictable
behavior if the poisoned addresses are accessed by running code
or critical kernel structures.
What: /sys/kernel/debug/cxl/regionX/clear_poison
Date: August, 2025
Contact: linux-cxl@vger.kernel.org
Description:
(WO) When a Host Physical Address (HPA) is written to this
attribute, the region driver translates it to a Device
Physical Address (DPA) and identifies the corresponding
memdev. It then sends a clear poison command to that memdev
at the translated DPA. Refer to the memdev ABI entry at:
/sys/kernel/debug/cxl/memX/clear_poison for the detailed
behavior. This attribute is only visible if all memdevs
participating in the region support both inject and clear
poison commands.
TEST-ONLY INTERFACE: This interface is intended for testing
and validation purposes only. It is not a data repair mechanism
and should never be used on production systems or live data.
CLEAR IS NOT DATA RECOVERY: This operation writes zeros to the
specified address range and removes the address from the poison
list. It does NOT recover or restore original data that may have
been present before poison injection. Any original data at the
cleared address is permanently lost and replaced with zeros.
CLEAR IS NOT A REPAIR MECHANISM: This interface is for testing
purposes only and should not be used as a data repair tool.
Clearing poison is fundamentally different from data recovery
or error correction.
What: /sys/kernel/debug/cxl/einj_types
Date: January, 2024
KernelVersion: v6.9
Contact: linux-cxl@vger.kernel.org
Description:
(RO) Prints the CXL protocol error types made available by
the platform in the format:
0x<error number> <error type>
The possible error types are (as of ACPI v6.5):
0x1000 CXL.cache Protocol Correctable
0x2000 CXL.cache Protocol Uncorrectable non-fatal
0x4000 CXL.cache Protocol Uncorrectable fatal
0x8000 CXL.mem Protocol Correctable
0x10000 CXL.mem Protocol Uncorrectable non-fatal
0x20000 CXL.mem Protocol Uncorrectable fatal
The <error number> can be written to einj_inject to inject
<error type> into a chosen dport.
What: /sys/kernel/debug/cxl/$dport_dev/einj_inject
Date: January, 2024
KernelVersion: v6.9
Contact: linux-cxl@vger.kernel.org
Description:
(WO) Writing an integer to this file injects the corresponding
CXL protocol error into $dport_dev ($dport_dev will be a device
name from /sys/bus/pci/devices). The integer to type mapping for
injection can be found by reading from einj_types. If the dport
was enumerated in RCH mode, a CXL 1.1 error is injected, otherwise
a CXL 2.0 error is injected.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Memdev poison injection
1-35| 항목 | 내용 |
|---|---|
| What | /sys/kernel/debug/cxl/memX/inject_poison |
| Date | 2023년 4월 |
| KernelVersion | v6.4 |
| Contact | linux-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가 보입니다.
| 경고 | 내용 |
|---|---|
| 시험 전용 interface | Testing과 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 또는 예측할 수 없는 동작이 발생할 수 있습니다. |
정렬된 DPA 한 cache line에 poison을 주입하면 device 내부 목록과 event 상태가 갱신되고 이후 CXL.mem access에서 poison이 반환된다.
Memdev poison clear
37-65| 항목 | 내용 |
|---|---|
| What | /sys/kernel/debug/cxl/memX/clear_poison |
| Date | 2023년 4월 |
| KernelVersion | v6.4 |
| Contact | linux-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가 보입니다.
| 경고 | 내용 |
|---|---|
| 시험 전용 interface | Testing과 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 metadata를 제거하는 동시에 해당 cache line을 0으로 덮어쓴다. 원본 data로 되돌리는 경로는 없다.
Region HPA poison injection과 clear
67-123| What | Date | Contact | 권한 |
|---|---|---|---|
| /sys/kernel/debug/cxl/regionX/inject_poison | 2025년 8월 | linux-cxl@vger.kernel.org | WO |
| /sys/kernel/debug/cxl/regionX/clear_poison | 2025년 8월 | linux-cxl@vger.kernel.org | WO |
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에 사용하면 안 됩니다. |
| Inject | PMEM에서는 영구 data loss가 발생할 수 있고 volatile memory에서는 kernel crash와 system instability가 발생할 수 있습니다. |
| Clear | 0을 덮어쓰므로 원본 data를 복구하지 않으며 data repair 또는 error correction mechanism이 아닙니다. |
사용자는 region HPA를 지정하고 region driver가 interleave mapping을 따라 대상 memdev와 DPA를 찾아 memdev command를 실행한다.
CXL protocol error injection
125-157| 항목 | 내용 |
|---|---|
| What | /sys/kernel/debug/cxl/einj_types |
| Date | 2024년 1월 |
| KernelVersion | v6.9 |
| Contact | linux-cxl@vger.kernel.org |
| 권한 | RO |
Platform이 제공하는 CXL protocol error types를 다음 형식으로 출력합니다.
0x<error number> <error type>
ACPI v6.5 기준 가능한 error types는 다음과 같습니다.
| Error number | Error type |
|---|---|
| 0x1000 | CXL.cache Protocol Correctable |
| 0x2000 | CXL.cache Protocol Uncorrectable non-fatal |
| 0x4000 | CXL.cache Protocol Uncorrectable fatal |
| 0x8000 | CXL.mem Protocol Correctable |
| 0x10000 | CXL.mem Protocol Uncorrectable non-fatal |
| 0x20000 | CXL.mem Protocol Uncorrectable fatal |
<error number>를 einj_inject에 쓰면 선택한 dport에 해당 <error type>을 주입할 수 있습니다.
| 항목 | 내용 |
|---|---|
| What | /sys/kernel/debug/cxl/$dport_dev/einj_inject |
| Date | 2024년 1월 |
| KernelVersion | v6.9 |
| Contact | linux-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이 허용한 번호를 조회하고 PCI dport의 einj_inject에 번호를 쓴다. Enumerated mode가 실제 주입할 CXL error generation을 결정한다.
Memdev DPA poison injection
debugfs-cxl:1-3564-byte aligned DPA에 64-byte poison을 주입하고 Poison List·informational event log·status·interrupt를 갱신합니다. PMEM data loss와 volatile memory system crash 위험 때문에 시험에만 사용해야 합니다.