]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/x86/kernel/cpu/mcheck/winchip.c
x86/cpu: Convert printk(KERN_<LEVEL> ...) to pr_<level>(...)
[mirror_ubuntu-artful-kernel.git] / arch / x86 / kernel / cpu / mcheck / winchip.c
CommitLineData
1da177e4
LT
1/*
2 * IDT Winchip specific Machine Check Exception Reporting
87c6fe26 3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk>
1da177e4 4 */
1da177e4 5#include <linux/interrupt.h>
91425084
IM
6#include <linux/kernel.h>
7#include <linux/types.h>
1da177e4 8
4de81629 9#include <asm/processor.h>
95927475 10#include <asm/traps.h>
375074cc 11#include <asm/tlbflush.h>
9e55e44e 12#include <asm/mce.h>
1da177e4
LT
13#include <asm/msr.h>
14
91425084 15/* Machine check handler for WinChip C6: */
4de81629 16static void winchip_machine_check(struct pt_regs *regs, long error_code)
1da177e4 17{
8c84014f 18 ist_enter(regs);
95927475 19
1b74dde7 20 pr_emerg("CPU0: Machine Check Exception.\n");
373d4d09 21 add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
95927475 22
8c84014f 23 ist_exit(regs);
1da177e4
LT
24}
25
26/* Set up machine check reporting on the Winchip C6 series */
31ab269a 27void winchip_mcheck_init(struct cpuinfo_x86 *c)
1da177e4
LT
28{
29 u32 lo, hi;
91425084 30
1da177e4 31 machine_check_vector = winchip_machine_check;
91425084 32 /* Make sure the vector pointer is visible before we enable MCEs: */
1da177e4 33 wmb();
91425084 34
1da177e4 35 rdmsr(MSR_IDT_FCR1, lo, hi);
4de81629
PC
36 lo |= (1<<2); /* Enable EIERRINT (int 18 MCE) */
37 lo &= ~(1<<4); /* Enable MCE */
1da177e4 38 wrmsr(MSR_IDT_FCR1, lo, hi);
91425084 39
375074cc 40 cr4_set_bits(X86_CR4_MCE);
91425084 41
1b74dde7 42 pr_info("Winchip machine check reporting enabled on CPU#0.\n");
1da177e4 43}