From: "Jan Beulich" Subject: [PATCH] i386: eliminate unsupported CPUs' MCA handling code Date: Wed, 15 Jul 2009 13:54:39 +0100 Message-ID: <4A5DEDAF020000780000A89C@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Neither Intel P5 nor Winchip are supported by Xen (due to -march=3Di686 being passed to the compiler), so there is no point in having code for handling their (rudimentary) MCA capabilities. Signed-off-by: Jan Beulich --- 2009-07-10.orig/xen/arch/x86/cpu/mcheck/Makefile 2009-07-15 = 12:36:46.000000000 +0200 +++ 2009-07-10/xen/arch/x86/cpu/mcheck/Makefile 2009-07-15 12:33:44.0000000= 00 +0200 @@ -6,5 +6,3 @@ obj-y +=3D mctelem.o obj-y +=3D mce.o obj-y +=3D mce_intel.o obj-y +=3D non-fatal.o -obj-$(x86_32) +=3D p5.o -obj-$(x86_32) +=3D winchip.o --- 2009-07-10.orig/xen/arch/x86/cpu/mcheck/mce.c 2009-07-15 = 12:27:41.000000000 +0200 +++ 2009-07-10/xen/arch/x86/cpu/mcheck/mce.c 2009-07-15 12:34:47.0000000= 00 +0200 @@ -617,12 +617,6 @@ void mcheck_init(struct cpuinfo_x86 *c) =20 case X86_VENDOR_INTEL: switch (c->x86) { - case 5: -#ifndef CONFIG_X86_64 - inited =3D intel_p5_mcheck_init(c); -#endif - break; - case 6: case 15: inited =3D intel_mcheck_init(c); @@ -630,14 +624,6 @@ void mcheck_init(struct cpuinfo_x86 *c) } break; =20 -#ifndef CONFIG_X86_64 - case X86_VENDOR_CENTAUR: - if (c->x86=3D=3D5) { - inited =3D winchip_mcheck_init(c); - } - break; -#endif - default: break; } --- 2009-07-10.orig/xen/arch/x86/cpu/mcheck/mce.h 2009-07-15 = 11:52:08.000000000 +0200 +++ 2009-07-10/xen/arch/x86/cpu/mcheck/mce.h 2009-07-15 12:35:06.0000000= 00 +0200 @@ -17,8 +17,6 @@ int amd_k7_mcheck_init(struct cpuinfo_x8 int amd_k8_mcheck_init(struct cpuinfo_x86 *c); int amd_f10_mcheck_init(struct cpuinfo_x86 *c); =20 -int intel_p5_mcheck_init(struct cpuinfo_x86 *c); -int winchip_mcheck_init(struct cpuinfo_x86 *c); int intel_mcheck_init(struct cpuinfo_x86 *c); =20 void intel_mcheck_timer(struct cpuinfo_x86 *c); --- 2009-07-10.orig/xen/arch/x86/cpu/mcheck/p5.c 2009-07-15 = 12:36:46.000000000 +0200 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/* - * P5 specific Machine Check Exception Reporting - * (C) Copyright 2002 Alan Cox - */ - -#include -#include -#include -#include - -#include =20 -#include -#include - -#include "mce.h" -#include "x86_mca.h" - -/* Machine check handler for Pentium class Intel */ -static void pentium_machine_check(struct cpu_user_regs * regs, long = error_code) -{ - u32 loaddr, hi, lotype; - rdmsr(MSR_IA32_P5_MC_ADDR, loaddr, hi); - rdmsr(MSR_IA32_P5_MC_TYPE, lotype, hi); - printk(KERN_EMERG "CPU#%d: Machine Check Exception: 0x%8X (type = 0x%8X).\n", smp_processor_id(), loaddr, lotype); - if(lotype&(1<<5)) - printk(KERN_EMERG "CPU#%d: Possible thermal failure (CPU = on fire ?).\n", smp_processor_id()); - add_taint(TAINT_MACHINE_CHECK); -} - -/* Set up machine check reporting for processors with Intel style MCE */ -int intel_p5_mcheck_init(struct cpuinfo_x86 *c) -{ - u32 l, h; -=09 - /* Default P5 to off as its often misconnected */ - if(mce_disabled !=3D -1) - return 0; - x86_mce_vector_register(pentium_machine_check); - - /* Read registers before enabling */ - rdmsr(MSR_IA32_P5_MC_ADDR, l, h); - rdmsr(MSR_IA32_P5_MC_TYPE, l, h); - printk(KERN_INFO "Intel old style machine check architecture = supported.\n"); - - /* Enable MCE */ - set_in_cr4(X86_CR4_MCE); - printk(KERN_INFO "Intel old style machine check reporting enabled = on CPU#%d.\n", smp_processor_id()); - - return 1; -} --- 2009-07-10.orig/xen/arch/x86/cpu/mcheck/winchip.c 2009-07-15 = 12:36:46.000000000 +0200 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/* - * IDT Winchip specific Machine Check Exception Reporting - * (C) Copyright 2002 Alan Cox - */ - -#include -#include -#include -#include -#include - -#include =20 -#include -#include - -#include "mce.h" - -/* Machine check handler for WinChip C6 */ -static void winchip_machine_check(struct cpu_user_regs * regs, long = error_code) -{ - printk(KERN_EMERG "CPU0: Machine Check Exception.\n"); - add_taint(TAINT_MACHINE_CHECK); -} - -/* Set up machine check reporting on the Winchip C6 series */ -int winchip_mcheck_init(struct cpuinfo_x86 *c) -{ - u32 lo, hi; - - wmb(); - x86_mce_vector_register(winchip_machine_check); - rdmsr(MSR_IDT_FCR1, lo, hi); - lo|=3D (1<<2); /* Enable EIERRINT (int 18 MCE) */ - lo&=3D ~(1<<4); /* Enable MCE */ - wrmsr(MSR_IDT_FCR1, lo, hi); - set_in_cr4(X86_CR4_MCE); - printk(KERN_INFO "Winchip machine check reporting enabled on = CPU#0.\n"); - return (1); -}