// SPDX-License-Identifier: GPL-2.0-only /* * APEI Boot Error Record Table (BERT) support * * Copyright 2011 Intel Corp. * Author: Huang Ying <ying.huang@intel.com> * * Under normal circumstances, when a hardware error occurs, the error * handler receives control and processes the error. This gives OSPM a * chance to process the error condition, report it, and optionally attempt * recovery. In some cases, the system is unable to process an error. * For example, system firmware or a management controller may choose to * reset the system or the system might experience an uncontrolled crash * or reset.The boot error source is used to report unhandled errors that * occurred in a previous boot. This mechanism is described in the BERT * table. * * For more information about BERT, please refer to ACPI Specification * version 4.0, section 17.3.1
*/
/* * Print "all" the error records in the BERT table, but avoid huge spam to * the console if the BIOS included oversize records, or too many records. * Skipping some records here does not lose anything because the full * data is available to user tools in: * /sys/firmware/acpi/tables/data/BERT
*/ staticvoid __init bert_print_all(struct acpi_bert_region *region, unsignedint region_len)
{ struct acpi_hest_generic_status *estatus =
(struct acpi_hest_generic_status *)region; int remain = region_len; int printed = 0, skipped = 0;
u32 estatus_len;
while (remain >= sizeof(struct acpi_bert_region)) {
estatus_len = cper_estatus_len(estatus); if (remain < estatus_len) {
pr_err(FW_BUG "Truncated status block (length: %u).\n",
estatus_len); break;
}
/* No more error records. */ if (!estatus->block_status) break;
if (cper_estatus_check(estatus)) {
pr_err(FW_BUG "Invalid error record.\n"); break;
}
if (estatus_len < ACPI_BERT_PRINT_MAX_LEN &&
printed < ACPI_BERT_PRINT_MAX_RECORDS) {
pr_info_once("Error records from previous boot:\n");
cper_estatus_print(KERN_INFO HW_ERR, estatus);
printed++;
} else {
skipped++;
}
/* * Because the boot error source is "one-time polled" type, * clear Block Status of current Generic Error Status Block, * once it's printed.
*/
estatus->block_status = 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.