Skip to contentSkip to conversation

xen: move mce quirks into seperate files

PATCH New Christoph Egger 1 participant 1 message Aug 14, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: move mce quirks into seperate files

Hi!

Attached patch moves mce quirks for AMD CPUs into a seperate file.
Quirk handling is designed to easily add more quirks when needed w/o messing around in the normal mce code.

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
xen/arch/x86/cpu/mcheck/Makefile +1 -0
diff -r 46b874d60375 xen/arch/x86/cpu/mcheck/Makefile
@@ -5,4 +5,5 @@ obj-y += amd_f10.o
 obj-y += mctelem.o
 obj-y += mce.o
 obj-y += mce_intel.o
+obj-y += mce_amd_quirks.o
 obj-y += non-fatal.o
xen/arch/x86/cpu/mcheck/amd_k8.c +7 -17
diff -r 46b874d60375 xen/arch/x86/cpu/mcheck/amd_k8.c
@@ -67,7 +67,7 @@
 #include <asm/msr.h>
 
 #include "mce.h"
-
+#include "mce_quirks.h"
 
 /* Machine Check Handler for AMD K8 family series */
 static void k8_machine_check(struct cpu_user_regs *regs, long error_code)
@@ -79,31 +79,21 @@ static void k8_machine_check(struct cpu_
 int amd_k8_mcheck_init(struct cpuinfo_x86 *c)
 {
 	uint32_t i;
+	enum mcequirk_amd_flags quirkflag;
 
 	/* Check for PPro style MCA; our caller has confirmed MCE support. */
 	if (!cpu_has(c, X86_FEATURE_MCA))
 		return 0;
 
+	quirkflag = mcequirk_lookup_amd_quirkdata(c);
+
 	mce_cap_init();
 	x86_mce_vector_register(k8_machine_check);
 
 	for (i = 0; i < nr_mce_banks; i++) {
-		switch (i) {
-		case 4: /* Northbridge */
-			if (c->x86 == 0xf) {
-				/*
-				 * Enable error reporting of all errors except
-				 * for GART TBL walk error reporting, which
-				 * trips off incorrectly with IOMMU & 3ware &
-				 * Cerberus.
-				 */
-				wrmsrl(MSR_IA32_MC4_CTL, ~(1ULL << 10));
-				wrmsrl(MSR_IA32_MC4_STATUS, 0x0ULL);
-				break;
-			}
-			/* fall through */
-
-		default:
+		if (quirkflag == MCEQUIRK_K8_GART && i == 4) {
+			mcequirk_amd_apply(quirkflag);
+		} else {
 			/* Enable error reporting of all errors */
 			wrmsrl(MSR_IA32_MC0_CTL + 4 * i, 0xffffffffffffffffULL);
 			wrmsrl(MSR_IA32_MC0_STATUS + 4 * i, 0x0ULL);
xen/arch/x86/cpu/mcheck/mce_amd_quirks.c new file +73 -0

73 lines not on this page · raw message

xen/arch/x86/cpu/mcheck/mce_quirks.h new file +54 -0

54 lines not on this page · raw message

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel