Skip to content

Commit 6984f94

Browse files
committed
Merge branch 'acpi-apei'
Merge ACPI APEI updates for 6.17-rc1: - Fix iomem-related sparse warnings in the APEI EINJ driver (Zaid Alali, Tony Luck) - Add EINJv2 error injection support to the APEI EINJ driver (Zaid Alali) - Fix memory corruption in error_type_set() in the APEI EINJ driver (Dan Carpenter) - Fix less than zero comparison on a size_t variable in the APEI EINJ driver (Colin Ian King) - Fix check and iounmap of an uninitialized pointer in the APEI EINJ driver (Colin Ian King) - Add TAINT_MACHINE_CHECK to the GHES panic path in APEI to improve diagnostics and post-mortem analysis (Breno Leitao) - Update APEI reviewer records in MAINTAINERS (Rafael Wysocki) - Fix the handling of synchronous uncorrected memory errors in APEI (Shuai Xue) * acpi-apei: ACPI: APEI: handle synchronous exceptions in task work ACPI: APEI: send SIGBUS to current task if synchronous memory error not recovered ACPI: APEI: MAINTAINERS: Update reviewers for APEI ACPI: APEI: EINJ: Fix trigger actions ACPI: APEI: GHES: add TAINT_MACHINE_CHECK on GHES panic path ACPI: APEI: EINJ: Fix check and iounmap of uninitialized pointer p ACPI: APEI: EINJ: Fix less than zero comparison on a size_t variable ACPI: APEI: EINJ: prevent memory corruption in error_type_set() ACPI: APEI: EINJ: Update the documentation for EINJv2 support ACPI: APEI: EINJ: Enable EINJv2 error injections ACPI: APEI: EINJ: Create debugfs files to enter device id and syndrome ACPI: APEI: EINJ: Discover EINJv2 parameters ACPI: APEI: EINJ: Add einjv2 extension struct ACPI: APEI: EINJ: Enable the discovery of EINJv2 capabilities ACPI: APEI: EINJ: Fix kernel test sparse warnings
2 parents 1140481 + c1f1fda commit 6984f94

9 files changed

Lines changed: 413 additions & 122 deletions

File tree

Documentation/firmware-guide/acpi/apei/einj.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ The following files belong to it:
5959
0x00000200 Platform Correctable
6060
0x00000400 Platform Uncorrectable non-fatal
6161
0x00000800 Platform Uncorrectable fatal
62+
V2_0x00000001 EINJV2 Processor Error
63+
V2_0x00000002 EINJV2 Memory Error
64+
V2_0x00000004 EINJV2 PCI Express Error
6265
================ ===================================
6366

6467
The format of the file contents are as above, except present are only
@@ -88,6 +91,8 @@ The following files belong to it:
8891
Memory address and mask valid (param1 and param2).
8992
Bit 2
9093
PCIe (seg,bus,dev,fn) valid (see param4 below).
94+
Bit 3
95+
EINJv2 extension structure is valid
9196

9297
If set to zero, legacy behavior is mimicked where the type of
9398
injection specifies just one bit set, and param1 is multiplexed.
@@ -122,6 +127,13 @@ The following files belong to it:
122127
this actually works depends on what operations the BIOS actually
123128
includes in the trigger phase.
124129

130+
- component_id0 .. component_idN, component_syndrome0 .. component_syndromeN
131+
132+
These files are used to set the "Component Array" field
133+
of the EINJv2 Extension Structure. Each holds a 128-bit
134+
hex value. Writing just a newline to any of these files
135+
sets an invalid (all-ones) value.
136+
125137
CXL error types are supported from ACPI 6.5 onwards (given a CXL port
126138
is present). The EINJ user interface for CXL error types is at
127139
<debugfs mount point>/cxl. The following files belong to it:
@@ -194,6 +206,27 @@ An error injection example::
194206
# echo 0x8 > error_type # Choose correctable memory error
195207
# echo 1 > error_inject # Inject now
196208

209+
An EINJv2 error injection example::
210+
211+
# cd /sys/kernel/debug/apei/einj
212+
# cat available_error_type # See which errors can be injected
213+
0x00000002 Processor Uncorrectable non-fatal
214+
0x00000008 Memory Correctable
215+
0x00000010 Memory Uncorrectable non-fatal
216+
V2_0x00000001 EINJV2 Processor Error
217+
V2_0x00000002 EINJV2 Memory Error
218+
219+
# echo 0x12345000 > param1 # Set memory address for injection
220+
# echo 0xfffffffffffff000 > param2 # Range - anywhere in this page
221+
# echo 0x1 > component_id0 # First device ID
222+
# echo 0x4 > component_syndrome0 # First error syndrome
223+
# echo 0x2 > component_id1 # Second device ID
224+
# echo 0x4 > component_syndrome1 # Second error syndrome
225+
# echo '' > component_id2 # Mark id2 invalid to terminate list
226+
# echo V2_0x2 > error_type # Choose EINJv2 memory error
227+
# echo 0xa > flags # set flags to indicate EINJv2
228+
# echo 1 > error_inject # Inject now
229+
197230
You should see something like this in dmesg::
198231

199232
[22715.830801] EDAC sbridge MC3: HANDLING MCE MEMORY ERROR

MAINTAINERS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,11 @@ F: tools/power/acpi/
306306

307307
ACPI APEI
308308
M: "Rafael J. Wysocki" <rafael@kernel.org>
309-
R: Len Brown <lenb@kernel.org>
310-
R: James Morse <james.morse@arm.com>
311309
R: Tony Luck <tony.luck@intel.com>
312310
R: Borislav Petkov <bp@alien8.de>
311+
R: Hanjun Guo <guohanjun@huawei.com>
312+
R: Mauro Carvalho Chehab <mchehab@kernel.org>
313+
R: Shuai Xue <xueshuai@linux.alibaba.com>
313314
L: linux-acpi@vger.kernel.org
314315
F: drivers/acpi/apei/
315316

drivers/acpi/apei/apei-internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static inline u32 cper_estatus_len(struct acpi_hest_generic_status *estatus)
131131

132132
int apei_osc_setup(void);
133133

134-
int einj_get_available_error_type(u32 *type);
134+
int einj_get_available_error_type(u32 *type, int einj_action);
135135
int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, u64 param3,
136136
u64 param4);
137137
int einj_cxl_rch_error_inject(u32 type, u32 flags, u64 param1, u64 param2,

0 commit comments

Comments
 (0)