lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1248106385-27514-8-git-send-email-borislav.petkov@amd.com>
Date:	Mon, 20 Jul 2009 18:12:58 +0200
From:	Borislav Petkov <borislav.petkov@....com>
To:	<mingo@...e.hu>, <hpa@...or.com>, <tglx@...utronix.de>,
	<norsk5@...oo.com>, <aris@...hat.com>
CC:	<linux-kernel@...r.kernel.org>, <x86@...nel.org>,
	Andi Kleen <andi@...stfloor.org>
Subject: [PATCH 07/14] mce3: pass mce info to EDAC for decoding

Use a weakly defined symbol instead of ugly ifdefs.

CC: Andi Kleen <andi@...stfloor.org>
Signed-off-by: Borislav Petkov <borislav.petkov@....com>
---
 arch/x86/kernel/cpu/mcheck/mce.c |    7 +++++++
 drivers/edac/amd64_edac.c        |   16 ++++++++++++++++
 drivers/edac/amd64_edac.h        |    1 +
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 484c1e5..36d986c 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -183,6 +183,11 @@ void mce_log(struct mce *mce)
 	set_bit(0, &mce_need_notify);
 }
 
+void __attribute__((weak)) decode_mce(struct mce *m)
+{
+	return;
+}
+
 static void print_mce(struct mce *m)
 {
 	printk(KERN_EMERG
@@ -205,6 +210,8 @@ static void print_mce(struct mce *m)
 	printk(KERN_EMERG "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x\n",
 			m->cpuvendor, m->cpuid, m->time, m->socketid,
 			m->apicid);
+
+	decode_mce(m);
 }
 
 static void print_mce_head(void)
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 68c5e6b..af08c9e 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -2340,6 +2340,22 @@ void amd64_decode_nb_mce(struct mem_ctl_info *mci, struct err_regs *regs,
 		edac_mc_handle_ue_no_info(mci, "UE bit is set");
 }
 
+void decode_mce(struct mce *m)
+{
+	struct err_regs regs;
+
+	if (m->bank != 4)
+		return;
+
+	regs.nbsl  = (u32) m->status;
+	regs.nbsh  = (u32)(m->status >> 32);
+	regs.nbeal = (u32) m->addr;
+	regs.nbeah = (u32)(m->addr >> 32);
+
+	amd64_decode_nb_mce(mci_lookup[0], &regs, 1);
+}
+
+
 /*
  * The main polling 'check' function, called FROM the edac core to perform the
  * error checking and if an error is encountered, error processing.
diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h
index 6e3a9a7..7c9138e 100644
--- a/drivers/edac/amd64_edac.h
+++ b/drivers/edac/amd64_edac.h
@@ -71,6 +71,7 @@
 #include <linux/mmzone.h>
 #include <linux/edac.h>
 #include <asm/msr.h>
+#include <asm/mce.h>
 #include "edac_core.h"
 
 #define amd64_printk(level, fmt, arg...) \
-- 
1.6.3.3


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ