Path: blob/master/arch/x86/kernel/cpu/mcheck/winchip.c
10775 views
/*1* IDT Winchip specific Machine Check Exception Reporting2* (C) Copyright 2002 Alan Cox <[email protected]>3*/4#include <linux/interrupt.h>5#include <linux/kernel.h>6#include <linux/types.h>7#include <linux/init.h>89#include <asm/processor.h>10#include <asm/system.h>11#include <asm/mce.h>12#include <asm/msr.h>1314/* Machine check handler for WinChip C6: */15static void winchip_machine_check(struct pt_regs *regs, long error_code)16{17printk(KERN_EMERG "CPU0: Machine Check Exception.\n");18add_taint(TAINT_MACHINE_CHECK);19}2021/* Set up machine check reporting on the Winchip C6 series */22void winchip_mcheck_init(struct cpuinfo_x86 *c)23{24u32 lo, hi;2526machine_check_vector = winchip_machine_check;27/* Make sure the vector pointer is visible before we enable MCEs: */28wmb();2930rdmsr(MSR_IDT_FCR1, lo, hi);31lo |= (1<<2); /* Enable EIERRINT (int 18 MCE) */32lo &= ~(1<<4); /* Enable MCE */33wrmsr(MSR_IDT_FCR1, lo, hi);3435set_in_cr4(X86_CR4_MCE);3637printk(KERN_INFO38"Winchip machine check reporting enabled on CPU#0.\n");39}404142