1.\" $NetBSD: apei.4,v 1.3 2024/10/10 09:05:45 rin Exp $ 2.\" 3.\" Copyright (c) 2024 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 16.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25.\" POSSIBILITY OF SUCH DAMAGE. 26.\" 27.Dd March 18, 2024 28.Dt APEI 4 29.Os 30.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 31.Sh NAME 32.Nm apei 33.Nd ACPI Platform Error Interfaces 34.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 35.Sh SYNOPSIS 36.Cd "apei* at apeibus?" 37.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 38.Sh DESCRIPTION 39.Nm 40reports hardware errors discovered through 41.Tn APEI , 42the 43.Tn ACPI 44Platform Error Interfaces. 45.Pp 46.Nm 47also supports injecting errors. 48.\" .Nm 49.\" also supports reading/writing/clearing error records in a persistent 50.\" firmware store (XXX not yet: nothing uses the ERST). 51.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 52.Sh DIAGNOSTICS 53When the hardware detects an error and reports it to 54.Nm , 55it will print information about the error to the console. 56.Pp 57Example of a correctable memory error, automatically corrected by the 58system, with no further intervention needed: 59.Bd -literal 60apei0: error source 1 reported hardware error: severity=corrected nentries=1 status=0x12<CE,GEDE_COUNT=0x1> 61apei0: error source 1 entry 0: SectionType={0xa5bc1114,0x6f64,0x4ede,0xb8b8,{0x3e,0x83,0xed,0x7c,0x83,0xb1}} (memory error) 62apei0: error source 1 entry 0: ErrorSeverity=2 (corrected) 63apei0: error source 1 entry 0: Revision=0x201 64apei0: error source 1 entry 0: Flags=0x1<PRIMARY> 65apei0: error source 1 entry 0: FruText=CorrectedErr 66apei0: error source 1 entry 0: MemoryErrorType=8 (PARITY_ERROR) 67.Pp 68Example of a fatal uncorrectable memory error: 69.Bd -literal 70apei0: error source 0 reported hardware error: severity=fatal nentries=1 status=0x11<UE,GEDE_COUNT=0x1> 71apei0: error source 0 entry 0: SectionType={0xa5bc1114,0x6f64,0x4ede,0xb8b8,{0x3e,0x83,0xed,0x7c,0x83,0xb1}} (memory error) 72apei0: error source 0 entry 0: ErrorSeverity=1 (fatal) 73apei0: error source 0 entry 0: Revision=0x201 74apei0: error source 0 entry 0: Flags=0x1<PRIMARY> 75apei0: error source 0 entry 0: FruText=UncorrectedErr 76apei0: error source 0 entry 0: ErrorStatus=0x400<ErrorType=0x4=ERR_MEM> 77apei0: error source 0 entry 0: Node=0x0 78apei0: error source 0 entry 0: Module=0x0 79apei0: error source 0 entry 0: Device=0x0 80panic: fatal hardware error 81.Ed 82.Pp 83Details of the hardware error sources can be dumped with 84.Xr acpidump 8 . 85.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 86.Sh SEE ALSO 87.Xr acpi 4 , 88.Xr acpihed 4 , 89.Xr acpidump 8 90.Rs 91.%B ACPI Specification 6.5 92.%O Chapter 18: ACPI Platform Error Interfaces (APEI) 93.%U https://uefi.org/specs/ACPI/6.5/18_Platform_Error_Interfaces.html 94.Re 95.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 96.Sh HISTORY 97The 98.Nm 99driver first appeared in 100.Nx 10.1 . 101.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 102.Sh AUTHORS 103The 104.Nm 105driver was written by 106.An Taylor R Campbell Aq Mt riastradh@NetBSD.org . 107.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 108.Sh BUGS 109No sysctl interface to read BERT after boot. 110.Pp 111No simple sysctl interface to inject errors with EINJ, or any way to 112inject errors at physical addresses in pages allocated for testing. 113Perhaps there should be a separate kernel module for that. 114.Pp 115Nothing reads, writes, or clears ERST. 116.Nx 117could use it to store dmesg or other diagnostic information on panic. 118.Pp 119Many hardware error source types in the HEST are missing, such as 120.Tn PCIe 121errors. 122.Pp 123.Nm 124is not wired to any machine-dependent machine check exception 125notifications. 126.Pp 127No formal log format or sysctl/device interface that programs can 128reliably act on. 129.Pp 130.Nx 131makes no attempt to recover from uncorrectable but recoverable errors, 132such as discarding a clean cached page where an uncorrectable memory 133error has occurred. 134