1- APEI Error INJection
2- ~~~~~~~~~~~~~~~~~~~~
1+ .. SPDX-License-Identifier: GPL-2.0
2+
3+ ====================
4+ APEI Error INJection
5+ ====================
36
47EINJ provides a hardware error injection mechanism. It is very useful
58for debugging and testing APEI and RAS features in general.
69
710You need to check whether your BIOS supports EINJ first. For that, look
8- for early boot messages similar to this one:
11+ for early boot messages similar to this one::
912
10- ACPI: EINJ 0x000000007370A000 000150 (v01 INTEL 00000001 INTL 00000001)
13+ ACPI: EINJ 0x000000007370A000 000150 (v01 INTEL 00000001 INTL 00000001)
1114
1215which shows that the BIOS is exposing an EINJ table - it is the
1316mechanism through which the injection is done.
@@ -23,11 +26,11 @@ order to see the APEI,EINJ,... functionality supported and exposed by
2326the BIOS menu.
2427
2528To use EINJ, make sure the following are options enabled in your kernel
26- configuration:
29+ configuration::
2730
28- CONFIG_DEBUG_FS
29- CONFIG_ACPI_APEI
30- CONFIG_ACPI_APEI_EINJ
31+ CONFIG_DEBUG_FS
32+ CONFIG_ACPI_APEI
33+ CONFIG_ACPI_APEI_EINJ
3134
3235The EINJ user interface is in <debugfs mount point>/apei/einj.
3336
@@ -37,20 +40,22 @@ The following files belong to it:
3740
3841 This file shows which error types are supported:
3942
43+ ================ ===================================
4044 Error Type Value Error Description
41- ================ =================
42- 0x00000001 Processor Correctable
43- 0x00000002 Processor Uncorrectable non-fatal
44- 0x00000004 Processor Uncorrectable fatal
45- 0x00000008 Memory Correctable
46- 0x00000010 Memory Uncorrectable non-fatal
47- 0x00000020 Memory Uncorrectable fatal
48- 0x00000040 PCI Express Correctable
49- 0x00000080 PCI Express Uncorrectable fatal
50- 0x00000100 PCI Express Uncorrectable non-fatal
51- 0x00000200 Platform Correctable
52- 0x00000400 Platform Uncorrectable non-fatal
53- 0x00000800 Platform Uncorrectable fatal
45+ ================ ===================================
46+ 0x00000001 Processor Correctable
47+ 0x00000002 Processor Uncorrectable non-fatal
48+ 0x00000004 Processor Uncorrectable fatal
49+ 0x00000008 Memory Correctable
50+ 0x00000010 Memory Uncorrectable non-fatal
51+ 0x00000020 Memory Uncorrectable fatal
52+ 0x00000040 PCI Express Correctable
53+ 0x00000080 PCI Express Uncorrectable fatal
54+ 0x00000100 PCI Express Uncorrectable non-fatal
55+ 0x00000200 Platform Correctable
56+ 0x00000400 Platform Uncorrectable non-fatal
57+ 0x00000800 Platform Uncorrectable fatal
58+ ================ ===================================
5459
5560 The format of the file contents are as above, except present are only
5661 the available error types.
@@ -73,9 +78,12 @@ The following files belong to it:
7378 injection. Value is a bitmask as specified in ACPI5.0 spec for the
7479 SET_ERROR_TYPE_WITH_ADDRESS data structure:
7580
76- Bit 0 - Processor APIC field valid (see param3 below).
77- Bit 1 - Memory address and mask valid (param1 and param2).
78- Bit 2 - PCIe (seg,bus,dev,fn) valid (see param4 below).
81+ Bit 0
82+ Processor APIC field valid (see param3 below).
83+ Bit 1
84+ Memory address and mask valid (param1 and param2).
85+ Bit 2
86+ PCIe (seg,bus,dev,fn) valid (see param4 below).
7987
8088 If set to zero, legacy behavior is mimicked where the type of
8189 injection specifies just one bit set, and param1 is multiplexed.
@@ -121,7 +129,7 @@ BIOS versions based on the ACPI 5.0 specification have more control over
121129the target of the injection. For processor-related errors (type 0x1, 0x2
122130and 0x4), you can set flags to 0x3 (param3 for bit 0, and param1 and
123131param2 for bit 1) so that you have more information added to the error
124- signature being injected. The actual data passed is this:
132+ signature being injected. The actual data passed is this::
125133
126134 memory_address = param1;
127135 memory_address_range = param2;
@@ -131,7 +139,7 @@ signature being injected. The actual data passed is this:
131139For memory errors (type 0x8, 0x10 and 0x20) the address is set using
132140param1 with a mask in param2 (0x0 is equivalent to all ones). For PCI
133141express errors (type 0x40, 0x80 and 0x100) the segment, bus, device and
134- function are specified using param1:
142+ function are specified using param1::
135143
136144 31 24 23 16 15 11 10 8 7 0
137145 +-------------------------------------------------+
@@ -152,26 +160,26 @@ documentation for details (and expect changes to this API if vendors
152160creativity in using this feature expands beyond our expectations).
153161
154162
155- An error injection example:
163+ An error injection example::
156164
157- # cd /sys/kernel/debug/apei/einj
158- # cat available_error_type # See which errors can be injected
159- 0x00000002 Processor Uncorrectable non-fatal
160- 0x00000008 Memory Correctable
161- 0x00000010 Memory Uncorrectable non-fatal
162- # echo 0x12345000 > param1 # Set memory address for injection
163- # echo $((-1 << 12)) > param2 # Mask 0xfffffffffffff000 - anywhere in this page
164- # echo 0x8 > error_type # Choose correctable memory error
165- # echo 1 > error_inject # Inject now
165+ # cd /sys/kernel/debug/apei/einj
166+ # cat available_error_type # See which errors can be injected
167+ 0x00000002 Processor Uncorrectable non-fatal
168+ 0x00000008 Memory Correctable
169+ 0x00000010 Memory Uncorrectable non-fatal
170+ # echo 0x12345000 > param1 # Set memory address for injection
171+ # echo $((-1 << 12)) > param2 # Mask 0xfffffffffffff000 - anywhere in this page
172+ # echo 0x8 > error_type # Choose correctable memory error
173+ # echo 1 > error_inject # Inject now
166174
167- You should see something like this in dmesg:
175+ You should see something like this in dmesg::
168176
169- [22715.830801] EDAC sbridge MC3: HANDLING MCE MEMORY ERROR
170- [22715.834759] EDAC sbridge MC3: CPU 0: Machine Check Event: 0 Bank 7: 8c00004000010090
171- [22715.834759] EDAC sbridge MC3: TSC 0
172- [22715.834759] EDAC sbridge MC3: ADDR 12345000 EDAC sbridge MC3: MISC 144780c86
173- [22715.834759] EDAC sbridge MC3: PROCESSOR 0:306e7 TIME 1422553404 SOCKET 0 APIC 0
174- [22716.616173] EDAC MC3: 1 CE memory read error on CPU_SrcID#0_Channel#0_DIMM#0 (channel:0 slot:0 page:0x12345 offset:0x0 grain:32 syndrome:0x0 - area:DRAM err_code:0001:0090 socket:0 channel_mask:1 rank:0)
177+ [22715.830801] EDAC sbridge MC3: HANDLING MCE MEMORY ERROR
178+ [22715.834759] EDAC sbridge MC3: CPU 0: Machine Check Event: 0 Bank 7: 8c00004000010090
179+ [22715.834759] EDAC sbridge MC3: TSC 0
180+ [22715.834759] EDAC sbridge MC3: ADDR 12345000 EDAC sbridge MC3: MISC 144780c86
181+ [22715.834759] EDAC sbridge MC3: PROCESSOR 0:306e7 TIME 1422553404 SOCKET 0 APIC 0
182+ [22716.616173] EDAC MC3: 1 CE memory read error on CPU_SrcID#0_Channel#0_DIMM#0 (channel:0 slot:0 page:0x12345 offset:0x0 grain:32 syndrome:0x0 - area:DRAM err_code:0001:0090 socket:0 channel_mask:1 rank:0)
175183
176184For more information about EINJ, please refer to ACPI specification
177185version 4.0, section 17.5 and ACPI 5.0, section 18.6.
0 commit comments