Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199246
b: refs/heads/master
c: d334a49
h: refs/heads/master
v: v3
  • Loading branch information
Huang Ying authored and Len Brown committed May 20, 2010
1 parent e6710c7 commit 3bc7ad2
Show file tree
Hide file tree
Showing 7 changed files with 505 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 06d65deade9aabba58e0518df86dcd324e86b832
refs/heads/master: d334a49113a4a33109fd24e46073280ecd1bea0d
8 changes: 8 additions & 0 deletions trunk/arch/x86/include/asm/mce.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,5 +225,13 @@ extern void mcheck_intel_therm_init(void);
static inline void mcheck_intel_therm_init(void) { }
#endif

/*
* Used by APEI to report memory error via /dev/mcelog
*/

struct cper_sec_mem_err;
extern void apei_mce_report_mem_error(int corrected,
struct cper_sec_mem_err *mem_err);

#endif /* __KERNEL__ */
#endif /* _ASM_X86_MCE_H */
2 changes: 2 additions & 0 deletions trunk/arch/x86/kernel/cpu/mcheck/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ obj-$(CONFIG_X86_MCE_THRESHOLD) += threshold.o
obj-$(CONFIG_X86_MCE_INJECT) += mce-inject.o

obj-$(CONFIG_X86_THERMAL_VECTOR) += therm_throt.o

obj-$(CONFIG_ACPI_APEI) += mce-apei.o
52 changes: 52 additions & 0 deletions trunk/arch/x86/kernel/cpu/mcheck/mce-apei.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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.
*
* 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);
14 changes: 14 additions & 0 deletions trunk/drivers/acpi/apei/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ config ACPI_APEI
especially. In addition it supports error serialization and
error injection.

config ACPI_APEI_GHES
tristate "APEI Generic Hardware Error Source"
depends on ACPI_APEI && X86
select ACPI_HED
help
Generic Hardware Error Source provides a way to report
platform hardware errors (such as that from chipset). It
works in so called "Firmware First" mode, that is, hardware
errors are reported to firmware firstly, then reported to
Linux by firmware. This way, some non-standard hardware
error registers or non-standard hardware link can be checked
by firmware to produce more valuable hardware error
information for Linux.

config ACPI_APEI_EINJ
tristate "APEI Error INJection (EINJ)"
depends on ACPI_APEI && DEBUG_FS
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/acpi/apei/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
obj-$(CONFIG_ACPI_APEI) += apei.o
obj-$(CONFIG_ACPI_APEI_GHES) += ghes.o
obj-$(CONFIG_ACPI_APEI_EINJ) += einj.o

apei-y := apei-base.o hest.o cper.o
Loading

0 comments on commit 3bc7ad2

Please sign in to comment.