-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/g…
…it/lenb/linux-acpi-2.6 * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (27 commits) ACPI: Don't let acpi_pad needlessly mark TSC unstable drivers/acpi/sleep.h: Checkpatch cleanup ACPI: Minor cleanup eliminating redundant PMTIMER_TICKS to NS conversion ACPI: delete unused c-state promotion/demotion data strucutures ACPI: video: fix acpi_backlight=video ACPI: EC: Use kmemdup drivers/acpi: use kasprintf ACPI, APEI, EINJ injection parameters support Add x64 support to debugfs ACPI, APEI, Use ERST for persistent storage of MCE ACPI, APEI, Error Record Serialization Table (ERST) support ACPI, APEI, Generic Hardware Error Source memory error support ACPI, APEI, UEFI Common Platform Error Record (CPER) header Unified UUID/GUID definition ACPI Hardware Error Device (PNP0C33) support ACPI, APEI, PCIE AER, use general HEST table parsing in AER firmware_first setup ACPI, APEI, Document for APEI ACPI, APEI, EINJ support ACPI, APEI, HEST table parsing ACPI, APEI, APEI supporting infrastructure ...
- Loading branch information
Showing
59 changed files
with
4,472 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
APEI Error INJection | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
EINJ provides a hardware error injection mechanism | ||
It is very useful for debugging and testing of other APEI and RAS features. | ||
|
||
To use EINJ, make sure the following are enabled in your kernel | ||
configuration: | ||
|
||
CONFIG_DEBUG_FS | ||
CONFIG_ACPI_APEI | ||
CONFIG_ACPI_APEI_EINJ | ||
|
||
The user interface of EINJ is debug file system, under the | ||
directory apei/einj. The following files are provided. | ||
|
||
- available_error_type | ||
Reading this file returns the error injection capability of the | ||
platform, that is, which error types are supported. The error type | ||
definition is as follow, the left field is the error type value, the | ||
right field is error description. | ||
|
||
0x00000001 Processor Correctable | ||
0x00000002 Processor Uncorrectable non-fatal | ||
0x00000004 Processor Uncorrectable fatal | ||
0x00000008 Memory Correctable | ||
0x00000010 Memory Uncorrectable non-fatal | ||
0x00000020 Memory Uncorrectable fatal | ||
0x00000040 PCI Express Correctable | ||
0x00000080 PCI Express Uncorrectable fatal | ||
0x00000100 PCI Express Uncorrectable non-fatal | ||
0x00000200 Platform Correctable | ||
0x00000400 Platform Uncorrectable non-fatal | ||
0x00000800 Platform Uncorrectable fatal | ||
|
||
The format of file contents are as above, except there are only the | ||
available error type lines. | ||
|
||
- error_type | ||
This file is used to set the error type value. The error type value | ||
is defined in "available_error_type" description. | ||
|
||
- error_inject | ||
Write any integer to this file to trigger the error | ||
injection. Before this, please specify all necessary error | ||
parameters. | ||
|
||
- param1 | ||
This file is used to set the first error parameter value. Effect of | ||
parameter depends on error_type specified. For memory error, this is | ||
physical memory address. | ||
|
||
- param2 | ||
This file is used to set the second error parameter value. Effect of | ||
parameter depends on error_type specified. For memory error, this is | ||
physical memory address mask. | ||
|
||
For more information about EINJ, please refer to ACPI specification | ||
version 4.0, section 17.5. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
/* | ||
* Bridge between MCE and APEI | ||
* | ||
* On some machine, corrected memory errors are reported via APEI | ||
* generic hardware error source (GHES) instead of corrected Machine | ||
* Check. These corrected memory errors can be reported to user space | ||
* through /dev/mcelog via faking a corrected Machine Check, so that | ||
* the error memory page can be offlined by /sbin/mcelog if the error | ||
* count for one page is beyond the threshold. | ||
* | ||
* For fatal MCE, save MCE record into persistent storage via ERST, so | ||
* that the MCE record can be logged after reboot via ERST. | ||
* | ||
* Copyright 2010 Intel Corp. | ||
* Author: Huang Ying <ying.huang@intel.com> | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License version | ||
* 2 as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
*/ | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/acpi.h> | ||
#include <linux/cper.h> | ||
#include <acpi/apei.h> | ||
#include <asm/mce.h> | ||
|
||
#include "mce-internal.h" | ||
|
||
void apei_mce_report_mem_error(int corrected, struct cper_sec_mem_err *mem_err) | ||
{ | ||
struct mce m; | ||
|
||
/* Only corrected MC is reported */ | ||
if (!corrected) | ||
return; | ||
|
||
mce_setup(&m); | ||
m.bank = 1; | ||
/* Fake a memory read corrected error with unknown channel */ | ||
m.status = MCI_STATUS_VAL | MCI_STATUS_EN | MCI_STATUS_ADDRV | 0x9f; | ||
m.addr = mem_err->physical_addr; | ||
mce_log(&m); | ||
mce_notify_irq(); | ||
} | ||
EXPORT_SYMBOL_GPL(apei_mce_report_mem_error); | ||
|
||
#define CPER_CREATOR_MCE \ | ||
UUID_LE(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c, \ | ||
0x64, 0x90, 0xb8, 0x9d) | ||
#define CPER_SECTION_TYPE_MCE \ | ||
UUID_LE(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96, \ | ||
0x04, 0x4a, 0x38, 0xfc) | ||
|
||
/* | ||
* CPER specification (in UEFI specification 2.3 appendix N) requires | ||
* byte-packed. | ||
*/ | ||
struct cper_mce_record { | ||
struct cper_record_header hdr; | ||
struct cper_section_descriptor sec_hdr; | ||
struct mce mce; | ||
} __packed; | ||
|
||
int apei_write_mce(struct mce *m) | ||
{ | ||
struct cper_mce_record rcd; | ||
|
||
memset(&rcd, 0, sizeof(rcd)); | ||
memcpy(rcd.hdr.signature, CPER_SIG_RECORD, CPER_SIG_SIZE); | ||
rcd.hdr.revision = CPER_RECORD_REV; | ||
rcd.hdr.signature_end = CPER_SIG_END; | ||
rcd.hdr.section_count = 1; | ||
rcd.hdr.error_severity = CPER_SER_FATAL; | ||
/* timestamp, platform_id, partition_id are all invalid */ | ||
rcd.hdr.validation_bits = 0; | ||
rcd.hdr.record_length = sizeof(rcd); | ||
rcd.hdr.creator_id = CPER_CREATOR_MCE; | ||
rcd.hdr.notification_type = CPER_NOTIFY_MCE; | ||
rcd.hdr.record_id = cper_next_record_id(); | ||
rcd.hdr.flags = CPER_HW_ERROR_FLAGS_PREVERR; | ||
|
||
rcd.sec_hdr.section_offset = (void *)&rcd.mce - (void *)&rcd; | ||
rcd.sec_hdr.section_length = sizeof(rcd.mce); | ||
rcd.sec_hdr.revision = CPER_SEC_REV; | ||
/* fru_id and fru_text is invalid */ | ||
rcd.sec_hdr.validation_bits = 0; | ||
rcd.sec_hdr.flags = CPER_SEC_PRIMARY; | ||
rcd.sec_hdr.section_type = CPER_SECTION_TYPE_MCE; | ||
rcd.sec_hdr.section_severity = CPER_SER_FATAL; | ||
|
||
memcpy(&rcd.mce, m, sizeof(*m)); | ||
|
||
return erst_write(&rcd.hdr); | ||
} | ||
|
||
ssize_t apei_read_mce(struct mce *m, u64 *record_id) | ||
{ | ||
struct cper_mce_record rcd; | ||
ssize_t len; | ||
|
||
len = erst_read_next(&rcd.hdr, sizeof(rcd)); | ||
if (len <= 0) | ||
return len; | ||
/* Can not skip other records in storage via ERST unless clear them */ | ||
else if (len != sizeof(rcd) || | ||
uuid_le_cmp(rcd.hdr.creator_id, CPER_CREATOR_MCE)) { | ||
if (printk_ratelimit()) | ||
pr_warning( | ||
"MCE-APEI: Can not skip the unknown record in ERST"); | ||
return -EIO; | ||
} | ||
|
||
memcpy(m, &rcd.mce, sizeof(*m)); | ||
*record_id = rcd.hdr.record_id; | ||
|
||
return sizeof(*m); | ||
} | ||
|
||
/* Check whether there is record in ERST */ | ||
int apei_check_mce(void) | ||
{ | ||
return erst_get_record_count(); | ||
} | ||
|
||
int apei_clear_mce(u64 record_id) | ||
{ | ||
return erst_clear(record_id); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.