]> err.no Git - linux-2.6/blobdiff - arch/x86/kernel/cpu/mcheck/mce_64.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg...
[linux-2.6] / arch / x86 / kernel / cpu / mcheck / mce_64.c
index 8cd47fe2ef2c969e5e4a6a0473482dfc81d592ad..e07e8c068ae00c464cdbf828cfbc8c67aaf76202 100644 (file)
@@ -49,7 +49,7 @@ static int banks;
 static unsigned long bank[NR_BANKS] = { [0 ... NR_BANKS-1] = ~0UL };
 static unsigned long notify_user;
 static int rip_msr;
-static int mce_bootlog = 1;
+static int mce_bootlog = -1;
 static atomic_t mce_events;
 
 static char trigger[128];
@@ -192,10 +192,10 @@ void do_machine_check(struct pt_regs * regs, long error_code)
 
        atomic_inc(&mce_entry);
 
-       if (regs)
-               notify_die(DIE_NMI, "machine check", regs, error_code, 18,
-                          SIGKILL);
-       if (!banks)
+       if ((regs
+            && notify_die(DIE_NMI, "machine check", regs, error_code,
+                          18, SIGKILL) == NOTIFY_STOP)
+           || !banks)
                goto out2;
 
        memset(&m, 0, sizeof(struct mce));
@@ -471,13 +471,15 @@ static void mce_init(void *dummy)
 static void __cpuinit mce_cpu_quirks(struct cpuinfo_x86 *c)
 {
        /* This should be disabled by the BIOS, but isn't always */
-       if (c->x86_vendor == X86_VENDOR_AMD && c->x86 == 15) {
-               /* disable GART TBL walk error reporting, which trips off
-                  incorrectly with the IOMMU & 3ware & Cerberus. */
-               clear_bit(10, &bank[4]);
-               /* Lots of broken BIOS around that don't clear them
-                  by default and leave crap in there. Don't log. */
-               mce_bootlog = 0;
+       if (c->x86_vendor == X86_VENDOR_AMD) {
+               if(c->x86 == 15)
+                       /* disable GART TBL walk error reporting, which trips off
+                          incorrectly with the IOMMU & 3ware & Cerberus. */
+                       clear_bit(10, &bank[4]);
+               if(c->x86 <= 17 && mce_bootlog < 0)
+                       /* Lots of broken BIOS around that don't clear them
+                          by default and leave crap in there. Don't log. */
+                       mce_bootlog = 0;
        }
 
 }
@@ -634,8 +636,7 @@ static unsigned int mce_poll(struct file *file, poll_table *wait)
        return 0;
 }
 
-static int mce_ioctl(struct inode *i, struct file *f,unsigned int cmd,
-                    unsigned long arg)
+static long mce_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
 {
        int __user *p = (int __user *)arg;
 
@@ -664,7 +665,7 @@ static const struct file_operations mce_chrdev_ops = {
        .release = mce_release,
        .read = mce_read,
        .poll = mce_poll,
-       .ioctl = mce_ioctl,
+       .unlocked_ioctl = mce_ioctl,
 };
 
 static struct miscdevice mce_log_device = {
@@ -855,8 +856,8 @@ static void mce_remove_device(unsigned int cpu)
 }
 
 /* Get notified when a cpu comes on/off. Be hotplug friendly. */
-static int
-mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
+static int __cpuinit mce_cpu_callback(struct notifier_block *nfb,
+                                     unsigned long action, void *hcpu)
 {
        unsigned int cpu = (unsigned long)hcpu;
 
@@ -873,7 +874,7 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
        return NOTIFY_OK;
 }
 
-static struct notifier_block mce_cpu_notifier = {
+static struct notifier_block mce_cpu_notifier __cpuinitdata = {
        .notifier_call = mce_cpu_callback,
 };